X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cdcfa50107cc897b89de650afa5c7447c21d87d3..41f201dce67effdcae5bf02d142e5cbe113b1d3a:/examples/smpi/dsend.c diff --git a/examples/smpi/dsend.c b/examples/smpi/dsend.c index 511cf32a04..f7bc825cb3 100644 --- a/examples/smpi/dsend.c +++ b/examples/smpi/dsend.c @@ -12,19 +12,21 @@ int main(int argc, char *argv[]) { int rank; int data=11; + MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (rank==1) { data=22; MPI_Send(&data,1,MPI_INT,(rank+1)%2,666,MPI_COMM_WORLD); +// smpi_sleep(1000); } else { MPI_Recv(&data,1,MPI_INT,-1,666,MPI_COMM_WORLD,NULL); if (data !=22) { printf("rank %d: Damn, data does not match (got %d)\n",rank, data); } } - + printf("rank %d: data exchanged\n", rank); MPI_Finalize(); return 0;