Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
update collectives teshsuite from mpich git (only minor changes)
[simgrid.git] / teshsuite / smpi / mpich3-test / coll / alltoallv.c
index bcae133..844596e 100644 (file)
@@ -45,6 +45,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 */
@@ -61,6 +62,7 @@ int main( int argc, char **argv )
       if (!sendcounts || !recvcounts || !rdispls || !sdispls) {
        fprintf( stderr, "Could not allocate arg items!\n" );
        MPI_Abort( comm, 1 );
+        exit(1);
       }
       for (i=0; i<size; i++) {
        sendcounts[i] = i;
@@ -94,6 +96,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 */
@@ -122,6 +125,12 @@ int main( int argc, char **argv )
           }
         }
       }
+
+      /* Check to make sure that aliasing is disallowed correctly */
+      MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+      if (MPI_SUCCESS == MPI_Alltoallv(rbuf, recvcounts, rdispls, MPI_INT,
+                                       rbuf, recvcounts, rdispls, MPI_INT, comm))
+          err++;
 #endif
 
       free( rdispls );