X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1b4e20873a7bd405842f3d8d1e6dd1d518db5535..2bb3a0d042a8a1deb91c18dba0cbdf42237413d4:/teshsuite/smpi/mpich3-test/comm/ic1.c diff --git a/teshsuite/smpi/mpich3-test/comm/ic1.c b/teshsuite/smpi/mpich3-test/comm/ic1.c index 9bb4a43b2b..952016b501 100644 --- a/teshsuite/smpi/mpich3-test/comm/ic1.c +++ b/teshsuite/smpi/mpich3-test/comm/ic1.c @@ -11,52 +11,49 @@ #include #include "mpitest.h" -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { MPI_Comm intercomm; - int remote_rank, rank, size, errs = 0; + int remote_rank, rank, size, errs = 0; + volatile int trigger; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); + trigger = 1; +/* while (trigger) ; */ - - MPI_Comm_size( MPI_COMM_WORLD, &size ); + MPI_Comm_size(MPI_COMM_WORLD, &size); if (size < 2) { - printf( "Size must be at least 2\n" ); - MPI_Abort( MPI_COMM_WORLD, 0 ); - exit(0); + printf("Size must be at least 2\n"); + MPI_Abort(MPI_COMM_WORLD, 0); } - MPI_Comm_rank( MPI_COMM_WORLD, &rank ); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Make an intercomm of the first two elements of comm_world */ if (rank < 2) { - int lrank = rank, rrank = -1; - MPI_Status status; + int lrank = rank, rrank = -1; + MPI_Status status; - remote_rank = 1 - rank; - MPI_Intercomm_create( MPI_COMM_SELF, 0, - MPI_COMM_WORLD, remote_rank, 27, - &intercomm ); + remote_rank = 1 - rank; + MPI_Intercomm_create(MPI_COMM_SELF, 0, MPI_COMM_WORLD, remote_rank, 27, &intercomm); - /* Now, communicate between them */ - MPI_Sendrecv( &lrank, 1, MPI_INT, 0, 13, - &rrank, 1, MPI_INT, 0, 13, intercomm, &status ); + /* Now, communicate between them */ + MPI_Sendrecv(&lrank, 1, MPI_INT, 0, 13, &rrank, 1, MPI_INT, 0, 13, intercomm, &status); - if (rrank != remote_rank) { - errs++; - printf( "%d Expected %d but received %d\n", - rank, remote_rank, rrank ); - } + if (rrank != remote_rank) { + errs++; + printf("%d Expected %d but received %d\n", rank, remote_rank, rrank); + } - MPI_Comm_free( &intercomm ); + MPI_Comm_free(&intercomm); } - + /* The next test should create an intercomm with groups of different - sizes FIXME */ + * sizes FIXME */ - MTest_Finalize( errs ); + MTest_Finalize(errs); MPI_Finalize(); - + return 0; }