From: Martin Quinson Date: Sun, 14 Mar 2021 15:15:15 +0000 (+0100) Subject: Move the logic retrieving the actor info in the App to RemoteProcess X-Git-Tag: v3.27~135 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a1dcee24d683702d4de4c69b99825ea0e275d617 Move the logic retrieving the actor info in the App to RemoteProcess --- diff --git a/src/mc/mc_smx.cpp b/src/mc/mc_smx.cpp index abb9d42c86..337c8201bd 100644 --- a/src/mc/mc_smx.cpp +++ b/src/mc/mc_smx.cpp @@ -66,24 +66,12 @@ void RemoteProcess::refresh_simix() if (this->cache_flags_ & RemoteProcess::cache_simix_processes) return; - // TODO, avoid to reload `&simix_global`, `simix_global`, `*simix_global` + RemotePtr actor_vector; + RemotePtr dead_actor_vector; + get_actor_vectors(actor_vector, dead_actor_vector); - static_assert(std::is_same< - std::unique_ptr, - decltype(simix_global) - >::value, "Unexpected type for simix_global"); - static_assert(sizeof(simix_global) == sizeof(simgrid::simix::Global*), - "Bad size for simix_global"); - - RemotePtr simix_global_p{this->read_variable("simix_global")}; - - // simix_global = REMOTE(*simix_global) - Remote simix_global = - this->read(simix_global_p); - - MC_process_refresh_simix_actor_dynar(this, this->smx_actors_infos, remote(simix_global.get_buffer()->actors_vector)); - MC_process_refresh_simix_actor_dynar(this, this->smx_dead_actors_infos, - remote(simix_global.get_buffer()->dead_actors_vector)); + MC_process_refresh_simix_actor_dynar(this, this->smx_actors_infos, actor_vector); + MC_process_refresh_simix_actor_dynar(this, this->smx_dead_actors_infos, dead_actor_vector); this->cache_flags_ |= RemoteProcess::cache_simix_processes; } diff --git a/src/mc/remote/RemoteProcess.cpp b/src/mc/remote/RemoteProcess.cpp index dd80f7e379..0b9b6e9ed5 100644 --- a/src/mc/remote/RemoteProcess.cpp +++ b/src/mc/remote/RemoteProcess.cpp @@ -583,5 +583,18 @@ unsigned long RemoteProcess::get_maxpid() const return maxpid; } +void RemoteProcess::get_actor_vectors(RemotePtr& actors, RemotePtr& dead_actors) +{ + static_assert(std::is_same, decltype(simix_global)>::value, + "Unexpected type for simix_global"); + static_assert(sizeof(simix_global) == sizeof(simgrid::simix::Global*), "Bad size for simix_global"); + + // TODO, avoid to reload `&simix_global`, `simix_global`, `*simix_global` + RemotePtr simix_global_p{this->read_variable("simix_global")}; + Remote simix_global = this->read(simix_global_p); + + actors = remote(simix_global.get_buffer()->actors_vector); + dead_actors = remote(simix_global.get_buffer()->dead_actors_vector); +} } // namespace mc } // namespace simgrid diff --git a/src/mc/remote/RemoteProcess.hpp b/src/mc/remote/RemoteProcess.hpp index 78bb6b7233..d0d53cb1b0 100644 --- a/src/mc/remote/RemoteProcess.hpp +++ b/src/mc/remote/RemoteProcess.hpp @@ -195,6 +195,7 @@ public: } unsigned long get_maxpid() const; + void get_actor_vectors(RemotePtr& actors, RemotePtr& dead_actors); void dump_stack() const;