- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
- int i = 0;
- int size = comm->size();
- instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
- extra->type = TRACING_ALLGATHERV;
- extra->num_processes = size;
- int known = 0;
- extra->datatype1 = encode_datatype(sendtype, &known);
- int dt_size_send = 1;
- if (known == 0)
- dt_size_send = sendtype->size();
- extra->send_size = sendcount * dt_size_send;
- extra->datatype2 = encode_datatype(recvtype, &known);
- int dt_size_recv = 1;
- if (known == 0)
- dt_size_recv = recvtype->size();
- extra->recvcounts = xbt_new(int, size);
- for (i = 0; i < size; i++) // copy data to avoid bad free
- extra->recvcounts[i] = recvcounts[i] * dt_size_recv;
-
- TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra);
+ int rank = simgrid::s4u::this_actor::get_pid();
+ int dt_size_recv = recvtype->is_replayable() ? 1 : recvtype->size();
+
+ std::vector<int>* trace_recvcounts = new std::vector<int>;
+ for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free
+ trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
+
+ TRACE_smpi_comm_in(rank, __func__,
+ new simgrid::instr::VarCollTIData(
+ "allgatherv", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
+ nullptr, dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
+ simgrid::smpi::Datatype::encode(recvtype)));