Commit 9a7e8b0a authored by Deike Kleberg's avatar Deike Kleberg
Browse files

catch MPI errors

parent cace7a29
......@@ -27,7 +27,7 @@ static int nlev[nVars] = {1,1,5,5,2};
#define maxlev 5
#define ntsteps 3
int IOModus = PIO_POSIX_FPGUARD_SENDRECV;
int IOModus = PIO_MPI_NONB;
void modelRun ()
......@@ -74,7 +74,7 @@ void modelRun ()
streamDefVlist ( streamID, vlistID);
#ifdef USE_MPI
MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
xmpi ( MPI_Comm_rank ( MPI_COMM_WORLD, &rank ));
pioMetadata ( nNodes, nodeSizes );
#endif
......@@ -137,11 +137,11 @@ int main (int argc, char *argv[])
MPI_Comm commGlob, commModel;
MPI_Init ( &argc, &argv);
MPI_Comm_dup ( MPI_COMM_WORLD, &commGlob );
MPI_Comm_set_errhandler ( commGlob, MPI_ERRORS_RETURN );
MPI_Comm_size ( commGlob, &sizeGlob );
MPI_Comm_rank ( commGlob, &rankGlob );
xmpi ( MPI_Init ( &argc, &argv));
xmpi ( MPI_Comm_dup ( MPI_COMM_WORLD, &commGlob ));
xmpi ( MPI_Comm_set_errhandler ( commGlob, MPI_ERRORS_RETURN ));
xmpi ( MPI_Comm_size ( commGlob, &sizeGlob ));
xmpi ( MPI_Comm_rank ( commGlob, &rankGlob ));
if ( nProcsIO <=0 || nProcsIO >= sizeGlob )
xabort ( "bad distribution of tasks on PEs" );
......
#ifdef HAVE_CONFIG_H
# include "config.h"
#include "config.h"
#endif
#include <stdbool.h>
......@@ -13,11 +13,8 @@
#include "pio_util.h"
#ifdef USE_MPI
#include "cdi.h"
#include "pio_impl.h"
#endif
#ifdef USE_MPI
......@@ -192,8 +189,8 @@ void setPioCommunicator ( MPI_Comm *myComm, MPI_Comm commF2C, int *color,
char *myHost, **allHosts, *allHosts0, *curr;
char hostname [ MPI_MAX_PROCESSOR_NAME + 1 ];
MPI_Comm_size ( commF2C, &size );
MPI_Comm_rank ( commF2C, &rank );
xmpi ( MPI_Comm_size ( commF2C, &size ));
xmpi ( MPI_Comm_rank ( commF2C, &rank ));
myHost = ( char * ) xmalloc ( MPI_MAX_PROCESSOR_NAME * sizeof ( char ));
......@@ -269,8 +266,8 @@ MPI_Comm bInit ( int ptype, MPI_Comm comm, int *color, int *nnodes )
*color = 1;
#ifdef USE_MPI
MPI_Comm_size ( comm, &size );
MPI_Comm_rank ( comm, &rank );
xmpi ( MPI_Comm_size ( comm, &size ));
xmpi ( MPI_Comm_rank ( comm, &rank ));
if ( ptype < 0 || ptype > maxPtype )
xabort ( "PIOTYPE is no valid modus" );
......@@ -291,8 +288,8 @@ MPI_Comm bInit ( int ptype, MPI_Comm comm, int *color, int *nnodes )
pioinfo->color = *color;
MPI_Comm_rank ( pioinfo->comm, &( pioinfo->rank ));
MPI_Comm_size ( pioinfo->comm, &( pioinfo->size ));
xmpi ( MPI_Comm_rank ( pioinfo->comm, &( pioinfo->rank )));
xmpi ( MPI_Comm_size ( pioinfo->comm, &( pioinfo->size )));
xdebug( "IOPE%d in bInit(), ptype=%d, initial_buffersize=%ld: "
"after init pioinfo ...",
......@@ -303,7 +300,7 @@ MPI_Comm bInit ( int ptype, MPI_Comm comm, int *color, int *nnodes )
switch ( pioinfo->type )
{
case PIO_NONE:
MPI_Comm_dup ( pioinfo->comm, &( pioinfo->collectorComm ));
xmpi ( MPI_Comm_dup ( pioinfo->comm, &( pioinfo->collectorComm )));
collectingData = 1;
break;
case PIO_MPI_NONB:
......@@ -349,10 +346,10 @@ void bFinalize ()
}
if ( pioinfo->collectorComm != MPI_COMM_NULL )
MPI_Comm_free ( &( pioinfo->collectorComm ));
xmpi ( MPI_Comm_free ( &( pioinfo->collectorComm )));
if ( pioinfo->comm != MPI_COMM_NULL )
MPI_Comm_free ( &( pioinfo->comm ));
xmpi ( MPI_Comm_free ( &( pioinfo->comm )));
free ( pioinfo );
#endif
......
......@@ -206,7 +206,7 @@ size_t fwMPINONB ( int fileID, int tsID, const void *buffer, size_t len )
curr = curr->next;
}
oldTsID = tsID;
MPI_Barrier ( pioinfo->comm );
xmpi ( MPI_Barrier ( pioinfo->comm ));
}
of = ( aFiledataM * ) queueIdx2val ( bibAFiledataM, fileID );
......@@ -272,8 +272,8 @@ int fcMPINONB ( int fileID )
if ( ddebug == MAXDEBUG )
{
MPI_Reduce ( &accumWait, &accumWaitMax,
1, MPI_DOUBLE, MPI_MAX, 0, pioinfo->comm );
xmpi ( MPI_Reduce ( &accumWait, &accumWaitMax,
1, MPI_DOUBLE, MPI_MAX, 0, pioinfo->comm ));
xdebug ( "IOPE%d: Wait time %15.10lf s",
pioinfo->rank, accumWait );
if ( pioinfo->rank == 0 )
......@@ -336,7 +336,7 @@ int fowMPINONB ( const char *filename )
buffersize = initial_buffersize;
}
MPI_Bcast ( &buffersize, 1, MPI_LONG, bcastRank, pioinfo->comm );
xmpi ( MPI_Bcast ( &buffersize, 1, MPI_LONG, bcastRank, pioinfo->comm ));
}
xdebug ( "buffersize=%d", buffersize );
......@@ -362,7 +362,7 @@ int initMPINONB ()
{
int collectingData = 1;
MPI_Comm_dup ( pioinfo->comm, &( pioinfo->collectorComm ));
xmpi ( MPI_Comm_dup ( pioinfo->comm, &( pioinfo->collectorComm )));
bibAFiledataM = queueInit ( destroyAFiledataMPINONB, compareNamesMPINONB );
......
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