From: Martin Quinson Date: Sat, 25 Mar 2023 15:06:56 +0000 (+0100) Subject: MC protocol: rename INITIAL_ADDRESSES msg to NEED_MEMINFO X-Git-Tag: v3.34~256 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fa22f462594acff6e8eaab9fb39453ae1927e51c MC protocol: rename INITIAL_ADDRESSES msg to NEED_MEMINFO --- diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index 4baa05966f..8813a4f832 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -150,13 +150,13 @@ void AppSide::handle_finalize(const s_mc_message_int_t* msg) const if (terminate_asap) ::_Exit(0); } -void AppSide::handle_initial_addresses() +void AppSide::handle_need_meminfo() { - this->need_memory_info_ = true; - s_mc_message_initial_addresses_reply_t answer = {}; - answer.type = MessageType::INITIAL_ADDRESSES_REPLY; - answer.mmalloc_default_mdp = mmalloc_get_current_heap(); - xbt_assert(channel_.send(answer) == 0, "Could not send response with initial addresses."); + this->need_memory_info_ = true; + s_mc_message_need_meminfo_reply_t answer = {}; + answer.type = MessageType::NEED_MEMINFO_REPLY; + answer.mmalloc_default_mdp = mmalloc_get_current_heap(); + xbt_assert(channel_.send(answer) == 0, "Could not send response to the request for meminfo."); } void AppSide::handle_actors_status() const { @@ -262,9 +262,9 @@ void AppSide::handle_messages() handle_finalize((s_mc_message_int_t*)message_buffer.data()); break; - case MessageType::INITIAL_ADDRESSES: - assert_msg_size("INITIAL_ADDRESSES", s_mc_message_t); - handle_initial_addresses(); + case MessageType::NEED_MEMINFO: + assert_msg_size("NEED_MEMINFO", s_mc_message_t); + handle_need_meminfo(); break; case MessageType::ACTORS_STATUS: diff --git a/src/mc/remote/AppSide.hpp b/src/mc/remote/AppSide.hpp index 8d8a3cfbcc..d4e68aab42 100644 --- a/src/mc/remote/AppSide.hpp +++ b/src/mc/remote/AppSide.hpp @@ -22,7 +22,7 @@ class XBT_PUBLIC AppSide { private: Channel channel_; static std::unique_ptr instance_; - bool need_memory_info_ = false; /* by default we don't send memory info, unless we got a INITIAL_ADDRESSES */ + bool need_memory_info_ = false; /* by default we don't send memory info, unless we got a NEED_MEMINFO */ public: AppSide(); @@ -33,7 +33,7 @@ private: void handle_deadlock_check(const s_mc_message_t* msg) const; void handle_simcall_execute(const s_mc_message_simcall_execute_t* message) const; void handle_finalize(const s_mc_message_int_t* msg) const; - void handle_initial_addresses(); + void handle_need_meminfo(); void handle_actors_status() const; void handle_actors_maxpid() const; diff --git a/src/mc/remote/CheckerSide.cpp b/src/mc/remote/CheckerSide.cpp index 6c8349c0a3..9d8287990b 100644 --- a/src/mc/remote/CheckerSide.cpp +++ b/src/mc/remote/CheckerSide.cpp @@ -193,12 +193,12 @@ CheckerSide::CheckerSide(const std::vector& args, bool need_memory_info) // Request the initial memory on need if (need_memory_info) { - channel_.send(MessageType::INITIAL_ADDRESSES); - s_mc_message_initial_addresses_reply_t answer; + channel_.send(MessageType::NEED_MEMINFO); + s_mc_message_need_meminfo_reply_t answer; ssize_t answer_size = channel_.receive(answer); xbt_assert(answer_size != -1, "Could not receive message"); - xbt_assert(answer.type == MessageType::INITIAL_ADDRESSES_REPLY, - "The received message is not the INITIAL_ADDRESS_REPLY I was expecting but of type %s", + xbt_assert(answer.type == MessageType::NEED_MEMINFO_REPLY, + "The received message is not the NEED_MEMINFO_REPLY I was expecting but of type %s", to_c_str(answer.type)); xbt_assert(answer_size == sizeof answer, "Broken message (size=%zd; expected %zu)", answer_size, sizeof answer); diff --git a/src/mc/remote/mc_protocol.h b/src/mc/remote/mc_protocol.h index 97b72eee4e..f22cfd1876 100644 --- a/src/mc/remote/mc_protocol.h +++ b/src/mc/remote/mc_protocol.h @@ -23,11 +23,10 @@ // ***** Messages namespace simgrid::mc { -XBT_DECLARE_ENUM_CLASS(MessageType, NONE, INITIAL_ADDRESSES, INITIAL_ADDRESSES_REPLY, CONTINUE, IGNORE_HEAP, - UNIGNORE_HEAP, IGNORE_MEMORY, STACK_REGION, REGISTER_SYMBOL, DEADLOCK_CHECK, - DEADLOCK_CHECK_REPLY, WAITING, SIMCALL_EXECUTE, SIMCALL_EXECUTE_ANSWER, ASSERTION_FAILED, - ACTORS_STATUS, ACTORS_STATUS_REPLY, ACTORS_MAXPID, ACTORS_MAXPID_REPLY, FINALIZE, - FINALIZE_REPLY); +XBT_DECLARE_ENUM_CLASS(MessageType, NONE, NEED_MEMINFO, NEED_MEMINFO_REPLY, CONTINUE, IGNORE_HEAP, UNIGNORE_HEAP, + IGNORE_MEMORY, STACK_REGION, REGISTER_SYMBOL, DEADLOCK_CHECK, DEADLOCK_CHECK_REPLY, WAITING, + SIMCALL_EXECUTE, SIMCALL_EXECUTE_ANSWER, ASSERTION_FAILED, ACTORS_STATUS, ACTORS_STATUS_REPLY, + ACTORS_MAXPID, ACTORS_MAXPID_REPLY, FINALIZE, FINALIZE_REPLY); } // namespace simgrid::mc constexpr unsigned MC_MESSAGE_LENGTH = 512; @@ -81,7 +80,7 @@ struct s_mc_message_register_symbol_t { }; /* Server -> client */ -struct s_mc_message_initial_addresses_reply_t { +struct s_mc_message_need_meminfo_reply_t { simgrid::mc::MessageType type; xbt_mheap_t mmalloc_default_mdp; };