int main(int argc, char *argv[])
{
simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
- /* Explicit initialization of the action module is required now*/
- simgrid::xbt::replay_init();
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file [action_files]\n"
"\t# if all actions are in the same file\n"
XBT_INFO("Simulation time %g", e->getClock());
- simgrid::xbt::replay_exit(); /* Explicit finalization of the action module */
-
return 0;
}
static std::unordered_map<std::string, std::queue<ReplayAction*>*> action_queues;
XBT_PUBLIC_DATA(std::ifstream*) action_fs;
-XBT_PUBLIC(bool) replay_is_active();
-XBT_PUBLIC(void) replay_init();
-XBT_PUBLIC(void) replay_exit();
XBT_PUBLIC(int) replay_runner(int argc, char* argv[]);
}
}
void MSG_action_init()
{
- simgrid::xbt::replay_init();
MSG_function_register_default(simgrid::xbt::replay_runner);
}
void MSG_action_exit()
{
- simgrid::xbt::replay_exit();
+ // Nothing to do anymore here
}
/** \ingroup msg_trace_driven
if (index != MPI_UNDEFINED)
return process_data[index_to_process_data[index]]->replaying;
else
- return !simgrid::xbt::replay_is_active();
+ return false;
}
int smpi_global_size()
TRACE_smpi_collective_in(rank, -1, operation, extra);
TRACE_smpi_collective_out(rank, -1, operation);
xbt_free(operation);
- simgrid::xbt::replay_init();
xbt_replay_action_register("init", action_init);
xbt_replay_action_register("finalize", action_finalize);
xbt_replay_action_register("comm_size", action_comm_size);
if(active_processes==0){
/* Last process alive speaking: end the simulated timer */
XBT_INFO("Simulation time %f", smpi_process_simulated_elapsed());
- simgrid::xbt::replay_exit();
xbt_free(sendbuffer);
xbt_free(recvbuffer);
}
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(replay,xbt,"Replay trace reader");
-bool is_replay_active = false;
-
namespace simgrid {
namespace xbt {
}
}
-void replay_init()
-{
- if (!is_replay_active) {
- is_replay_active = true;
- }
-}
-
-void replay_exit()
-{
-}
-
-bool replay_is_active()
-{
- return is_replay_active;
-}
-
static ReplayAction* get_action(char* name)
{
ReplayAction* action;
*/
void xbt_replay_action_register(const char* action_name, action_fun function)
{
- if (!is_replay_active) // If the user registers a function before the start
- simgrid::xbt::replay_init();
simgrid::xbt::action_funs.insert({std::string(action_name), function});
}