From: SUTER Frederic Date: Wed, 22 Dec 2021 08:11:49 +0000 (+0100) Subject: associate a s4u::Comm to a kernel::activity::CommImpl (partial set for now because... X-Git-Tag: v3.30~211 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/09a7e9026201418519bf9e69a312bc98f9532036 associate a s4u::Comm to a kernel::activity::CommImpl (partial set for now because of old simcalls) --- diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index a71052f3de..b190e8ebd3 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -26,6 +26,7 @@ class XBT_PUBLIC CommImpl : public ActivityImpl_T { MailboxImpl* mbox_ = nullptr; /* Rendez-vous where the comm is queued */ s4u::Host* from_ = nullptr; /* Pre-determined only for direct host-to-host communications */ s4u::Host* to_ = nullptr; /* Otherwise, computed at start() time from the actors */ + s4u::Comm* piface_ = nullptr; public: enum class Type { SEND, RECEIVE }; @@ -35,6 +36,8 @@ public: explicit CommImpl(Type type) : type_(type) {} CommImpl(s4u::Host* from, s4u::Host* to, double bytes); + void set_iface(s4u::Comm* piface) { piface_ = piface; } + s4u::Comm* get_iface() const { return piface_; } CommImpl& set_size(double size); CommImpl& set_src_buff(unsigned char* buff, size_t size); CommImpl& set_dst_buff(unsigned char* buff, size_t* size); diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index 8db5454fb2..c58896f68d 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -212,6 +212,8 @@ Comm* Comm::start() if (suspended_) pimpl_->suspend(); + if (not detached_) + static_cast(pimpl_.get())->set_iface(this); state_ = State::STARTED; return this; }