X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/41887885e1953cb056594145190e30088f9b6d03..8cb67632980ded866c69cbd6c8a354e85a10cbec:/src/mc/mc_state.cpp diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 6bc1a7d571..f92aaa142f 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -59,6 +59,32 @@ int State::next_transition() const } return -1; } +RemotePtr State::execute_next(int next) +{ + std::vector& actors = mc_model_checker->get_remote_process().actors(); + + kernel::actor::ActorImpl* actor = actors[next].copy.get_buffer(); + aid_t aid = actor->get_pid(); + int times_considered; + + simgrid::mc::ActorState* actor_state = &actor_states_[aid]; + /* This actor is ready to be executed. Prepare its execution when simcall_handle will be called on it */ + if (actor->simcall_.observer_ != nullptr) { + times_considered = actor_state->get_times_considered_and_inc(); + if (actor->simcall_.mc_max_consider_ <= actor_state->get_times_considered()) + actor_state->set_done(); + } else { + times_considered = 0; + actor_state->set_done(); + } + + transition_.init(aid, times_considered); + executed_req_ = actor->simcall_; + + XBT_DEBUG("Let's run actor %ld, going for transition %s", aid, transition_.to_string().c_str()); + + return transition_.replay(); +} void State::copy_incomplete_comm_pattern() {