From 626e584514e3958a938f7163fb1517917d795c2b Mon Sep 17 00:00:00 2001 From: Augustin Degomme <26892-adegomme@users.noreply.framagit.org> Date: Fri, 22 Jul 2022 14:41:43 +0000 Subject: [PATCH] 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. --- src/smpi/include/smpi_replay.hpp | 2 +- src/smpi/internals/smpi_replay.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.20.1