X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cc01c6a871dbbfd0cc84e26eb9f94aeb539e613e..427390df75aeb9c82a73bde4ffacb649025cd66e:/examples/smpi/ttest01.c diff --git a/examples/smpi/ttest01.c b/examples/smpi/ttest01.c index 2324eeb032..ada55b9ea0 100644 --- a/examples/smpi/ttest01.c +++ b/examples/smpi/ttest01.c @@ -20,21 +20,26 @@ int main(int argc, char *argv[]) MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); - TRACE_smpi_set_category("A"); - if (rank == 0) { - MPI_Send(r, DATATOSENT, MPI_INT, 1, tag, MPI_COMM_WORLD); - } else if (rank == 1) { - MPI_Recv(r, DATATOSENT, MPI_INT, 0, tag, MPI_COMM_WORLD, &status); - } else { - //do nothing - } - TRACE_smpi_set_category("B"); - if (rank == 0) { - MPI_Recv(r, DATATOSENT, MPI_INT, 1, tag, MPI_COMM_WORLD, &status); - } else if (rank == 1) { - MPI_Send(r, DATATOSENT, MPI_INT, 0, tag, MPI_COMM_WORLD); - } else { - //do nothing + + int i; + for (i = 0; i < 10; i++) { + TRACE_smpi_set_category("A"); + if (rank == 0) { + MPI_Send(r, DATATOSENT, MPI_INT, 1, tag, MPI_COMM_WORLD); + } else if (rank == 1) { + MPI_Recv(r, DATATOSENT, MPI_INT, 0, tag, MPI_COMM_WORLD, &status); + } else { + //do nothing + } + + TRACE_smpi_set_category("B"); + if (rank == 0) { + MPI_Recv(r, DATATOSENT, MPI_INT, 1, tag, MPI_COMM_WORLD, &status); + } else if (rank == 1) { + MPI_Send(r, DATATOSENT, MPI_INT, 0, tag, MPI_COMM_WORLD); + } else { + //do nothing + } } TRACE_smpi_set_category("C"); MPI_Barrier(MPI_COMM_WORLD);