From 1ac47fb418e3ed32ad12b3db4d1c02aa50c17091 Mon Sep 17 00:00:00 2001 From: eazimi Date: Mon, 25 Jan 2021 16:01:02 +0100 Subject: [PATCH] simcall_get_comm() defined and implemented --- src/mc/mc_api.cpp | 17 +++++++++++++++++ src/mc/mc_api.hpp | 1 + 2 files changed, 18 insertions(+) diff --git a/src/mc/mc_api.cpp b/src/mc/mc_api.cpp index 51f3d9f5ca..091ae12287 100644 --- a/src/mc/mc_api.cpp +++ b/src/mc/mc_api.cpp @@ -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; diff --git a/src/mc/mc_api.hpp b/src/mc/mc_api.hpp index a6841591a5..d2e218fc5c 100644 --- a/src/mc/mc_api.hpp +++ b/src/mc/mc_api.hpp @@ -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; -- 2.30.2