X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/19c58cbb49a4c58174169566b13aafb2b873fd81..909864a6927db2f6105ab740ad185de7aa7e5a71:/src/mc/mc_base.cpp diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index f68fc96a9b..42906fe22b 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -38,7 +38,6 @@ int MC_random(int min, int max) xbt_assert(mc_mode != MC_MODE_SERVER); /* TODO, if the MC is disabled we do not really need to make a simcall for * this :) */ - /* FIXME: return mc_current_state->executed_transition->random.value; */ return simcall_mc_random(min, max); } @@ -154,16 +153,19 @@ bool request_is_enabled(smx_simcall_t req) mutex = &temp_mutex; } #endif + if(mutex->owner == nullptr) return true; - else #if HAVE_MC + else if (mc_mode == MC_MODE_SERVER) { + simgrid::mc::Process& modelchecked = mc_model_checker->process(); // TODO, *(mutex->owner) :/ - return MC_smx_resolve_process(mutex->owner)->pid == - MC_smx_resolve_process(req->issuer)->pid; -#else - return mutex->owner->pid == req->issuer->pid; + return modelchecked.resolveProcess(simgrid::mc::remote(mutex->owner))->pid + == modelchecked.resolveProcess(simgrid::mc::remote(req->issuer))->pid; + } #endif + else + return mutex->owner->pid == req->issuer->pid; } default: @@ -214,30 +216,3 @@ int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max) return prng_random(min, max); return simcall->mc_value; } - -namespace simgrid { -namespace mc { - -void handle_simcall(smx_simcall_t req, int value) -{ -#if !HAVE_MC - SIMIX_simcall_handle(req, value); -#else - if (mc_mode == MC_MODE_CLIENT) { - SIMIX_simcall_handle(req, value); - return; - } - - for (auto& pi : mc_model_checker->process().smx_process_infos) - if (req == &pi.copy.simcall) { - mc_model_checker->simcall_handle( - mc_model_checker->process(), pi.copy.pid, value); - return; - } - - xbt_die("Could not find the request"); -#endif -} - -} -}