X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c4010c537a44b1fb18079401a3635821c86e6fcf..a3928e348b652b4d2c7c7ebf058205dbedac94cf:/src/mc/mc_state.cpp diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index acb6bc200e..b811c1d1e8 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -13,16 +13,14 @@ using simgrid::mc::remote; -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_state, mc, "Logging specific to MC (state)"); - namespace simgrid { namespace mc { State::State(unsigned long state_number) : num_(state_number) { this->internal_comm.clear(); - std::memset(&this->internal_req, 0, sizeof(this->internal_req)); - std::memset(&this->executed_req_, 0, sizeof(this->executed_req_)); + this->internal_req = s_smx_simcall(); + this->executed_req_ = s_smx_simcall(); actor_states_.resize(MC_smx_get_maxpid()); /* Stateful model checking */ @@ -60,7 +58,7 @@ Transition State::get_transition() const * Things can get muddled with the WAITANY and TESTANY simcalls, that are rewritten on the fly to a bunch of WAIT * (resp TEST) transitions using the transition.argument field to remember what was the last returned sub-transition. */ -static inline smx_simcall_t MC_state_get_request_for_process(simgrid::mc::State* state, smx_actor_t actor) +static inline smx_simcall_t MC_state_choose_request_for_process(simgrid::mc::State* state, smx_actor_t actor) { /* reset the outgoing transition */ simgrid::mc::ActorState* procstate = &state->actor_states_[actor->get_pid()]; @@ -118,12 +116,12 @@ static inline smx_simcall_t MC_state_get_request_for_process(simgrid::mc::State* mc_model_checker->process().read(temp_act, remote_act); simgrid::kernel::activity::CommImpl* act = temp_act.get_buffer(); if (act->src_actor_.get() && act->dst_actor_.get()) - state->transition_.argument_ = 0; + state->transition_.argument_ = 0; // OK else if (act->src_actor_.get() == nullptr && act->type_ == simgrid::kernel::activity::CommImpl::Type::READY && act->detached()) - state->transition_.argument_ = 0; + state->transition_.argument_ = 0; // OK else - state->transition_.argument_ = -1; + state->transition_.argument_ = -1; // timeout procstate->set_done(); req = &actor->simcall; break; @@ -202,14 +200,14 @@ static inline smx_simcall_t MC_state_get_request_for_process(simgrid::mc::State* return req; } -smx_simcall_t MC_state_get_request(simgrid::mc::State* state) +smx_simcall_t MC_state_choose_request(simgrid::mc::State* state) { for (auto& actor : mc_model_checker->process().actors()) { /* Only consider the actors that were marked as interleaving by the checker algorithm */ if (not state->actor_states_[actor.copy.get_buffer()->get_pid()].is_todo()) continue; - smx_simcall_t res = MC_state_get_request_for_process(state, actor.copy.get_buffer()); + smx_simcall_t res = MC_state_choose_request_for_process(state, actor.copy.get_buffer()); if (res) return res; }