Commit df8dcc52 authored by Deike Kleberg's avatar Deike Kleberg
Browse files

Interim 1

parent 1339f0f3
......@@ -11,10 +11,10 @@
#include "pio_util.h"
enum {
nProcsIO = 1,
IOMode = PIO_NONE,
nProcsIO = 2,
//IOMode = PIO_NONE,
//IOMode = PIO_MPI_NONB,
//IOMode = PIO_POSIX_FPGUARD_SENDRECV,
IOMode = PIO_POSIX_FPGUARD_SENDRECV,
//IOMode = PIO_POSIX_ASYNCH,
//IOMode = PIO_POSIX_NONB,
filetype = FILETYPE_GRB,
......
......@@ -189,8 +189,11 @@ void backendCleanup ( void )
case PIO_MPI_NONB:
finalizeMPINONB ();
break;
case PIO_POSIX_FPGUARD_SENDRECV:
finalizePOSIXFPGUARDSENDRECV ();
break;
default:
xdebug ( " backendCleanup function not implemented yet." );
xdebug ( " BACKENDCLEANUP FUNCTION NOT IMPLEMENTED YET." );
}
}
......
......@@ -94,6 +94,7 @@ int fowPOSIXFPGUARDSENDRECV ( const char * );
int fcPOSIXFPGUARDSENDRECV ( int );
size_t fwPOSIXFPGUARDSENDRECV ( int, int, const void *, size_t );
void initPOSIXFPGUARDSENDRECV ( void );
void finalizePOSIXFPGUARDSENDRECV ( void );
/* pio_posixnonb.c */
void pwPOSIXNONB ( void );
......
......@@ -262,15 +262,6 @@ int fcMPINONB ( int fileID )
iret = queueDelNode ( bibAFiledataM, fileID );
/*
if ( !bibAFiledataM->head )
{
xdebug ( "IOPE%d: cleanup queue",
rankNode );
free ( bibAFiledataM );
}
*/
/* timer output */
if ( ddebug == MAXDEBUG )
......
......@@ -300,14 +300,28 @@ void fpgPOSIXFPGUARDSENDRECV ( void )
}
if ( bfd->finished )
{
queueDelNode ( bibBFiledataPF, rtag->id );
if ( !bibBFiledataPF->head )
{
queueDestroy ( bibBFiledataPF );
return;
}
}
queueDelNode ( bibBFiledataPF, rtag->id );
case IO_Finalize:
{
int buffer = CDI_UNDEFID;
xmpi ( MPI_Recv ( &buffer, 1, MPI_INT, source, status.MPI_TAG,
commNode, &status ));
if ( bibBFiledataPF->head != NULL )
{
xabort ( "queue bibBFiledataM not empty" );
}
else
{
xdebug ( "cleanup queue" );
queueDestroy ( bibBFiledataPF );
}
return;
}
break;
default:
xabort ( "COMMAND NOT IMPLEMENTED" );
}
}
}
......@@ -452,12 +466,6 @@ int fcPOSIXFPGUARDSENDRECV ( int id )
iret = queueDelNode ( bibAFiledataPF, id );
if ( !bibAFiledataPF->head )
{
xdebug ( "cleanup queue" );
queueDestroy ( bibAFiledataPF );
}
return iret;
}
......@@ -538,6 +546,28 @@ int fowPOSIXFPGUARDSENDRECV ( const char *filename )
/***************************************************************/
void finalizePOSIXFPGUARDSENDRECV ( void )
{
int buffer = 0, tag, specialRank = commInqSpecialRankNode ();
MPI_Comm commNode = commInqCommNode ();
tag = setTag ( 0, IO_Finalize );
xmpi ( MPI_Send ( &buffer, 1, MPI_INT, specialRank, tag, commNode ));
if ( bibAFiledataPF->head != NULL )
{
xabort ( "queue bibAFiledataM not empty" );
}
else
{
xdebug ( "cleanup queue" );
queueDestroy ( bibAFiledataPF );
}
}
/***************************************************************/
void initPOSIXFPGUARDSENDRECV ( void )
{
if ( commInqSizeNode () < 2 ) xabort ( "usage: #pes/#nodes >= 2" );
......
......@@ -617,7 +617,9 @@ int streamOpen(const char *filename, const char *filemode, int filetype)
if ( ! filename || ! filemode || filetype < 0 ) return (CDI_EINVAL);
xdebug( "namespaceHasLocalFile(%d)=%s", namespaceGetActive(),
xdebug( "filename = %s, filemode = %s, filetype = %d, "
"namespaceHasLocalFile(%d)=%s",
filename, filemode, filetype, namespaceGetActive(),
namespaceHasLocalFile ( namespaceGetActive ()) ? "true":"false");
if ( hasLocalFile )
......@@ -1125,14 +1127,14 @@ void streamClose(int streamID)
int vlistID;
stream_t *streamptr;
xdebug ( "streamID=%d", streamID );
streamptr = stream_to_pointer(streamID);
stream_check_ptr(__func__, streamptr);
if ( CDI_Debug )
Message("fileID = %d filename = %s", streamID, streamptr->filename);
xdebug ( "streamID=%d, filename = %s", streamID, streamptr->filename );
fileID = streamptr->fileID;
filetype = streamptr->filetype;
vlistID = streamptr->vlistID;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment