};
}
-typedef std::tuple</*sender*/ int, /* reciever */ int, /* tag */int> req_key_t;
+typedef std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int> req_key_t;
typedef std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int,int,int>>> req_storage_t;
void log_timed_action(simgrid::xbt::ReplayAction& action, double clock)
flops = parse_double(action[2]);
}
+void SleepParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
+{
+ CHECK_ACTION_PARAMS(action, 1, 0)
+ time = parse_double(action[2]);
+}
+
+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)
if (action.size() > 5 + comm_size)
datatype2 = simgrid::smpi::Datatype::decode(action[5 + comm_size]);
} else {
- int datatype_index = 0;
int disp_index = 0;
/* The 3 comes from "0 gather <sendcount>", which must always be present.
* The + comm_size is the recvcounts array, which must also be present
*/
if (action.size() > 3 + comm_size + comm_size) { /* datatype + disp are specified */
- datatype_index = 3 + comm_size;
+ int datatype_index = 3 + comm_size;
disp_index = datatype_index + 1;
datatype1 = simgrid::smpi::Datatype::decode(action[datatype_index]);
datatype2 = simgrid::smpi::Datatype::decode(action[datatype_index]);
3 + comm_size + 2) { /* disps specified; datatype is not specified; use the default one */
disp_index = 3 + comm_size;
} else if (action.size() > 3 + comm_size) { /* only datatype, no disp specified */
- datatype_index = 3 + comm_size;
+ int datatype_index = 3 + comm_size;
datatype1 = simgrid::smpi::Datatype::decode(action[datatype_index]);
datatype2 = simgrid::smpi::Datatype::decode(action[datatype_index]);
}
void ComputeAction::kernel(simgrid::xbt::ReplayAction&)
{
- smpi_execute_flops(args.flops);
+ if (simgrid::config::get_value<bool>("smpi/simulate-computation")) {
+ smpi_execute_flops(args.flops/smpi_adjust_comp_speed());
+ }
+}
+
+void SleepAction::kernel(simgrid::xbt::ReplayAction&)
+{
+ XBT_DEBUG("Sleep for: %lf secs", args.time);
+ int rank = simgrid::s4u::this_actor::get_pid();
+ TRACE_smpi_sleeping_in(rank, args.time);
+ simgrid::s4u::this_actor::sleep_for(args.time/smpi_adjust_comp_speed());
+ TRACE_smpi_sleeping_out(rank);
+}
+
+void LocationAction::kernel(simgrid::xbt::ReplayAction&)
+{
+ smpi_trace_set_call_location(args.filename.c_str(), args.line);
}
void TestAction::kernel(simgrid::xbt::ReplayAction&)
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("sleep", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::SleepAction().execute(action); });
+ xbt_replay_action_register("location", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::LocationAction().execute(action); });
//if we have a delayed start, sleep here.
if (start_delay_flops > 0) {