Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simcall_get_comm() defined and implemented
authoreazimi <azimi.ehsan@outlook.com>
Mon, 25 Jan 2021 15:01:02 +0000 (16:01 +0100)
committereazimi <azimi.ehsan@outlook.com>
Mon, 25 Jan 2021 15:01:02 +0000 (16:01 +0100)
src/mc/mc_api.cpp
src/mc/mc_api.hpp

index 51f3d9f..091ae12 100644 (file)
@@ -61,6 +61,18 @@ smx_mailbox_t get_mbox(smx_simcall_t const r)
   }
 }
 
+inline simgrid::kernel::activity::CommImpl* get_comm(smx_simcall_t const r)
+{
+  switch (r->call_) {
+    case Simcall::COMM_WAIT:
+      return simcall_comm_wait__getraw__comm(r);
+    case Simcall::COMM_TEST:
+      return simcall_comm_test__getraw__comm(r);
+    default:
+      return nullptr;
+  }
+}
+
 /* Search an enabled transition for the given process.
  *
  * This can be seen as an iterator returning the next transition of the process.
@@ -425,6 +437,11 @@ smx_mailbox_t mc_api::simcall_get_mbox(smx_simcall_t const req) const
   return get_mbox(req);
 }
 
+simgrid::kernel::activity::CommImpl* mc_api::simcall_get_comm(smx_simcall_t const req) const
+{
+  return get_comm(req);
+}
+
 bool mc_api::mc_is_null() const
 {
   auto is_null = (mc_model_checker == nullptr) ? true : false;
index a684159..d2e218f 100644 (file)
@@ -100,6 +100,7 @@ public:
   smx_actor_t simcall_get_issuer(s_smx_simcall const* req) const;
   long simcall_get_actor_id(s_smx_simcall const* req) const;
   smx_mailbox_t simcall_get_mbox(smx_simcall_t const req) const;
+  simgrid::kernel::activity::CommImpl* simcall_get_comm(smx_simcall_t const req) const;
 
 #if HAVE_SMPI
   int get_smpi_request_tag(smx_simcall_t const& simcall, simgrid::simix::Simcall type) const;