Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to have reduce_scatter output identically on re-tracing
authorAugustin Degomme <adegomme@users.noreply.github.com>
Sat, 7 Aug 2021 21:56:19 +0000 (23:56 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Sat, 7 Aug 2021 21:56:19 +0000 (23:56 +0200)
ugly.

src/smpi/bindings/smpi_pmpi_coll.cpp
src/smpi/internals/smpi_replay.cpp

index 0515a37..8305497 100644 (file)
@@ -645,7 +645,7 @@ int PMPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcoun
   TRACE_smpi_comm_in(pid, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter" : "PMPI_Ireduce_scatter",
                      new simgrid::instr::VarCollTIData(
                          request == MPI_REQUEST_IGNORED ? "reducescatter" : "ireducescatter", -1, -1, nullptr,
-                         0, trace_recvcounts, simgrid::smpi::Datatype::encode(datatype), ""));
+                         -1 , trace_recvcounts, std::to_string(0), simgrid::smpi::Datatype::encode(datatype)));
 
   if (request == MPI_REQUEST_IGNORED)
     simgrid::smpi::colls::reduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm);
index c94b93c..e3d19a0 100644 (file)
@@ -23,7 +23,6 @@
 #include <vector>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_replay, smpi, "Trace Replay with SMPI");
-
 // From https://stackoverflow.com/questions/7110301/generic-hash-for-tuples-in-unordered-map-unordered-set
 // This is all just to make std::unordered_map work with std::tuple. If we need this in other places,
 // this could go into a header file.
@@ -744,7 +743,9 @@ void ReduceScatterAction::kernel(simgrid::xbt::ReplayAction&)
   TRACE_smpi_comm_in(
       get_pid(), "action_reducescatter",
       new simgrid::instr::VarCollTIData(get_name(), -1, -1, nullptr, -1, args.recvcounts,
-                                        std::to_string(args.comp_size),
+                                        /* ugly as we use datatype field to pass computation as string */
+                                        /* and because of the trick to avoid getting 0.000000 when 0 is given */
+                                        args.comp_size == 0 ? "0" : std::to_string(args.comp_size),
                                         Datatype::encode(args.datatype1)));
 
   colls::reduce_scatter(send_buffer(args.recv_size_sum * args.datatype1->size()),