X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ecd5f7562caf1d443bf22788fa5f4fac408776ec..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/teshsuite/smpi/macro-shared/macro-shared.c diff --git a/teshsuite/smpi/macro-shared/macro-shared.c b/teshsuite/smpi/macro-shared/macro-shared.c index 51da71b1d6..3d66e9031d 100644 --- a/teshsuite/smpi/macro-shared/macro-shared.c +++ b/teshsuite/smpi/macro-shared/macro-shared.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2017. The SimGrid Team. +/* Copyright (c) 2009-2021. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -54,6 +54,17 @@ int main(int argc, char *argv[]) printf("[%d] After change, the value in the shared buffer is: %" PRIu64"\n", rank, *buf); + //try to send/receive shared data, to check if we skip the copies correctly. + if(rank==0) + MPI_Send(buf, 1, MPI_AINT, 1, 100, MPI_COMM_WORLD); + else if (rank ==1) + MPI_Recv(buf, 1, MPI_AINT, 0, 100, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + + //same thing with an MPI_IN_PLACE collective (no) + if (rank == 0) + MPI_Scatter(buf, 1, MPI_AINT, MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, 0, MPI_COMM_WORLD); + else + MPI_Scatter(NULL, -1, MPI_DATATYPE_NULL, buf, 1, MPI_AINT, 0, MPI_COMM_WORLD); SMPI_SHARED_FREE(buf); MPI_Finalize();