X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9e34d715bca0465a05c87301f6d0238d1a516c74..5f2e051a9bb2b088d3b3543982d3a244b7b7b1c4:/src/mc/mc_base.cpp diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index 3711f92e59..91012ba602 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -16,10 +16,8 @@ #if SIMGRID_HAVE_MC #include "src/mc/ModelChecker.hpp" -#include "src/mc/Session.hpp" +#include "src/mc/api/RemoteApp.hpp" #include "src/mc/remote/RemoteProcess.hpp" - -using simgrid::mc::remote; #endif XBT_LOG_NEW_DEFAULT_CATEGORY(mc, "All MC categories"); @@ -37,15 +35,12 @@ int MC_random(int min, int max) return simgrid::kernel::actor::simcall_answered([&observer] { return observer.get_value(); }, &observer); } -namespace simgrid { -namespace mc { +namespace simgrid::mc { void execute_actors() { auto* engine = kernel::EngineImpl::get_instance(); -#if SIMGRID_HAVE_MC - xbt_assert(mc_model_checker == nullptr, "This must be called from the client"); -#endif + while (engine->has_actors_to_run()) { engine->run_all_actors(); for (auto const& actor : engine->get_actors_that_ran()) { @@ -54,16 +49,6 @@ void execute_actors() actor->simcall_handle(0); } } -#if SIMGRID_HAVE_MC - engine->reset_actor_dynar(); - for (auto const& kv : engine->get_actor_list()) { - auto actor = kv.second; - // Only visible requests remain at this point, and they all have an observer - actor->simcall_.mc_max_consider_ = actor->simcall_.observer_->get_max_consider(); - - engine->add_actor_to_dynar(actor); - } -#endif } /** @brief returns if there this transition can proceed in a finite amount of time @@ -78,7 +63,7 @@ void execute_actors() * This is controlled in the is_enabled() method of the corresponding observers. */ // Called from both MCer and MCed: -bool actor_is_enabled(smx_actor_t actor) +bool actor_is_enabled(kernel::actor::ActorImpl* actor) { #if SIMGRID_HAVE_MC xbt_assert(mc_model_checker == nullptr, "This should be called from the client side"); @@ -111,5 +96,4 @@ bool request_is_visible(const kernel::actor::Simcall* req) return false; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc