-static void action_allgather(simgrid::xbt::ReplayAction& action)
-{
- /* The structure of the allgather action for the rank 0 (total 4 processes) is the following:
- 0 allGather 275427 275427
- where:
- 1) 275427 is the sendcount
- 2) 275427 is the recvcount
- 3) No more values mean that the datatype for sent and receive buffer is the default one, see
- simgrid::smpi::Datatype::decode().
- */
- double clock = smpi_process()->simulated_elapsed();
-
- CHECK_ACTION_PARAMS(action, 2, 2)
- int sendcount = std::stoi(action[2]);
- int recvcount = std::stoi(action[3]);
-
- MPI_Datatype MPI_CURRENT_TYPE{(action.size() > 5) ? simgrid::smpi::Datatype::decode(action[4]) : MPI_DEFAULT_TYPE};
- MPI_Datatype MPI_CURRENT_TYPE2{(action.size() > 5) ? simgrid::smpi::Datatype::decode(action[5]) : MPI_DEFAULT_TYPE};
-
- void *sendbuf = smpi_get_tmp_sendbuffer(sendcount* MPI_CURRENT_TYPE->size());
- void *recvbuf = smpi_get_tmp_recvbuffer(recvcount* MPI_CURRENT_TYPE2->size());
-
- int my_proc_id = Actor::self()->getPid();
-
- TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
- new simgrid::instr::CollTIData("allGather", -1, -1.0, sendcount, recvcount,
- Datatype::encode(MPI_CURRENT_TYPE),
- Datatype::encode(MPI_CURRENT_TYPE2)));
-
- Colls::allgather(sendbuf, sendcount, MPI_CURRENT_TYPE, recvbuf, recvcount, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
-
- TRACE_smpi_comm_out(my_proc_id);
- log_timed_action (action, clock);
-}
-