Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SMPI/replay: Fix issue with recv of size =0.
authorAugustin Degomme <26892-adegomme@users.noreply.framagit.org>
Fri, 22 Jul 2022 14:41:43 +0000 (14:41 +0000)
committerAugustin Degomme <26892-adegomme@users.noreply.framagit.org>
Fri, 22 Jul 2022 14:41:43 +0000 (14:41 +0000)
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
src/smpi/internals/smpi_replay.cpp

index c5c5289..3c79913 100644 (file)
@@ -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;
 
index b78e173..11c26d9 100644 (file)
@@ -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<size_t>(action[4]);
+  size      = parse_integer<ssize_t>(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;
   }