X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7a1d9713c8dd8a96686f75acb428b2e4dcb08c1f..e8f12e0fe3d9332826b32fd44d4dae79579b1d31:/src/mc/api/State.cpp diff --git a/src/mc/api/State.cpp b/src/mc/api/State.cpp index aac9c32f90..38b0a35847 100644 --- a/src/mc/api/State.cpp +++ b/src/mc/api/State.cpp @@ -22,14 +22,16 @@ State::State(RemoteApp& remote_app) : num_(++expended_states_) XBT_VERB("Creating a guide for the state"); if (_sg_mc_strategy == "none") strategy_ = std::make_shared(); - if (_sg_mc_strategy == "nb_wait") + else if (_sg_mc_strategy == "nb_wait") strategy_ = std::make_shared(); + else + THROW_IMPOSSIBLE; recipe_ = std::list(); remote_app.get_actors_status(strategy_->actors_to_run_); -#if SIMGRID_HAVE_MC +#if SIMGRID_HAVE_STATEFUL_MC /* Stateful model checking */ if ((_sg_mc_checkpoint > 0 && (num_ % _sg_mc_checkpoint == 0)) || _sg_mc_termination) system_state_ = std::make_shared(num_, remote_app.get_page_store(), @@ -40,11 +42,12 @@ State::State(RemoteApp& remote_app) : num_(++expended_states_) State::State(RemoteApp& remote_app, std::shared_ptr parent_state) : num_(++expended_states_), parent_state_(parent_state) { - if (_sg_mc_strategy == "none") strategy_ = std::make_shared(); - if (_sg_mc_strategy == "nb_wait") + else if (_sg_mc_strategy == "nb_wait") strategy_ = std::make_shared(); + else + THROW_IMPOSSIBLE; *strategy_ = *(parent_state->strategy_); recipe_ = std::list(parent_state_->get_recipe()); @@ -52,8 +55,7 @@ State::State(RemoteApp& remote_app, std::shared_ptr parent_state) remote_app.get_actors_status(strategy_->actors_to_run_); - /* Stateful model checking */ -#if SIMGRID_HAVE_MC +#if SIMGRID_HAVE_STATEFUL_MC /* Stateful model checking */ if ((_sg_mc_checkpoint > 0 && (num_ % _sg_mc_checkpoint == 0)) || _sg_mc_termination) system_state_ = std::make_shared(num_, remote_app.get_page_store(), *remote_app.get_remote_process_memory()); @@ -87,7 +89,7 @@ std::size_t State::count_todo() const std::size_t State::count_todo_multiples() const { size_t count = 0; - for (auto& [_, actor] : strategy_->actors_to_run_) + for (auto const& [_, actor] : strategy_->actors_to_run_) if (actor.is_todo()) count += actor.get_times_not_considered(); @@ -122,7 +124,7 @@ aid_t State::next_transition() const return -1; } -std::pair State::next_transition_guided() const +std::pair State::next_transition_guided() const { return strategy_->next_transition(); }