for (auto const& s : mc_model_checker->getChecker()->get_textual_trace())
XBT_INFO(" %s", s.c_str());
dumpRecordPath();
- session->log_state();
+ session_singleton->log_state();
if (xbt_log_no_loc) {
XBT_INFO("Stack trace not displayed because you passed --log=no_loc");
} else {
for (auto const& s : getChecker()->get_textual_trace())
XBT_INFO(" %s", s.c_str());
dumpRecordPath();
- session->log_state();
+ session_singleton->log_state();
this->exit(SIMGRID_MC_EXIT_SAFETY);
return ((s_mc_message_int_t*)buff.data())->value;
}
-simgrid::mc::Session* session;
-
+simgrid::mc::Session* session_singleton;
}
}
};
// Temporary :)
-extern simgrid::mc::Session* session;
-
+extern simgrid::mc::Session* session_singleton;
}
}
simgrid::mc::Checker* Api::initialize(char** argv, simgrid::mc::CheckerAlgorithm algo) const
{
- simgrid::mc::session = new simgrid::mc::Session([argv] {
+ auto session = new simgrid::mc::Session([argv] {
int i = 1;
while (argv[i] != nullptr && argv[i][0] == '-')
i++;
THROW_IMPOSSIBLE;
}
+ simgrid::mc::session_singleton = session;
mc_model_checker->setChecker(checker);
return checker;
}
void Api::log_state() const
{
- session->log_state();
+ session_singleton->log_state();
}
bool Api::snapshot_equal(const Snapshot* s1, const Snapshot* s2) const
void Api::s_close() const
{
- session->close();
+ session_singleton->close();
}
void Api::execute(Transition& transition, smx_simcall_t simcall) const
{
/* FIXME: once all simcalls have observers, kill the simcall parameter and use mc_model_checker->simcall_to_string() */
transition.textual = request_to_string(simcall, transition.times_considered_);
- session->execute(transition);
+ session_singleton->execute(transition);
}
void Api::automaton_load(const char* file) const
return;
}
- session->restore_initial_state();
+ get_session().restore_initial_state();
const unsigned long maxpid = api::get().get_maxpid();
assert(maxpid == incomplete_communications_pattern.size());
}
}
- session->restore_initial_state();
+ get_session().restore_initial_state();
/* Traverse the stack from the initial state and re-execute the transitions */
int depth = 1;
return;
}
- session->restore_initial_state();
+ get_session().restore_initial_state();
/* Traverse the stack from the state at position start and re-execute the transitions */
for (std::unique_ptr<State> const& state : stack_) {
#if SIMGRID_HAVE_MC
// If in the MCer, ask the client app since it has all the data
if (mc_model_checker != nullptr) {
- return simgrid::mc::session->actor_is_enabled(actor->get_pid());
+ return simgrid::mc::session_singleton->actor_is_enabled(actor->get_pid());
}
#endif
// #
for (auto const& s : mc_model_checker->getChecker()->get_textual_trace())
XBT_INFO(" %s", s.c_str());
simgrid::mc::dumpRecordPath();
- simgrid::mc::session->log_state();
+ simgrid::mc::session_singleton->log_state();
}
void MC_automaton_load(const char *file)