X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/001737a15701027974d89260771284a45013d2cd..8f14731685bc7fea43ca95def23ab2031e7a32eb:/src/kernel/activity/CommImpl.hpp diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index f881e04d38..9bda708911 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -15,24 +15,32 @@ namespace simgrid { namespace kernel { namespace activity { -class XBT_PUBLIC CommImpl : public ActivityImpl { +class XBT_PUBLIC CommImpl : public ActivityImpl_T { ~CommImpl() override; void cleanupSurf(); + double rate_ = 0.0; + double size_ = 0.0; + public: enum class Type { SEND = 0, RECEIVE, READY, DONE }; - explicit CommImpl(Type type); - void start(); + CommImpl& set_type(CommImpl::Type type); + CommImpl& set_size(double size); + double get_rate() { return rate_; } + CommImpl& set_rate(double rate); + CommImpl& set_src_buff(void* buff, size_t size); + CommImpl& set_dst_buff(void* buff, size_t* size); + + CommImpl* start(); void copy_data(); void suspend() override; void resume() override; void post() override; void finish() override; void cancel(); - double remains(); - CommImpl::Type type; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */ + CommImpl::Type type_; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */ MailboxImpl* mbox = nullptr; /* Rendez-vous where the comm is queued */ #if SIMGRID_HAVE_MC @@ -49,13 +57,10 @@ expectations of the other side, too. See */ void (*copy_data_fun)(CommImpl*, void*, size_t) = nullptr; /* Surf action data */ - resource::Action* surf_action_ = nullptr; /* The Surf communication action encapsulated */ resource::Action* src_timeout_ = nullptr; /* Surf's actions to instrument the timeouts */ resource::Action* dst_timeout_ = nullptr; /* Surf's actions to instrument the timeouts */ actor::ActorImplPtr src_actor_ = nullptr; actor::ActorImplPtr dst_actor_ = nullptr; - double rate_ = 0.0; - double task_size_ = 0.0; /* Data to be transfered */ void* src_buff_ = nullptr;