Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MPI_Abort can theorically fail. Add a call to exit() to ensure that the program...
[simgrid.git] / teshsuite / smpi / mpich3-test / pt2pt / pscancel.c
index e32e5f1..08b6b2c 100644 (file)
@@ -43,6 +43,7 @@ int main( int argc, char *argv[] )
            if (!buf) {
                fprintf( stderr, "Unable to allocate %d bytes\n", n );
                MPI_Abort( MPI_COMM_WORLD, 1 );
+                exit(1);
            }
            MPI_Send_init( buf, n, MPI_CHAR, dest, cs+n+1, comm, &req );
            MPI_Start( &req );
@@ -80,6 +81,7 @@ int main( int argc, char *argv[] )
                {
                    fprintf( stderr, "Unable to allocate %d bytes\n", nn);
                    MPI_Abort( MPI_COMM_WORLD, 1 );
+                    exit(1);
                }
                MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
                free(btemp);
@@ -96,12 +98,14 @@ int main( int argc, char *argv[] )
            if (!buf) {
                fprintf( stderr, "Unable to allocate %d bytes\n", n );
                MPI_Abort( MPI_COMM_WORLD, 1 );
+                exit(1);
            }
            bsendbufsize = n + MPI_BSEND_OVERHEAD;
            bsendbuf = (char *)malloc( bsendbufsize );
            if (!bsendbuf) {
                fprintf( stderr, "Unable to allocate %d bytes for bsend\n", n );
                MPI_Abort( MPI_COMM_WORLD, 1 );
+                exit(1);
            }
            MPI_Buffer_attach( bsendbuf, bsendbufsize );
            MPI_Bsend_init( buf, n, MPI_CHAR, dest, cs+n+2, comm, &req );
@@ -142,6 +146,7 @@ int main( int argc, char *argv[] )
                {
                    fprintf( stderr, "Unable to allocate %d bytes\n", nn);
                    MPI_Abort( MPI_COMM_WORLD, 1 );
+                    exit(1);
                }
                MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
                free(btemp);
@@ -162,6 +167,7 @@ int main( int argc, char *argv[] )
            if (!buf) {
                fprintf( stderr, "Unable to allocate %d bytes\n", n );
                MPI_Abort( MPI_COMM_WORLD, 1 );
+                exit(1);
            }
            MPI_Rsend_init( buf, n, MPI_CHAR, dest, cs+n+3, comm, &req );
            MPI_Start( &req );
@@ -208,6 +214,7 @@ int main( int argc, char *argv[] )
                {
                    fprintf( stderr, "Unable to allocate %d bytes\n", n);
                    MPI_Abort( MPI_COMM_WORLD, 1 );
+                    exit(1);
                }
                MPI_Recv( btemp, n, MPI_CHAR, 0, tag, comm, &status );
                free(btemp);
@@ -222,6 +229,7 @@ int main( int argc, char *argv[] )
            if (!buf) {
                fprintf( stderr, "Unable to allocate %d bytes\n", n );
                MPI_Abort( MPI_COMM_WORLD, 1 );
+                exit(1);
            }
            MPI_Ssend_init( buf, n, MPI_CHAR, dest, cs+n+4, comm, &req );
            MPI_Start( &req );
@@ -259,6 +267,7 @@ int main( int argc, char *argv[] )
                {
                    fprintf( stderr, "Unable to allocate %d bytes\n", nn);
                    MPI_Abort( MPI_COMM_WORLD, 1 );
+                    exit(1);
                }
                MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
                free(btemp);