+
+ // Finish the RPC from the server: return a serialized observer, to build a Transition on Checker side
+ s_mc_message_simcall_execute_answer_t answer = {};
+ answer.type = MessageType::SIMCALL_EXECUTE_ANSWER;
+ std::stringstream stream;
+ if (actor->simcall_.observer_ != nullptr) {
+ actor->simcall_.observer_->serialize(stream);
+ } else {
+ stream << (short)mc::Transition::Type::UNKNOWN;
+ }
+ std::string str = stream.str();
+ xbt_assert(str.size() + 1 <= answer.buffer.size(),
+ "The serialized simcall is too large for the buffer. Please fix the code.");
+ strncpy(answer.buffer.data(), str.c_str(), answer.buffer.size() - 1);
+ answer.buffer.back() = '\0';
+
+ XBT_DEBUG("send SIMCALL_EXECUTE_ANSWER(%s) ~> '%s'", actor->get_cname(), str.c_str());
+ xbt_assert(channel_.send(answer) == 0, "Could not send response");
+}
+
+void AppSide::handle_finalize(const s_mc_message_int_t* msg) const
+{
+ bool terminate_asap = msg->value;
+ XBT_DEBUG("Finalize (terminate = %d)", (int)terminate_asap);
+ if (not terminate_asap) {
+ if (XBT_LOG_ISENABLED(mc_client, xbt_log_priority_debug))
+ kernel::EngineImpl::get_instance()->display_all_actor_status();
+#if HAVE_SMPI
+ XBT_DEBUG("Smpi_enabled: %d", SMPI_is_inited());
+ if (SMPI_is_inited())
+ SMPI_finalize();
+#endif
+ }
+ coverage_checkpoint();
+ xbt_assert(channel_.send(MessageType::FINALIZE_REPLY) == 0, "Could not answer to FINALIZE");
+ std::fflush(stdout);
+ if (terminate_asap)
+ ::_Exit(0);
+}
+void AppSide::handle_initial_addresses()
+{
+ 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.");