// VarCollTI: gatherv, scatterv, allgatherv, alltoallv (+ reducescatter out of laziness)
class VarCollTIData : public TIData {
int root_;
- size_t send_size_;
+ long int send_size_;
std::shared_ptr<std::vector<int>> sendcounts_;
- size_t recv_size_;
+ long int recv_size_;
std::shared_ptr<std::vector<int>> recvcounts_;
std::string send_type_;
std::string recv_type_;
public:
- VarCollTIData(const std::string& name, int root, size_t send_size, std::shared_ptr<std::vector<int>> sendcounts,
- size_t recv_size, std::shared_ptr<std::vector<int>> recvcounts, const std::string& send_type,
+ VarCollTIData(const std::string& name, int root, long int send_size, std::shared_ptr<std::vector<int>> sendcounts,
+ long int recv_size, std::shared_ptr<std::vector<int>> recvcounts, const std::string& send_type,
const std::string& recv_type)
: TIData(name)
, root_(root)
{
std::stringstream stream;
stream << get_name() << " ";
- if (send_size_ > 0)
+ if (send_size_ > -1)
stream << send_size_ << " ";
if (sendcounts_ != nullptr)
for (auto count : *sendcounts_)
stream << count << " ";
- if (recv_size_ > 0)
+ if (recv_size_ > -1)
stream << recv_size_ << " ";
if (recvcounts_ != nullptr)
for (auto count : *recvcounts_)
auto trace_recvcounts = std::make_shared<std::vector<int>>();
if (rank == root)
trace_recvcounts->insert(trace_recvcounts->end(), &recvcounts[0], &recvcounts[comm->size()]);
+ else //this is not significant outside of root, put 0 as we don't know if recvcounts is initialized
+ trace_recvcounts->insert(trace_recvcounts->end(), comm->size(), 0);
TRACE_smpi_comm_in(pid, request == MPI_REQUEST_IGNORED ? "PMPI_Gatherv" : "PMPI_Igatherv",
new simgrid::instr::VarCollTIData(
request == MPI_REQUEST_IGNORED ? "gatherv" : "igatherv", root,
- real_sendcount,
- nullptr, recvtype->size(), trace_recvcounts, simgrid::smpi::Datatype::encode(real_sendtype),
+ sendcount,
+ nullptr, -1, trace_recvcounts, simgrid::smpi::Datatype::encode(real_sendtype),
simgrid::smpi::Datatype::encode(recvtype)));
if (request == MPI_REQUEST_IGNORED)
simgrid::smpi::colls::gatherv(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcounts, displs, recvtype,
pid, request == MPI_REQUEST_IGNORED ? "PMPI_Allgatherv" : "PMPI_Iallgatherv",
new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "allgatherv" : "iallgatherv", -1,
sendcount, nullptr,
- recvtype->size(), trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
+ -1, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
simgrid::smpi::Datatype::encode(recvtype)));
if (request == MPI_REQUEST_IGNORED)
simgrid::smpi::colls::allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
auto trace_sendcounts = std::make_shared<std::vector<int>>();
if (rank == root)
trace_sendcounts->insert(trace_sendcounts->end(), &sendcounts[0], &sendcounts[comm->size()]);
+ else //this is not significant outside of root, put 0 as we don't know if sendcounts is initialized
+ trace_sendcounts->insert(trace_sendcounts->end(), comm->size(), 0);
+
TRACE_smpi_comm_in(pid, request == MPI_REQUEST_IGNORED ? "PMPI_Scatterv" : "PMPI_Iscatterv",
new simgrid::instr::VarCollTIData(
- request == MPI_REQUEST_IGNORED ? "scatterv" : "iscatterv", root, sendtype->size(),
+ request == MPI_REQUEST_IGNORED ? "scatterv" : "iscatterv", root, -1,
trace_sendcounts, recvcount,
nullptr, simgrid::smpi::Datatype::encode(sendtype),
simgrid::smpi::Datatype::encode(recvtype)));
const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, count, datatype);
TRACE_smpi_comm_in(pid, request == MPI_REQUEST_IGNORED ? "PMPI_Scan" : "PMPI_Iscan",
- new simgrid::instr::Pt2PtTIData(request == MPI_REQUEST_IGNORED ? "scan" : "iscan", -1,
- count, simgrid::smpi::Datatype::encode(datatype)));
+ new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "scan" : "iscan", -1, -1.0,
+ count, 0, simgrid::smpi::Datatype::encode(datatype), ""));
int retval;
if (request == MPI_REQUEST_IGNORED)
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, datatype->size(), nullptr,
+ request == MPI_REQUEST_IGNORED ? "reducescatter" : "ireducescatter", -1, -1, nullptr,
0, trace_recvcounts, simgrid::smpi::Datatype::encode(datatype), ""));
if (request == MPI_REQUEST_IGNORED)
TRACE_smpi_comm_in(
pid, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter_block" : "PMPI_Ireduce_scatter_block",
- new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "reducescatter" : "ireducescatter", -1, 0,
- nullptr, 0, trace_recvcounts, simgrid::smpi::Datatype::encode(datatype), ""));
+ new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "reducescatter" : "ireducescatter", -1, -1,
+ nullptr, -1, trace_recvcounts, simgrid::smpi::Datatype::encode(datatype), ""));
std::vector<int> recvcounts(count);
for (int i = 0; i < count; i++)
datatype1 = parse_datatype(action, 3 + comm_size);
for (unsigned int i = 0; i < comm_size; i++) {
- recvcounts->push_back(std::stoi(action[i + 2]));
+ (*recvcounts)[i]= std::stoi(action[i + 2]);
}
recv_size_sum = std::accumulate(recvcounts->begin(), recvcounts->end(), 0);
}
+void ScanArgParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
+{
+ CHECK_ACTION_PARAMS(action, 1, 1)
+ size = parse_integer<size_t>(action[2]);
+ datatype1 = parse_datatype(action, 3);
+}
+
void AllToAllVArgParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
{
/* The structure of the alltoallv action for the rank 0 (total 4 processes) is the following:
const GatherVArgParser& args = get_args();
TRACE_smpi_comm_in(get_pid(), get_name().c_str(),
new simgrid::instr::VarCollTIData(
- get_name(), (get_name() == "gatherv") ? args.root : -1, args.send_size, nullptr, 0,
+ get_name(), (get_name() == "gatherv") ? args.root : -1, args.send_size, nullptr, -1,
args.recvcounts, Datatype::encode(args.datatype1), Datatype::encode(args.datatype2)));
if (get_name() == "gatherv") {
int rank = MPI_COMM_WORLD->rank();
const ScatterVArgParser& args = get_args();
TRACE_smpi_comm_in(get_pid(), "action_scatterv",
- new simgrid::instr::VarCollTIData(get_name(), args.root, 0, args.sendcounts, args.recv_size,
+ new simgrid::instr::VarCollTIData(get_name(), args.root, -1, args.sendcounts, args.recv_size,
nullptr, Datatype::encode(args.datatype1),
Datatype::encode(args.datatype2)));
const ReduceScatterArgParser& args = get_args();
TRACE_smpi_comm_in(
get_pid(), "action_reducescatter",
- new simgrid::instr::VarCollTIData("reducescatter", -1, 0, nullptr, 0, args.recvcounts,
+ new simgrid::instr::VarCollTIData(get_name(), -1, -1, nullptr, -1, args.recvcounts,
std::to_string(args.comp_size), /* ugly hack to print comp_size */
Datatype::encode(args.datatype1)));