Logo AND Algorithmique Numérique Distribuée

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

index fa34ccb..51f3d9f 100644 (file)
@@ -48,6 +48,19 @@ static char* buff_size_to_string(size_t buff_size)
   return xbt_strdup("(verbose only)");
 }
 
+inline
+smx_mailbox_t get_mbox(smx_simcall_t const r)
+{
+  switch (r->call_) {
+    case Simcall::COMM_ISEND:
+      return simcall_comm_isend__get__mbox(r);
+    case Simcall::COMM_IRECV:
+      return simcall_comm_irecv__get__mbox(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.
@@ -407,6 +420,11 @@ long mc_api::simcall_get_actor_id(s_smx_simcall const* req) const
   return MC_smx_simcall_get_issuer(req)->get_pid();
 }
 
+smx_mailbox_t mc_api::simcall_get_mbox(smx_simcall_t const req) const
+{
+  return get_mbox(req);
+}
+
 bool mc_api::mc_is_null() const
 {
   auto is_null = (mc_model_checker == nullptr) ? true : false;
index 401eae0..a684159 100644 (file)
@@ -99,6 +99,7 @@ public:
   const char *simcall_get_name(simgrid::simix::Simcall kind) const;
   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;
 
 #if HAVE_SMPI
   int get_smpi_request_tag(smx_simcall_t const& simcall, simgrid::simix::Simcall type) const;