Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
No need to save the observers on the App side now that they are serialized over
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 11 Feb 2022 21:06:09 +0000 (22:06 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 11 Feb 2022 21:06:09 +0000 (22:06 +0100)
src/kernel/actor/ActorImpl.hpp
src/mc/remote/AppSide.cpp

index c18ae4c..a1672be 100644 (file)
@@ -71,7 +71,6 @@ public:
   activity::ActivityImplPtr waiting_synchro_ = nullptr; /* the current blocking synchro if any */
   std::list<activity::ActivityImplPtr> activities_;     /* the current non-blocking synchros */
   s_smx_simcall simcall_;
-  std::vector<SimcallObserver*> observer_stack_;
   /* list of functions executed when the actor dies */
   std::shared_ptr<std::vector<std::function<void(bool)>>> on_exit =
       std::make_shared<std::vector<std::function<void(bool)>>>();
index 57bd6a2..4517e70 100644 (file)
@@ -98,17 +98,13 @@ void AppSide::handle_simcall_execute(const s_mc_message_simcall_execute_t* messa
 {
   kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(message->aid_);
   xbt_assert(actor != nullptr, "Invalid pid %ld", message->aid_);
-  simgrid::kernel::actor::SimcallObserver* observer = nullptr;
-  if (actor->simcall_.observer_ != nullptr) {
-    observer = actor->simcall_.observer_->clone();
-    actor->observer_stack_.push_back(observer);
-  }
-  // Finish the RPC from the server: we need to return a pointer to the observer, saved in a stable storage
+
+  // 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;
   memset(&answer, 0, sizeof(answer));
   answer.type = MessageType::SIMCALL_EXECUTE_ANSWER;
-  if (observer != nullptr)
-    observer->serialize(answer.simcall, answer.buffer);
+  if (actor->simcall_.observer_ != nullptr)
+    actor->simcall_.observer_->serialize(answer.simcall, answer.buffer);
   XBT_DEBUG("send SIMCALL_EXECUTE_ANSWER(%s) ~> %s '%s'", actor->get_cname(),
             simgrid::kernel::actor::SimcallObserver::to_c_str(answer.simcall), answer.buffer);
   xbt_assert(channel_.send(answer) == 0, "Could not send response");