From: Augustin Degomme Date: Tue, 4 Feb 2014 16:01:06 +0000 (+0100) Subject: allow replay to handle -1 as a value for the size of a receive. X-Git-Tag: v3_11_beta~88 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f93641864e79a9efd548f4dd3b1afeedecdec8e9?hp=fce3a86dd4d407dad48652984bf5bf0444f37170 allow replay to handle -1 as a value for the size of a receive. The real size will be determined by probing the first incoming message from the sender. This is used to keep compatibility with tools that don't store the size on receiver's size --- diff --git a/src/smpi/smpi_replay.c b/src/smpi/smpi_replay.c index 816ad8c516..71db9bfb31 100644 --- a/src/smpi/smpi_replay.c +++ b/src/smpi/smpi_replay.c @@ -259,6 +259,12 @@ static void action_recv(const char *const *action) { TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra); #endif + //unknow size from the receiver pov + if(size==-1){ + smpi_mpi_probe(from, 0, MPI_COMM_WORLD, &status); + size=status.count; + } + smpi_mpi_recv(NULL, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD, &status); #ifdef HAVE_TRACING @@ -290,6 +296,12 @@ static void action_Irecv(const char *const *action) extra->datatype1 = encode_datatype(MPI_CURRENT_TYPE); TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, extra); #endif + MPI_Status status; + //unknow size from the receiver pov + if(size==-1){ + smpi_mpi_probe(from, 0, MPI_COMM_WORLD, &status); + size=status.count; + } request = smpi_mpi_irecv(NULL, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD);