X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/af0e89d6cd65617674aeab00c8cc8c6844d92874..485fa582bda7c51fb184bf0f82d0eb250be9f805:/src/mc/mc_state.cpp diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 7121dee7f4..dfa57a439a 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -5,7 +5,7 @@ #include "src/mc/mc_state.hpp" #include "src/mc/mc_config.hpp" -#include "src/mc/mc_api.hpp" +#include "src/mc/api.hpp" #include @@ -17,8 +17,7 @@ namespace mc { State::State(unsigned long state_number) : num_(state_number) { - this->internal_comm_.clear(); - auto maxpid = api::get().get_maxpid(); + const unsigned long maxpid = api::get().get_maxpid(); actor_states_.resize(maxpid); /* Stateful model checking */ if ((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination) { @@ -31,7 +30,7 @@ State::State(unsigned long state_number) : num_(state_number) } } -std::size_t State::interleave_size() const +std::size_t State::count_todo() const { return boost::range::count_if(this->actor_states_, [](simgrid::mc::ActorState const& a) { return a.is_todo(); }); } @@ -44,7 +43,8 @@ Transition State::get_transition() const void State::copy_incomplete_comm_pattern() { incomplete_comm_pattern_.clear(); - for (unsigned long i = 0; i < api::get().get_maxpid(); i++) { + const unsigned long maxpid = api::get().get_maxpid(); + for (unsigned long i = 0; i < maxpid; i++) { std::vector res; for (auto const& comm : incomplete_communications_pattern[i]) res.push_back(comm->dup());