X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b73466ada27682d1729f394549479da83ef4a99..f888b68a52740ad761cdd4fe614f251576b3697c:/teshsuite/smpi/mpich3-test/group/groupnullincl.c diff --git a/teshsuite/smpi/mpich3-test/group/groupnullincl.c b/teshsuite/smpi/mpich3-test/group/groupnullincl.c index 029471b26a..0f6224bdf2 100644 --- a/teshsuite/smpi/mpich3-test/group/groupnullincl.c +++ b/teshsuite/smpi/mpich3-test/group/groupnullincl.c @@ -8,7 +8,7 @@ #include #include "mpitest.h" -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0; int rc, result; @@ -16,57 +16,58 @@ int main( int argc, char *argv[] ) MPI_Group group, outgroup; MPI_Comm comm; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); /* To improve reporting of problems about operations, we - change the error handler to errors return */ - MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN ); + * change the error handler to errors return */ + MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); - while (MTestGetComm( &comm, 1 )) { - if (comm == MPI_COMM_NULL) continue; + while (MTestGetComm(&comm, 1)) { + if (comm == MPI_COMM_NULL) + continue; - MPI_Comm_group( comm, &group ); - rc = MPI_Group_incl( group, 0, 0, &outgroup ); - if (rc) { - errs++; - MTestPrintError( rc ); - printf( "Error in creating an empty group with (0,0)\n" ); - - /* Some MPI implementations may reject a null "ranks" pointer */ - rc = MPI_Group_incl( group, 0, ranks, &outgroup ); - if (rc) { - errs++; - MTestPrintError( rc ); - printf( "Error in creating an empty group with (0,ranks)\n" ); - } - } + MPI_Comm_group(comm, &group); + rc = MPI_Group_incl(group, 0, 0, &outgroup); + if (rc) { + errs++; + MTestPrintError(rc); + printf("Error in creating an empty group with (0,0)\n"); - if (outgroup != MPI_GROUP_EMPTY) { - /* Is the group equivalent to group empty? */ - rc = MPI_Group_compare( outgroup, MPI_GROUP_EMPTY, &result ); - if (result != MPI_IDENT) { - errs++; - MTestPrintError( rc ); - printf( "Did not create a group equivalent to an empty group\n" ); - } - } - rc = MPI_Group_free( &group ); - if (rc) { - errs++; - MTestPrintError( rc ); - } - if (outgroup != MPI_GROUP_NULL) { - rc = MPI_Group_free( &outgroup ); - if (rc) { - errs++; - MTestPrintError( rc ); - } - } + /* Some MPI implementations may reject a null "ranks" pointer */ + rc = MPI_Group_incl(group, 0, ranks, &outgroup); + if (rc) { + errs++; + MTestPrintError(rc); + printf("Error in creating an empty group with (0,ranks)\n"); + } + } - MTestFreeComm( &comm ); + if (outgroup != MPI_GROUP_EMPTY) { + /* Is the group equivalent to group empty? */ + rc = MPI_Group_compare(outgroup, MPI_GROUP_EMPTY, &result); + if (result != MPI_IDENT) { + errs++; + MTestPrintError(rc); + printf("Did not create a group equivalent to an empty group\n"); + } + } + rc = MPI_Group_free(&group); + if (rc) { + errs++; + MTestPrintError(rc); + } + if (outgroup != MPI_GROUP_NULL) { + rc = MPI_Group_free(&outgroup); + if (rc) { + errs++; + MTestPrintError(rc); + } + } + + MTestFreeComm(&comm); } - - MTest_Finalize( errs ); + + MTest_Finalize(errs); MPI_Finalize(); return 0; - + }