X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c81c99a491282f76757c2673961e3cdee6853539..684cdb5583dacd359d0a1e6a47db259dbc82713b:/teshsuite/smpi/mpich3-test/comm/commname.c diff --git a/teshsuite/smpi/mpich3-test/comm/commname.c b/teshsuite/smpi/mpich3-test/comm/commname.c index 6a7a736d71..d8ae639253 100644 --- a/teshsuite/smpi/mpich3-test/comm/commname.c +++ b/teshsuite/smpi/mpich3-test/comm/commname.c @@ -14,51 +14,49 @@ #include #endif -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0; MPI_Comm comm; int cnt, rlen; char name[MPI_MAX_OBJECT_NAME], nameout[MPI_MAX_OBJECT_NAME]; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); - /* Check world and self firt */ + /* Check world and self first */ nameout[0] = 0; - MPI_Comm_get_name( MPI_COMM_WORLD, nameout, &rlen ); - if (strcmp(nameout,"MPI_COMM_WORLD")) { - errs++; - printf( "Name of comm world is %s, should be MPI_COMM_WORLD\n", - nameout ); + MPI_Comm_get_name(MPI_COMM_WORLD, nameout, &rlen); + if (strcmp(nameout, "MPI_COMM_WORLD")) { + errs++; + printf("Name of comm world is %s, should be MPI_COMM_WORLD\n", nameout); } nameout[0] = 0; - MPI_Comm_get_name( MPI_COMM_SELF, nameout, &rlen ); - if (strcmp(nameout,"MPI_COMM_SELF")) { - errs++; - printf( "Name of comm self is %s, should be MPI_COMM_SELF\n", - nameout ); + MPI_Comm_get_name(MPI_COMM_SELF, nameout, &rlen); + if (strcmp(nameout, "MPI_COMM_SELF")) { + errs++; + printf("Name of comm self is %s, should be MPI_COMM_SELF\n", nameout); } /* Now, handle other communicators, including world/self */ cnt = 0; - while (MTestGetComm( &comm, 1 )) { - if (comm == MPI_COMM_NULL) continue; - - sprintf( name, "comm-%d", cnt ); - cnt++; - MPI_Comm_set_name( comm, name ); - nameout[0] = 0; - MPI_Comm_get_name( comm, nameout, &rlen ); - if (strcmp( name, nameout )) { - errs++; - printf( "Unexpected name, was %s but should be %s\n", - nameout, name ); - } - - MTestFreeComm( &comm ); + while (MTestGetComm(&comm, 1)) { + if (comm == MPI_COMM_NULL) + continue; + + sprintf(name, "comm-%d", cnt); + cnt++; + MPI_Comm_set_name(comm, name); + nameout[0] = 0; + MPI_Comm_get_name(comm, nameout, &rlen); + if (strcmp(name, nameout)) { + errs++; + printf("Unexpected name, was %s but should be %s\n", nameout, name); + } + + MTestFreeComm(&comm); } - MTest_Finalize( errs ); + MTest_Finalize(errs); MPI_Finalize(); return 0; }