Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename Activity::wait(double) to Activity::wait_for(double)
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Aug 2018 13:43:59 +0000 (15:43 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Aug 2018 16:42:40 +0000 (18:42 +0200)
Along with the deprecation wrappers, and in all subclasses also.

examples/s4u/dht-chord/s4u-dht-chord-node.cpp
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/Exec.hpp
include/simgrid/s4u/Io.hpp
src/plugins/vm/VmLiveMigration.cpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Io.cpp
src/s4u/s4u_Mailbox.cpp

index 90ae8c1..f535b31 100644 (file)
@@ -239,7 +239,7 @@ void Node::checkPredecessor()
   simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
   simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
-    comm->wait(timeout);
+    comm->wait_for(timeout);
     XBT_DEBUG("Received the answer to my 'Predecessor Alive': my predecessor %d is alive", pred_id_);
     delete static_cast<ChordMessage*>(data);
   } catch (xbt_ex& e) {
     XBT_DEBUG("Received the answer to my 'Predecessor Alive': my predecessor %d is alive", pred_id_);
     delete static_cast<ChordMessage*>(data);
   } catch (xbt_ex& e) {
@@ -284,7 +284,7 @@ int Node::remoteGetPredecessor(int ask_to)
   simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
   simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
-    comm->wait(timeout);
+    comm->wait_for(timeout);
     ChordMessage* answer = static_cast<ChordMessage*>(data);
     XBT_DEBUG("Received the answer to my 'Get Predecessor' request: the predecessor of node %d is %d", ask_to,
               answer->answer_id);
     ChordMessage* answer = static_cast<ChordMessage*>(data);
     XBT_DEBUG("Received the answer to my 'Get Predecessor' request: the predecessor of node %d is %d", ask_to,
               answer->answer_id);
@@ -358,7 +358,7 @@ int Node::remoteFindSuccessor(int ask_to, int id)
   simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
   simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
-    comm->wait(timeout);
+    comm->wait_for(timeout);
     ChordMessage* answer = static_cast<ChordMessage*>(data);
     XBT_DEBUG("Received the answer to my 'Find Successor' request for id %d: the successor of key %d is %d",
               answer->request_id, id_, answer->answer_id);
     ChordMessage* answer = static_cast<ChordMessage*>(data);
     XBT_DEBUG("Received the answer to my 'Find Successor' request for id %d: the successor of key %d is %d",
               answer->request_id, id_, answer->answer_id);
index 3a374a4..cd68b0a 100644 (file)
@@ -61,7 +61,7 @@ public:
   virtual Activity* wait() = 0;
   /** Blocks until the activity is terminated, or until the timeout is elapsed
    *  Raises: timeout exception.*/
   virtual Activity* wait() = 0;
   /** Blocks until the activity is terminated, or until the timeout is elapsed
    *  Raises: timeout exception.*/
-  virtual Activity* wait(double timeout) = 0;
+  virtual Activity* wait_for(double timeout) = 0;
   /** Cancel that activity */
   virtual Activity* cancel() = 0;
   /** Retrieve the current state of the activity */
   /** Cancel that activity */
   virtual Activity* cancel() = 0;
   /** Retrieve the current state of the activity */
@@ -87,21 +87,17 @@ public:
   void* get_user_data() { return user_data_; }
 
 #ifndef DOXYGEN
   void* get_user_data() { return user_data_; }
 
 #ifndef DOXYGEN
-  /** @deprecated See Activity::get_state()*/
+  XBT_ATTRIB_DEPRECATED_v324("Please use Activity::wait_for()") virtual void wait(double timeout) = 0;
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
-  /** @deprecated See Activity::get_remaining() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_remaining()") double getRemains() { return get_remaining(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_remaining()") double getRemains() { return get_remaining(); }
-  /** @deprecated See Activity::set_remaining() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::set_remaining()") Activity* setRemains(double remains)
   {
     return set_remaining(remains);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::set_remaining()") Activity* setRemains(double remains)
   {
     return set_remaining(remains);
   }
-  /** @deprecated See Activity::set_user_data() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::set_user_data()") Activity* setUserData(void* data)
   {
     return set_user_data(data);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::set_user_data()") Activity* setUserData(void* data)
   {
     return set_user_data(data);
   }
-  /** @deprecated See Activity::get_user_data() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_user_data()") void* getUserData() { return user_data_; }
 #endif
 
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_user_data()") void* getUserData() { return user_data_; }
 #endif
 
index a057630..ff9c373 100644 (file)
@@ -44,7 +44,7 @@ public:
 
   Activity* start() override;
   Activity* wait() override;
 
   Activity* start() override;
   Activity* wait() override;
-  Activity* wait(double timeout) override;
+  Activity* wait_for(double timeout) override;
   bool test() override;
 
   /** Start the comm, and ignore its result. It can be completely forgotten after that. */
   bool test() override;
 
   /** Start the comm, and ignore its result. It can be completely forgotten after that. */
@@ -79,39 +79,32 @@ public:
   MailboxPtr get_mailbox();
 
 #ifndef DOXYGEN
   MailboxPtr get_mailbox();
 
 #ifndef DOXYGEN
-  /** @deprecated See Comm::set_rate() */
+  XBT_ATTRIB_DEPRECATED_v324("Please use Comm::wait_for()") void wait(double t) override { wait_for(t); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_rate()") Activity* setRate(double rate) { return set_rate(rate); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_rate()") Activity* setRate(double rate) { return set_rate(rate); }
-  /** @deprecated See Comm::set_src_data() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff)
   {
     return set_src_data(buff);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff)
   {
     return set_src_data(buff);
   }
-  /** @deprecated See Comm::set_src_data() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff, size_t size)
   {
     return set_src_data(buff, size);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff, size_t size)
   {
     return set_src_data(buff, size);
   }
-  /** @deprecated See Comm::set_src_data_size() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data_size()") Activity* setSrcDataSize(size_t size)
   {
     return set_src_data_size(size);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data_size()") Activity* setSrcDataSize(size_t size)
   {
     return set_src_data_size(size);
   }
-  /** @deprecated See Comm::set_dst_data() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff)
   {
     return set_dst_data(buff);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff)
   {
     return set_dst_data(buff);
   }
-  /** @deprecated See Comm::set_dst_data() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff, size_t size)
   {
     return set_dst_data(buff, size);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff, size_t size)
   {
     return set_dst_data(buff, size);
   }
-  /** @deprecated See Comm::get_dst_data_size() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_dst_data_size()") size_t getDstDataSize()
   {
     return get_dst_data_size();
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_dst_data_size()") size_t getDstDataSize()
   {
     return get_dst_data_size();
   }
-  /** @deprecated See Comm::get_mailbox() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_mailbox()") MailboxPtr getMailbox() { return get_mailbox(); }
 #endif
 
   XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_mailbox()") MailboxPtr getMailbox() { return get_mailbox(); }
 #endif
 
index 94e64f3..18f0028 100644 (file)
@@ -33,7 +33,7 @@ public:
 
   Activity* start() override;
   Activity* wait() override;
 
   Activity* start() override;
   Activity* wait() override;
-  Activity* wait(double timeout) override;
+  Activity* wait_for(double timeout) override;
   Activity* cancel() override;
   bool test() override;
 
   Activity* cancel() override;
   bool test() override;
 
@@ -47,23 +47,21 @@ public:
   double get_remaining() override;
   double get_remaining_ratio();
 
   double get_remaining() override;
   double get_remaining_ratio();
 
+#ifndef DOXYGEN
   //////////////// Deprecated functions
   //////////////// Deprecated functions
-  /** @deprecated See Exec::set_priority() */
+  XBT_ATTRIB_DEPRECATED_v324("Please use Exec::wait_for()") void wait(double t) override { wait_for(t); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_priority()") ExecPtr setPriority(double priority)
   {
     return set_priority(priority);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_priority()") ExecPtr setPriority(double priority)
   {
     return set_priority(priority);
   }
-  /** @deprecated See Exec::set_bound() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_bound()") ExecPtr setBound(double bound) { return set_bound(bound); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_bound()") ExecPtr setBound(double bound) { return set_bound(bound); }
-  /** @deprecated See Exec::set_host() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_host()") ExecPtr setHost(Host* host) { return set_host(host); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_host()") ExecPtr setHost(Host* host) { return set_host(host); }
-  /** @deprecated See Exec::get_host() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_host()") Host* getHost() { return get_host(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_host()") Host* getHost() { return get_host(); }
-  /** @deprecated See Exec::get_remaining_ratio() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_remaining_ratio()") double getRemainingRatio()
   {
     return get_remaining_ratio();
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_remaining_ratio()") double getRemainingRatio()
   {
     return get_remaining_ratio();
   }
+#endif
 
 private:
   Host* host_                   = nullptr;
 
 private:
   Host* host_                   = nullptr;
index 2bbdb75..2fb16f1 100644 (file)
@@ -35,13 +35,17 @@ public:
 
   Activity* start() override;
   Activity* wait() override;
 
   Activity* start() override;
   Activity* wait() override;
-  Activity* wait(double timeout) override;
+  Activity* wait_for(double timeout) override;
   Activity* cancel() override;
   bool test() override;
 
   double get_remaining() override;
   sg_size_t get_performed_ioops();
 
   Activity* cancel() override;
   bool test() override;
 
   double get_remaining() override;
   sg_size_t get_performed_ioops();
 
+#ifndef DOXYGEN
+  XBT_ATTRIB_DEPRECATED_v324("Please use Io::wait_for()") void wait(double t) override { wait_for(t); }
+#endif
+
 private:
   sg_size_t size_       = 0;
   sg_storage_t storage_ = nullptr;
 private:
   sg_size_t size_       = 0;
   sg_storage_t storage_ = nullptr;
index 2cdd524..72eadf5 100644 (file)
@@ -104,9 +104,9 @@ sg_size_t MigrationTx::sendMigrationData(sg_size_t size, int stage, int stage2_r
   s4u::Activity* comm = nullptr;
   try {
     if (mig_speed > 0)
   s4u::Activity* comm = nullptr;
   try {
     if (mig_speed > 0)
-      comm = mbox->put_init(msg, size)->set_rate(mig_speed)->wait(timeout);
+      comm = mbox->put_init(msg, size)->set_rate(mig_speed)->wait_for(timeout);
     else
     else
-      comm = mbox->put_async(msg, size)->wait();
+      comm = mbox->put_async(msg, size)->wait_for(timeout);
   } catch (xbt_ex& e) {
     if (comm) {
       sg_size_t remaining = static_cast<sg_size_t>(comm->get_remaining());
   } catch (xbt_ex& e) {
     if (comm) {
       sg_size_t remaining = static_cast<sg_size_t>(comm->get_remaining());
index a5d5e5f..1474137 100644 (file)
@@ -132,7 +132,7 @@ Activity* Comm::start()
 /** @brief Block the calling actor until the communication is finished */
 Activity* Comm::wait()
 {
 /** @brief Block the calling actor until the communication is finished */
 Activity* Comm::wait()
 {
-  return this->wait(-1);
+  return this->wait_for(-1);
 }
 
 /** @brief Block the calling actor until the communication is finished, or until timeout
 }
 
 /** @brief Block the calling actor until the communication is finished, or until timeout
@@ -141,7 +141,7 @@ Activity* Comm::wait()
  *
  * @param timeout the amount of seconds to wait for the comm termination.
  *                Negative values denote infinite wait times. 0 as a timeout returns immediately. */
  *
  * @param timeout the amount of seconds to wait for the comm termination.
  *                Negative values denote infinite wait times. 0 as a timeout returns immediately. */
-Activity* Comm::wait(double timeout)
+Activity* Comm::wait_for(double timeout)
 {
   switch (state_) {
     case State::FINISHED:
 {
   switch (state_) {
     case State::FINISHED:
index c864b65..8250f94 100644 (file)
@@ -40,7 +40,7 @@ Activity* Exec::wait()
   return this;
 }
 
   return this;
 }
 
-Activity* Exec::wait(double timeout)
+Activity* Exec::wait_for(double timeout)
 {
   THROW_UNIMPLEMENTED;
   return this;
 {
   THROW_UNIMPLEMENTED;
   return this;
index c80bd87..25cb012 100644 (file)
@@ -38,7 +38,7 @@ Activity* Io::wait()
   return this;
 }
 
   return this;
 }
 
-Activity* Io::wait(double timeout)
+Activity* Io::wait_for(double timeout)
 {
   THROW_UNIMPLEMENTED;
   return this;
 {
   THROW_UNIMPLEMENTED;
   return this;
index 8156900..bcf0309 100644 (file)
@@ -114,7 +114,7 @@ void Mailbox::put(void* payload, uint64_t simulated_size_in_bytes, double timeou
   c->set_remaining(simulated_size_in_bytes);
   c->set_src_data(payload);
   // c->start() is optional.
   c->set_remaining(simulated_size_in_bytes);
   c->set_src_data(payload);
   // c->start() is optional.
-  c->wait(timeout);
+  c->wait_for(timeout);
 }
 
 s4u::CommPtr Mailbox::get_init()
 }
 
 s4u::CommPtr Mailbox::get_init()
@@ -145,7 +145,7 @@ void* Mailbox::get(double timeout)
   void* res = nullptr;
   CommPtr c = get_init();
   c->set_dst_data(&res, sizeof(res));
   void* res = nullptr;
   CommPtr c = get_init();
   c->set_dst_data(&res, sizeof(res));
-  c->wait(timeout);
+  c->wait_for(timeout);
   return res;
 }
 } // namespace s4u
   return res;
 }
 } // namespace s4u