From: Augustin Degomme <26892-adegomme@users.noreply.framagit.org> Date: Fri, 22 Jul 2022 14:41:43 +0000 (+0000) Subject: SMPI/replay: Fix issue with recv of size =0. X-Git-Tag: v3.32~136^2 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/626e584514e3958a938f7163fb1517917d795c2b SMPI/replay: Fix issue with recv of size =0. Negative values can be used to trigger a probe in case of unknown receive size, but 0 is a legit value. --- diff --git a/src/smpi/include/smpi_replay.hpp b/src/smpi/include/smpi_replay.hpp index c5c52891fc..3c799138a7 100644 --- a/src/smpi/include/smpi_replay.hpp +++ b/src/smpi/include/smpi_replay.hpp @@ -62,7 +62,7 @@ class SendOrRecvParser : public ActionArgParser { public: /* communication partner; if we send, this is the receiver and vice versa */ int partner; - size_t size; + ssize_t size; int tag; MPI_Datatype datatype1; diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index b78e173eb1..11c26d97eb 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -167,7 +167,7 @@ void SendOrRecvParser::parse(simgrid::xbt::ReplayAction& action, const std::stri CHECK_ACTION_PARAMS(action, 3, 1) partner = std::stoi(action[2]); tag = std::stoi(action[3]); - size = parse_integer(action[4]); + size = parse_integer(action[4]); datatype1 = parse_datatype(action, 5); } @@ -486,8 +486,8 @@ void RecvAction::kernel(simgrid::xbt::ReplayAction&) MPI_Status status; // unknown size from the receiver point of view - size_t arg_size = args.size; - if (arg_size == 0) { + ssize_t arg_size = args.size; + if (arg_size < 0) { Request::probe(args.partner, args.tag, MPI_COMM_WORLD, &status); arg_size = status.count; }