Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
allow to retrieve the source and destination of a host-to-host Comm
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Thu, 23 Dec 2021 14:49:45 +0000 (15:49 +0100)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Thu, 23 Dec 2021 14:49:45 +0000 (15:49 +0100)
include/simgrid/s4u/Comm.hpp
src/s4u/s4u_Comm.cpp

index 36e04e8..6806ed9 100644 (file)
@@ -107,8 +107,10 @@ public:
   }
 
   /** Set the source and destination of communications that bypass the mailbox mechanism */
-  CommPtr set_from(Host* from);
-  CommPtr set_to(Host* to);
+  CommPtr set_source(Host* from);
+  Host* get_source() { return from_; }
+  CommPtr set_destination(Host* to);
+  Host* get_destination() { return to_; }
 
   /** Sets the maximal communication rate (in byte/sec). Must be done before start */
   CommPtr set_rate(double rate);
index e2b0348..14ffd37 100644 (file)
@@ -85,7 +85,7 @@ size_t Comm::wait_all_for(const std::vector<CommPtr>& comms, double timeout)
   return comms.size();
 }
 
-CommPtr Comm::set_from(Host* from)
+CommPtr Comm::set_source(Host* from)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
              "Cannot change the source of a Comm once it's started (state: %s)", to_c_str(state_));
@@ -96,7 +96,7 @@ CommPtr Comm::set_from(Host* from)
   return this;
 }
 
-CommPtr Comm::set_to(Host* to)
+CommPtr Comm::set_destination(Host* to)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
              "Cannot change the destination of a Comm once it's started (state: %s)", to_c_str(state_));