Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove warning with mc
[simgrid.git] / teshsuite / smpi / mpich3-test / coll / alltoallw2.c
index 7d40236..981b770 100644 (file)
@@ -47,6 +47,7 @@ int main( int argc, char **argv )
       if (!sbuf || !rbuf) {
        fprintf( stderr, "Could not allocated buffers!\n" );
        MPI_Abort( comm, 1 );
+        exit(1);
       }
       
       /* Load up the buffers */
@@ -65,6 +66,7 @@ int main( int argc, char **argv )
       if (!sendcounts || !recvcounts || !rdispls || !sdispls || !sendtypes || !recvtypes) {
        fprintf( stderr, "Could not allocate arg items!\n" );
        MPI_Abort( comm, 1 );
+        exit(1);
       }
       /* Note that process 0 sends no data (sendcounts[0] = 0) */
       for (i=0; i<size; i++) {
@@ -101,6 +103,7 @@ int main( int argc, char **argv )
       if (!rbuf) {
         fprintf( stderr, "Could not reallocate rbuf!\n" );
         MPI_Abort( comm, 1 );
+        exit(1);
       }
 
       /* Load up the buffers */
@@ -133,6 +136,11 @@ int main( int argc, char **argv )
           }
         }
       }
+
+      MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+      if (MPI_SUCCESS == MPI_Alltoallw(rbuf, recvcounts, rdispls, recvtypes,
+                                       rbuf, recvcounts, rdispls, recvtypes, comm))
+          err++;
 #endif
 
       free(recvtypes);