/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
{
CHECK_ACTION_PARAMS(action, 3, 0)
src = std::stoi(action[2]);
{
CHECK_ACTION_PARAMS(action, 3, 0)
src = std::stoi(action[2]);
{
CHECK_ACTION_PARAMS(action, 3, 1)
partner = std::stoi(action[2]);
{
CHECK_ACTION_PARAMS(action, 3, 1)
partner = std::stoi(action[2]);
{
CHECK_ACTION_PARAMS(action, 1, 0)
flops = parse_double(action[2]);
}
{
CHECK_ACTION_PARAMS(action, 1, 0)
flops = parse_double(action[2]);
}
-void BcastArgParser::parse(simgrid::xbt::ReplayAction& action, std::string name)
+void LocationParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
+{
+ CHECK_ACTION_PARAMS(action, 2, 0)
+ filename = std::string(action[2]);
+ line = std::stoi(action[3]);
+}
+
+void BcastArgParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
{
CHECK_ACTION_PARAMS(action, 1, 2)
size = parse_double(action[2]);
{
CHECK_ACTION_PARAMS(action, 1, 2)
size = parse_double(action[2]);
{
CHECK_ACTION_PARAMS(action, 2, 2)
comm_size = parse_double(action[2]);
{
CHECK_ACTION_PARAMS(action, 2, 2)
comm_size = parse_double(action[2]);
{
CHECK_ACTION_PARAMS(action, 2, 1)
comm_size = parse_double(action[2]);
{
CHECK_ACTION_PARAMS(action, 2, 1)
comm_size = parse_double(action[2]);
{
CHECK_ACTION_PARAMS(action, 2, 1)
comm_size = MPI_COMM_WORLD->size();
{
CHECK_ACTION_PARAMS(action, 2, 1)
comm_size = MPI_COMM_WORLD->size();
{
/* The structure of the gatherv action for the rank 0 (total 4 processes) is the following:
0 gather 68 68 10 10 10 0 0 0
{
/* The structure of the gatherv action for the rank 0 (total 4 processes) is the following:
0 gather 68 68 10 10 10 0 0 0
{
/* The structure of the scatterv action for the rank 0 (total 4 processes) is the following:
0 gather 68 10 10 10 68 0 0 0
{
/* The structure of the scatterv action for the rank 0 (total 4 processes) is the following:
0 gather 68 10 10 10 68 0 0 0
{
/* The structure of the reducescatter action for the rank 0 (total 4 processes) is the following:
0 reducescatter 275427 275427 275427 204020 11346849 0
{
/* The structure of the reducescatter action for the rank 0 (total 4 processes) is the following:
0 reducescatter 275427 275427 275427 204020 11346849 0
{
/* The structure of the alltoallv action for the rank 0 (total 4 processes) is the following:
0 alltoallv 100 1 7 10 12 100 1 70 10 5
{
/* The structure of the alltoallv action for the rank 0 (total 4 processes) is the following:
0 alltoallv 100 1 7 10 12 100 1 70 10 5
{
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::Pt2PtTIData(name, args.partner, args.size,
args.tag, Datatype::encode(args.datatype1)));
{
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::Pt2PtTIData(name, args.partner, args.size,
args.tag, Datatype::encode(args.datatype1)));
Request::recv(nullptr, args.size, args.datatype1, args.partner, args.tag, MPI_COMM_WORLD, &status);
} else if (name == "irecv") {
MPI_Request request = Request::irecv(nullptr, args.size, args.datatype1, args.partner, args.tag, MPI_COMM_WORLD);
req_storage.add(request);
Request::recv(nullptr, args.size, args.datatype1, args.partner, args.tag, MPI_COMM_WORLD, &status);
} else if (name == "irecv") {
MPI_Request request = Request::irecv(nullptr, args.size, args.datatype1, args.partner, args.tag, MPI_COMM_WORLD);
req_storage.add(request);
int src_traced = MPI_COMM_WORLD->group()->actor(status.MPI_SOURCE)->get_pid();
TRACE_smpi_recv(src_traced, my_proc_id, args.tag);
}
}
int src_traced = MPI_COMM_WORLD->group()->actor(status.MPI_SOURCE)->get_pid();
TRACE_smpi_recv(src_traced, my_proc_id, args.tag);
}
}
-void ComputeAction::kernel(simgrid::xbt::ReplayAction& action)
+void ComputeAction::kernel(simgrid::xbt::ReplayAction&)
+{
+ smpi_execute_flops(args.flops/smpi_adjust_comp_speed());
+}
+
+void LocationAction::kernel(simgrid::xbt::ReplayAction&)
- TRACE_smpi_computing_in(my_proc_id, args.flops);
- smpi_execute_flops(args.flops);
- TRACE_smpi_computing_out(my_proc_id);
+ smpi_trace_set_call_location(args.filename.c_str(), args.line);
{
MPI_Request request = req_storage.find(args.src, args.dst, args.tag);
req_storage.remove(request);
{
MPI_Request request = req_storage.find(args.src, args.dst, args.tag);
req_storage.remove(request);
XBT_DEBUG("MPI_Test result: %d", flag);
/* push back request in vector to be caught by a subsequent wait. if the test did succeed, the request is now
XBT_DEBUG("MPI_Test result: %d", flag);
/* push back request in vector to be caught by a subsequent wait. if the test did succeed, the request is now
{
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("barrier"));
Colls::barrier(MPI_COMM_WORLD);
TRACE_smpi_comm_out(my_proc_id);
}
{
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("barrier"));
Colls::barrier(MPI_COMM_WORLD);
TRACE_smpi_comm_out(my_proc_id);
}
{
TRACE_smpi_comm_in(my_proc_id, "action_bcast",
new simgrid::instr::CollTIData("bcast", MPI_COMM_WORLD->group()->actor(args.root)->get_pid(),
{
TRACE_smpi_comm_in(my_proc_id, "action_bcast",
new simgrid::instr::CollTIData("bcast", MPI_COMM_WORLD->group()->actor(args.root)->get_pid(),
{
TRACE_smpi_comm_in(my_proc_id, "action_reduce",
new simgrid::instr::CollTIData("reduce", MPI_COMM_WORLD->group()->actor(args.root)->get_pid(),
{
TRACE_smpi_comm_in(my_proc_id, "action_reduce",
new simgrid::instr::CollTIData("reduce", MPI_COMM_WORLD->group()->actor(args.root)->get_pid(),
Colls::reduce(send_buffer(args.comm_size * args.datatype1->size()),
recv_buffer(args.comm_size * args.datatype1->size()), args.comm_size, args.datatype1, MPI_OP_NULL, args.root, MPI_COMM_WORLD);
Colls::reduce(send_buffer(args.comm_size * args.datatype1->size()),
recv_buffer(args.comm_size * args.datatype1->size()), args.comm_size, args.datatype1, MPI_OP_NULL, args.root, MPI_COMM_WORLD);
{
TRACE_smpi_comm_in(my_proc_id, "action_allreduce", new simgrid::instr::CollTIData("allreduce", -1, args.comp_size, args.comm_size, -1,
Datatype::encode(args.datatype1), ""));
Colls::allreduce(send_buffer(args.comm_size * args.datatype1->size()),
recv_buffer(args.comm_size * args.datatype1->size()), args.comm_size, args.datatype1, MPI_OP_NULL, MPI_COMM_WORLD);
{
TRACE_smpi_comm_in(my_proc_id, "action_allreduce", new simgrid::instr::CollTIData("allreduce", -1, args.comp_size, args.comm_size, -1,
Datatype::encode(args.datatype1), ""));
Colls::allreduce(send_buffer(args.comm_size * args.datatype1->size()),
recv_buffer(args.comm_size * args.datatype1->size()), args.comm_size, args.datatype1, MPI_OP_NULL, MPI_COMM_WORLD);
{
TRACE_smpi_comm_in(my_proc_id, "action_alltoall",
new simgrid::instr::CollTIData("alltoall", -1, -1.0, args.send_size, args.recv_size,
{
TRACE_smpi_comm_in(my_proc_id, "action_alltoall",
new simgrid::instr::CollTIData("alltoall", -1, -1.0, args.send_size, args.recv_size,
{
TRACE_smpi_comm_in(my_proc_id, name.c_str(), new simgrid::instr::CollTIData(name, (name == "gather") ? args.root : -1, -1.0, args.send_size, args.recv_size,
Datatype::encode(args.datatype1), Datatype::encode(args.datatype2)));
{
TRACE_smpi_comm_in(my_proc_id, name.c_str(), new simgrid::instr::CollTIData(name, (name == "gather") ? args.root : -1, -1.0, args.send_size, args.recv_size,
Datatype::encode(args.datatype1), Datatype::encode(args.datatype2)));
{
int rank = MPI_COMM_WORLD->rank();
TRACE_smpi_comm_in(my_proc_id, "action_scatter", new simgrid::instr::CollTIData(name, args.root, -1.0, args.send_size, args.recv_size,
{
int rank = MPI_COMM_WORLD->rank();
TRACE_smpi_comm_in(my_proc_id, "action_scatter", new simgrid::instr::CollTIData(name, args.root, -1.0, args.send_size, args.recv_size,
{
int rank = MPI_COMM_WORLD->rank();
TRACE_smpi_comm_in(my_proc_id, "action_scatterv", new simgrid::instr::VarCollTIData(name, args.root, -1, args.sendcounts, args.recv_size,
{
int rank = MPI_COMM_WORLD->rank();
TRACE_smpi_comm_in(my_proc_id, "action_scatterv", new simgrid::instr::VarCollTIData(name, args.root, -1, args.sendcounts, args.recv_size,
{
TRACE_smpi_comm_in(my_proc_id, "action_reducescatter",
new simgrid::instr::VarCollTIData("reducescatter", -1, 0, nullptr, -1, args.recvcounts,
{
TRACE_smpi_comm_in(my_proc_id, "action_reducescatter",
new simgrid::instr::VarCollTIData("reducescatter", -1, 0, nullptr, -1, args.recvcounts,
recv_buffer(args.recv_size_sum * args.datatype1->size()), args.recvcounts->data(),
args.datatype1, MPI_OP_NULL, MPI_COMM_WORLD);
recv_buffer(args.recv_size_sum * args.datatype1->size()), args.recvcounts->data(),
args.datatype1, MPI_OP_NULL, MPI_COMM_WORLD);
{
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::VarCollTIData(
{
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::VarCollTIData(
static std::unordered_map<aid_t, simgrid::smpi::replay::RequestStorage> storage;
/** @brief Only initialize the replay, don't do it for real */
static std::unordered_map<aid_t, simgrid::smpi::replay::RequestStorage> storage;
/** @brief Only initialize the replay, don't do it for real */
- if (not smpi_process()->initializing()){
- simgrid::smpi::ActorExt::init(argc, argv);
- }
+ xbt_assert(not smpi_process()->initializing());
+
+ simgrid::s4u::Actor::self()->set_property("instance_id", instance_id);
+ simgrid::s4u::Actor::self()->set_property("rank", std::to_string(rank));
+ simgrid::smpi::ActorExt::init();
+
TRACE_smpi_comm_in(my_proc_id, "smpi_replay_run_init", new simgrid::instr::NoOpTIData("init"));
TRACE_smpi_comm_out(my_proc_id);
xbt_replay_action_register("init", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::InitAction().execute(action); });
TRACE_smpi_comm_in(my_proc_id, "smpi_replay_run_init", new simgrid::instr::NoOpTIData("init"));
TRACE_smpi_comm_out(my_proc_id);
xbt_replay_action_register("init", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::InitAction().execute(action); });
xbt_replay_action_register("comm_size", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::CommunicatorAction().execute(action); });
xbt_replay_action_register("comm_split",[](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::CommunicatorAction().execute(action); });
xbt_replay_action_register("comm_dup", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::CommunicatorAction().execute(action); });
xbt_replay_action_register("comm_size", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::CommunicatorAction().execute(action); });
xbt_replay_action_register("comm_split",[](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::CommunicatorAction().execute(action); });
xbt_replay_action_register("comm_dup", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::CommunicatorAction().execute(action); });
xbt_replay_action_register("allgatherv", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::GatherVAction("allgatherv").execute(action); });
xbt_replay_action_register("reducescatter", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::ReduceScatterAction().execute(action); });
xbt_replay_action_register("compute", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::ComputeAction().execute(action); });
xbt_replay_action_register("allgatherv", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::GatherVAction("allgatherv").execute(action); });
xbt_replay_action_register("reducescatter", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::ReduceScatterAction().execute(action); });
xbt_replay_action_register("compute", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::ComputeAction().execute(action); });
- if(*argc>2){
- double value = xbt_str_parse_double((*argv)[2], "%s is not a double");
- XBT_VERB("Delayed start for instance - Sleeping for %f flops ",value );
- smpi_execute_flops(value);
+ if (start_delay_flops > 0) {
+ XBT_VERB("Delayed start for instance - Sleeping for %f flops ", start_delay_flops);
+ private_execute_flops(start_delay_flops);
{
static int active_processes = 0;
active_processes++;
storage[simgrid::s4u::this_actor::get_pid()] = simgrid::smpi::replay::RequestStorage();
{
static int active_processes = 0;
active_processes++;
storage[simgrid::s4u::this_actor::get_pid()] = simgrid::smpi::replay::RequestStorage();
/* and now, finalize everything */
/* One active process will stop. Decrease the counter*/
/* and now, finalize everything */
/* One active process will stop. Decrease the counter*/
- smpi_replay_init(argc, argv);
- smpi_replay_main(argc, argv);
+ smpi_replay_init(instance_id, rank, start_delay_flops);
+ smpi_replay_main(rank, trace_filename);