X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d65d1121602ae06e7c9854a07099aaaa60f40bbd..704a4e40059072862812816366aa40b5dec2873a:/examples/smpi/split.c diff --git a/examples/smpi/split.c b/examples/smpi/split.c index bf4d3df682..a3bb58fd63 100644 --- a/examples/smpi/split.c +++ b/examples/smpi/split.c @@ -1,17 +1,23 @@ +/* Copyright (c) 2009, 2010. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #include #include 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; }