X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e750bcdcad576d07368829aa0f09c4056b8d5ec5..49f7666180800a60794b56ae7feade3b0d3f3be2:/src/kernel/activity/CommImpl.hpp diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index 2d9a9023fd..71f44a7cb1 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -22,7 +22,7 @@ class XBT_PUBLIC CommImpl : public ActivityImpl_T { static void (*copy_data_callback_)(CommImpl*, void*, size_t); - double rate_ = 0.0; + double rate_ = -1.0; double size_ = 0.0; bool detached_ = false; /* If detached or not */ bool copied_ = false; /* whether the data were already copied */ @@ -34,13 +34,16 @@ class XBT_PUBLIC CommImpl : public ActivityImpl_T { CommImplType type_ = CommImplType::SEND; /* Type of the communication (SEND or RECEIVE) */ public: - static void set_copy_data_callback(void (*callback)(CommImpl*, void*, size_t)); - CommImpl() = default; - CommImpl(s4u::Host* from, s4u::Host* to, double bytes); + + static void set_copy_data_callback(void (*callback)(CommImpl*, void*, size_t)); CommImpl& set_type(CommImplType type); CommImplType get_type() const { return type_; } + CommImpl& set_source(s4u::Host* from); + s4u::Host* get_source() const { return from_; } + CommImpl& set_destination(s4u::Host* to); + s4u::Host* get_destination() const { return to_; } 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); @@ -51,7 +54,8 @@ public: double get_rate() const { return rate_; } MailboxImpl* get_mailbox() const { return mbox_; } long get_mailbox_id() const { return mbox_id_; } - bool detached() const { return detached_; } + bool is_detached() const { return detached_; } + bool is_assigned() const { return (to_ != nullptr && from_ != nullptr); } std::vector get_traversed_links() const; void copy_data(); @@ -71,13 +75,6 @@ public: void set_exception(actor::ActorImpl* issuer) override; void finish() override; - -#if SIMGRID_HAVE_MC - MailboxImpl* mbox_cpy = nullptr; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR - (comm.mbox set to nullptr when the communication is removed from the mailbox - (used as garbage collector)) */ -#endif - void (*clean_fun)(void*) = nullptr; /* Function to clean the detached src_buf if something goes wrong */ bool (*match_fun)(void*, void*, CommImpl*) = nullptr; /* Filter function used by the other side. It is used when looking if a given communication matches my needs. For that, myself must match the