From: Martin Quinson Date: Tue, 18 Apr 2023 07:08:17 +0000 (+0000) Subject: Merge branch 'udpor-phase7' into 'master' X-Git-Tag: v3.34~153 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/80b0dab1bd7ba4a54252a45cba41e33991e9f6ff?hp=-c Merge branch 'udpor-phase7' into 'master' Phase 7 of UDPOR Integration: Add specialized `ex(C)` computation for `Comm*` transitions See merge request simgrid/simgrid!144 --- 80b0dab1bd7ba4a54252a45cba41e33991e9f6ff diff --combined MANIFEST.in index 4a36a98ea9,8ddb3a7d56..fbc72decbd --- a/MANIFEST.in +++ b/MANIFEST.in @@@ -345,9 -345,8 +345,9 @@@ include examples/cpp/network-ns3/crosst include examples/cpp/network-ns3/dogbone_d.xml include examples/cpp/network-ns3/one_cluster_d.xml include examples/cpp/network-ns3/onelink_d.xml +include examples/cpp/network-ns3/s4u-network-ns3-notime.tesh +include examples/cpp/network-ns3/s4u-network-ns3-timed.tesh include examples/cpp/network-ns3/s4u-network-ns3.cpp -include examples/cpp/network-ns3/s4u-network-ns3.tesh include examples/cpp/network-wifi/s4u-network-wifi.cpp include examples/cpp/network-wifi/s4u-network-wifi.tesh include examples/cpp/platform-comm-serialize/s4u-platform-comm-serialize.cpp @@@ -2189,6 -2188,8 +2189,8 @@@ include src/mc/explo/udpor/Configuratio include src/mc/explo/udpor/EventSet.cpp include src/mc/explo/udpor/EventSet.hpp include src/mc/explo/udpor/EventSet_test.cpp + include src/mc/explo/udpor/ExtensionSetCalculator.cpp + include src/mc/explo/udpor/ExtensionSetCalculator.hpp include src/mc/explo/udpor/History.cpp include src/mc/explo/udpor/History.hpp include src/mc/explo/udpor/History_test.cpp @@@ -2226,7 -2227,6 +2228,7 @@@ include src/mc/mc_base.hp include src/mc/mc_client_api.cpp include src/mc/mc_config.cpp include src/mc/mc_config.hpp +include src/mc/mc_environ.h include src/mc/mc_exit.hpp include src/mc/mc_forward.hpp include src/mc/mc_global.cpp @@@ -2629,7 -2629,6 +2631,7 @@@ include tools/cmake/scripts/my_valgrind include tools/cmake/scripts/update_tesh.pl include tools/cmake/test_prog/prog_asan.cpp include tools/cmake/test_prog/prog_makecontext.c +include tools/cmake/test_prog/prog_ns3.cpp include tools/cmake/test_prog/prog_stackgrowth.c include tools/cmake/test_prog/prog_stacksetup.c include tools/cmake/test_prog/prog_tsan.cpp diff --combined src/mc/api/State.cpp index 38b0a35847,e701c72033..ca0a74dffd --- a/src/mc/api/State.cpp +++ b/src/mc/api/State.cpp @@@ -22,10 -22,8 +22,10 @@@ State::State(RemoteApp& remote_app) : n 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(); @@@ -42,12 -40,11 +42,12 @@@ 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()); @@@ -89,7 -86,7 +89,7 @@@ std::size_t State::count_todo() cons 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(); @@@ -130,7 -127,7 +130,7 @@@ std::pair State::next_trans } // This should be done in GuidedState, or at least interact with it - void State::execute_next(aid_t next, RemoteApp& app) + std::shared_ptr State::execute_next(aid_t next, RemoteApp& app) { // First, warn the guide, so it knows how to build a proper child state strategy_->execute_next(next, app); @@@ -165,9 -162,10 +165,10 @@@ // about a transition AFTER it has executed. transition_ = just_executed; - auto executed_transition = std::unique_ptr(just_executed); - actor_state.set_transition(std::move(executed_transition), times_considered); - + const auto executed_transition = std::shared_ptr(just_executed); + actor_state.set_transition(executed_transition, times_considered); app.wait_for_requests(); + + return executed_transition; } } // namespace simgrid::mc diff --combined src/mc/api/State.hpp index 7709cc1e81,111c4af99c..2e63961574 --- a/src/mc/api/State.hpp +++ b/src/mc/api/State.hpp @@@ -22,11 -22,19 +22,11 @@@ class XBT_PRIVATE State : public xbt::E static long expended_states_; /* Count total amount of states, for stats */ /** - * @brief An empty transition that leads to this state by default - */ - const std::unique_ptr default_transition_ = std::make_unique(); - - /** - * @brief The outgoing transition: what was the last transition that - * we took to leave this state? + * @brief The outgoing transition: what was the last transition that we took to leave this state? * - * The owner of the transition is the `ActorState` instance which exists in this state, - * or a reference to the internal default transition `Transition()` if no transition has been - * set + * The owner of the transition is the `ActorState` instance which exists in this state. */ - Transition* transition_ = default_transition_.get(); + Transition* transition_ = nullptr; /** @brief A list of transition to be replayed in order to get in this state. */ std::list recipe_; @@@ -58,9 -66,11 +58,11 @@@ public internal cost of the transition is returned */ std::pair next_transition_guided() const; - /* Explore a new path on the remote app; the parameter 'next' must be the result of a previous call to - * next_transition() */ - void execute_next(aid_t next, RemoteApp& app); + /** + * @brief Explore a new path on the remote app; the parameter 'next' must be the result of a previous call to + * next_transition() + */ + std::shared_ptr execute_next(aid_t next, RemoteApp& app); long get_num() const { return num_; } std::size_t count_todo() const; @@@ -70,20 -80,20 +72,20 @@@ * + consider_one mark aid actor (and assert it is possible) * + consider_best ensure one actor is marked by eventually marking the best regarding its guiding methode * + conside_all mark all enabled actor that are not done yet */ - void consider_one(aid_t aid) { strategy_->consider_one(aid); } - void consider_best() { strategy_->consider_best(); } - unsigned long consider_all() { return strategy_->consider_all(); } + void consider_one(aid_t aid) const { strategy_->consider_one(aid); } + void consider_best() const { strategy_->consider_best(); } + unsigned long consider_all() const { return strategy_->consider_all(); } bool is_actor_done(aid_t actor) const { return strategy_->actors_to_run_.at(actor).is_done(); } Transition* get_transition() const; void set_transition(Transition* t) { transition_ = t; } - std::shared_ptr get_parent_state() { return parent_state_; } + std::shared_ptr get_parent_state() const { return parent_state_; } std::list get_recipe() const { return recipe_; } std::map const& get_actors_list() const { return strategy_->actors_to_run_; } unsigned long get_actor_count() const { return strategy_->actors_to_run_.size(); } - bool is_actor_enabled(aid_t actor) { return strategy_->actors_to_run_.at(actor).is_enabled(); } + bool is_actor_enabled(aid_t actor) const { return strategy_->actors_to_run_.at(actor).is_enabled(); } Snapshot* get_system_state() const { return system_state_.get(); } void set_system_state(std::shared_ptr state) { system_state_ = std::move(state); } diff --combined tools/cmake/DefinePackages.cmake index 309236b5e3,5cd6e8ab06..3b1f734759 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@@ -568,6 -568,8 +568,8 @@@ set(MC_SRC_STATEFU src/mc/explo/udpor/Configuration.cpp src/mc/explo/udpor/EventSet.cpp src/mc/explo/udpor/EventSet.hpp + src/mc/explo/udpor/ExtensionSetCalculator.cpp + src/mc/explo/udpor/ExtensionSetCalculator.hpp src/mc/explo/udpor/History.cpp src/mc/explo/udpor/History.hpp src/mc/explo/udpor/maximal_subsets_iterator.cpp @@@ -613,7 -615,6 +615,7 @@@ src/mc/VisitedState.cpp src/mc/VisitedState.hpp src/mc/compare.cpp + src/mc/mc_environ.h src/mc/mc_exit.hpp src/mc/mc_forward.hpp src/mc/mc_private.hpp @@@ -1066,7 -1067,6 +1068,7 @@@ set(CMAKE_SOURCE_FILE tools/cmake/scripts/update_tesh.pl tools/cmake/test_prog/prog_asan.cpp tools/cmake/test_prog/prog_makecontext.c + tools/cmake/test_prog/prog_ns3.cpp tools/cmake/test_prog/prog_stackgrowth.c tools/cmake/test_prog/prog_stacksetup.c tools/cmake/test_prog/prog_tsan.cpp