X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6760cb07d6b57be16928d95339d71e57c4e24f36..2472771bffee0a2c29b69a2e2b6206f0bb819af1:/examples/smpi/split.c diff --git a/examples/smpi/split.c b/examples/smpi/split.c index 984ee7ee00..a3bb58fd63 100644 --- a/examples/smpi/split.c +++ b/examples/smpi/split.c @@ -10,14 +10,14 @@ int main(int argc, char *argv[]) { int worldrank; -// int localrank; -// MPI_Comm localcomm; + int localrank; + MPI_Comm localcomm; + MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &worldrank); - printf("MPI_Comm_split is not implemented\n"); - //MPI_Comm_split(MPI_COMM_WORLD, worldrank % 2, worldrank, &localcomm); - //MPI_Comm_rank(localcomm, &localrank); - //printf("node with world rank %d has local rank %d\n", worldrank, localrank); + MPI_Comm_split(MPI_COMM_WORLD, worldrank % 2, worldrank, &localcomm); + MPI_Comm_rank(localcomm, &localrank); + printf("node with world rank %d has local rank %d\n", worldrank, localrank); MPI_Finalize(); return 0; }