Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
You don't send a mailbox, but instead put stuff on it
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 6 Jul 2017 07:39:55 +0000 (09:39 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 6 Jul 2017 07:41:26 +0000 (09:41 +0200)
this_actor::send(mailbox) is now mailbox->put()

16 files changed:
examples/s4u/actions-comm/s4u_actions-comm.cpp
examples/s4u/actor-create/s4u_actor-create.cpp
examples/s4u/app-masterworker/s4u_app-masterworker.cpp
examples/s4u/app-token-ring/s4u_app-token-ring.cpp
examples/s4u/dht-chord/node.cpp
examples/s4u/dht-chord/s4u_dht-chord.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/Mailbox.hpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_mailbox.cpp
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
teshsuite/s4u/comm-waitany/comm-waitany.cpp
teshsuite/s4u/listen_async/listen_async.cpp
teshsuite/s4u/pid/pid.cpp
teshsuite/s4u/storage_client_server/storage_client_server.cpp

index bb7db5d..644f266 100644 (file)
@@ -64,7 +64,7 @@ public:
     simgrid::s4u::MailboxPtr to = simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::name() + "_" + action[2]);
     ACT_DEBUG("Entering Send: %s (size: %g) -- Actor %s on mailbox %s", NAME, size,
               simgrid::s4u::this_actor::name().c_str(), to->name());
-    to->send(payload, size);
+    to->put(payload, size);
     xbt_free(payload);
 
     log_action(action, simgrid::s4u::Engine::getClock() - clock);
@@ -77,7 +77,7 @@ public:
         simgrid::s4u::Mailbox::byName(std::string(action[2]) + "_" + simgrid::s4u::this_actor::name());
 
     ACT_DEBUG("Receiving: %s -- Actor %s on mailbox %s", NAME, simgrid::s4u::this_actor::name().c_str(), from->name());
-    from->recv();
+    from->get();
     log_action(action, simgrid::s4u::Engine::getClock() - clock);
   }
 };
index 857b60a..171935a 100644 (file)
@@ -42,7 +42,7 @@ public:
     XBT_INFO("Hello s4u, I have something to send");
     simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mb42");
 
-    mailbox->send(xbt_strdup(msg.c_str()), msg.size());
+    mailbox->put(xbt_strdup(msg.c_str()), msg.size());
     XBT_INFO("I'm done. See you.");
   }
 };
@@ -74,8 +74,8 @@ public:
   {
     XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->name());
 
-    char* msg1 = static_cast<char*>(mailbox->recv());
-    char* msg2 = static_cast<char*>(mailbox->recv());
+    char* msg1 = static_cast<char*>(mailbox->get());
+    char* msg2 = static_cast<char*>(mailbox->get());
     XBT_INFO("I received '%s' and '%s'", msg1, msg2);
     xbt_free(msg1);
     xbt_free(msg2);
index d6797f7..66c380f 100644 (file)
@@ -42,14 +42,14 @@ public:
 
       /* - Send the task to the @ref worker */
       char* payload = bprintf("%f", comp_size);
-      mailbox->send(payload, comm_size);
+      mailbox->put(payload, comm_size);
     }
 
     XBT_INFO("All tasks have been dispatched. Let's tell everybody the computation is over.");
     for (int i = 0; i < workers_count; i++) {
       /* - Eventually tell all the workers to stop by sending a "finalize" task */
       mailbox = simgrid::s4u::Mailbox::byName(std::string("worker-") + std::to_string(i % workers_count));
-      mailbox->send(xbt_strdup("finalize"), 0);
+      mailbox->put(xbt_strdup("finalize"), 0);
     }
   }
 };
@@ -70,7 +70,7 @@ public:
   void operator()()
   {
     while (1) { /* The worker waits in an infinite loop for tasks sent by the \ref master */
-      char* res = static_cast<char*>(mailbox->recv());
+      char* res = static_cast<char*>(mailbox->get());
       xbt_assert(res != nullptr, "MSG_task_get failed");
 
       if (strcmp(res, "finalize") == 0) { /* - Exit if 'finalize' is received */
index d2c70ea..a5fc167 100644 (file)
@@ -36,15 +36,15 @@ public:
     if (rank == 0) {
       /* The root process (rank 0) first sends the token then waits to receive it back */
       XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->name());
-      neighbor_mailbox->send(xbt_strdup("Token"), task_comm_size);
-      char* res = static_cast<char*>(my_mailbox->recv());
+      neighbor_mailbox->put(xbt_strdup("Token"), task_comm_size);
+      char* res = static_cast<char*>(my_mailbox->get());
       XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
       xbt_free(res);
     } else {
-      char* res = static_cast<char*>(my_mailbox->recv());
+      char* res = static_cast<char*>(my_mailbox->get());
       XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
       XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->name());
-      neighbor_mailbox->send(res, task_comm_size);
+      neighbor_mailbox->put(res, task_comm_size);
     }
   }
 };
index b45d468..79aef92 100644 (file)
@@ -112,7 +112,7 @@ void Node::notifyAndQuit()
 
   XBT_DEBUG("Sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
   try {
-    simgrid::s4u::Mailbox::byName(std::to_string(fingers_[0]))->send(pred_msg, 10, timeout);
+    simgrid::s4u::Mailbox::byName(std::to_string(fingers_[0]))->put(pred_msg, 10, timeout);
   } catch (xbt_ex& e) {
     if (e.category == timeout_error) {
       XBT_DEBUG("Timeout expired when sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
@@ -128,7 +128,7 @@ void Node::notifyAndQuit()
     XBT_DEBUG("Sending a 'SUCCESSOR_LEAVING' to my predecessor %d", pred_id_);
 
     try {
-      simgrid::s4u::Mailbox::byName(std::to_string(pred_id_))->send(succ_msg, 10, timeout);
+      simgrid::s4u::Mailbox::byName(std::to_string(pred_id_))->put(succ_msg, 10, timeout);
     } catch (xbt_ex& e) {
       if (e.category == timeout_error) {
         XBT_DEBUG("Timeout expired when sending a 'SUCCESSOR_LEAVING' to my predecessor %d", pred_id_);
@@ -220,7 +220,7 @@ void Node::checkPredecessor()
 
   XBT_DEBUG("Sending a 'Predecessor Alive' request to my predecessor %d", pred_id_);
   try {
-    mailbox->send(message, 10, timeout);
+    mailbox->put(message, 10, timeout);
   } catch (xbt_ex& e) {
     if (e.category == timeout_error) {
       XBT_DEBUG("Failed to send the 'Predecessor Alive' request to %d", pred_id_);
@@ -231,7 +231,7 @@ void Node::checkPredecessor()
   // receive the answer
   XBT_DEBUG("Sent 'Predecessor Alive' request to %d, waiting for the answer on my mailbox '%s'", pred_id_,
             message->answer_to->name());
-  simgrid::s4u::CommPtr comm = return_mailbox->recv_async(&data);
+  simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
     comm->wait(timeout);
@@ -264,7 +264,7 @@ int Node::remoteGetPredecessor(int ask_to)
   // send a "Get Predecessor" request to ask_to_id
   XBT_DEBUG("Sending a 'Get Predecessor' request to %d", ask_to);
   try {
-    mailbox->send(message, 10, timeout);
+    mailbox->put(message, 10, timeout);
   } catch (xbt_ex& e) {
     if (e.category == timeout_error) {
       XBT_DEBUG("Failed to send the 'Get Predecessor' request to %d", ask_to);
@@ -276,7 +276,7 @@ int Node::remoteGetPredecessor(int ask_to)
   // receive the answer
   XBT_DEBUG("Sent 'Get Predecessor' request to %d, waiting for the answer on my mailbox '%s'", ask_to,
             message->answer_to->name());
-  simgrid::s4u::CommPtr comm = return_mailbox->recv_async(&data);
+  simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
     comm->wait(timeout);
@@ -340,7 +340,7 @@ int Node::remoteFindSuccessor(int ask_to, int id)
   // send a "Find Successor" request to ask_to_id
   XBT_DEBUG("Sending a 'Find Successor' request to %d for id %d", ask_to, id);
   try {
-    mailbox->send(message, 10, timeout);
+    mailbox->put(message, 10, timeout);
   } catch (xbt_ex& e) {
     if (e.category == timeout_error) {
       XBT_DEBUG("Failed to send the 'Find Successor' request to %d for id %d", ask_to, id_);
@@ -350,7 +350,7 @@ int Node::remoteFindSuccessor(int ask_to, int id)
   }
   // receive the answer
   XBT_DEBUG("Sent a 'Find Successor' request to %d for key %d, waiting for the answer", ask_to, id);
-  simgrid::s4u::CommPtr comm = return_mailbox->recv_async(&data);
+  simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
     comm->wait(timeout);
@@ -389,7 +389,7 @@ void Node::remoteNotify(int notify_id, int predecessor_candidate_id)
   // send a "Notify" request to notify_id
   XBT_DEBUG("Sending a 'Notify' request to %d", notify_id);
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(std::to_string(notify_id));
-  mailbox->send_init(message, 10)->detach();
+  mailbox->put_init(message, 10)->detach();
 }
 
 /* This function is called periodically. It checks the immediate successor of the current node. */
@@ -431,14 +431,14 @@ void Node::handleMessage(ChordMessage* message)
       message->answer_id = fingers_[0];
       XBT_DEBUG("Sending back a 'Find Successor Answer' to %s (mailbox %s): the successor of %d is %d",
           message->issuer_host_name.c_str(), message->answer_to->name(), message->request_id, message->answer_id);
-      message->answer_to->send_init(message, 10)->detach();
+      message->answer_to->put_init(message, 10)->detach();
     } else {
       // otherwise, forward the request to the closest preceding finger in my table
       int closest = closestPrecedingFinger(message->request_id);
       XBT_DEBUG("Forwarding the 'Find Successor' request for id %d to my closest preceding finger %d",
           message->request_id, closest);
       simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(std::to_string(closest));
-      mailbox->send_init(message, 10)->detach();
+      mailbox->put_init(message, 10)->detach();
     }
     break;
 
@@ -448,7 +448,7 @@ void Node::handleMessage(ChordMessage* message)
     message->answer_id = pred_id_;
     XBT_DEBUG("Sending back a 'Get Predecessor Answer' to %s via mailbox '%s': my predecessor is %d",
         message->issuer_host_name.c_str(), message->answer_to->name(), message->answer_id);
-    message->answer_to->send_init(message, 10)->detach();
+    message->answer_to->put_init(message, 10)->detach();
     break;
 
   case NOTIFY:
@@ -486,7 +486,7 @@ void Node::handleMessage(ChordMessage* message)
     message->type = PREDECESSOR_ALIVE_ANSWER;
     XBT_DEBUG("Sending back a 'Predecessor Alive Answer' to %s (mailbox %s)",
         message->issuer_host_name.c_str(), message->answer_to->name());
-    message->answer_to->send_init(message, 10)->detach();
+    message->answer_to->put_init(message, 10)->detach();
     break;
 
   default:
index 209aabc..77981df 100644 (file)
@@ -128,7 +128,7 @@ public:
     simgrid::s4u::CommPtr comm_receive = nullptr;
     while ((now < (start_time_ + deadline_)) && now < MAX_SIMULATION_TIME) {
       if (comm_receive == nullptr)
-        comm_receive = mailbox_->recv_async(&data);
+        comm_receive = mailbox_->get_async(&data);
       while ((now < (start_time_ + deadline_)) && now < MAX_SIMULATION_TIME && not comm_receive->test()) {
         // no task was received: make some periodic calls
         if (now >= next_stabilize_date) {
index c205e6c..eec45c1 100644 (file)
@@ -306,8 +306,8 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
    *
    * See \ref Comm for the full communication API (including non blocking communications).
    */
-  XBT_PUBLIC(void*) XBT_ATTRIB_DEPRECATED("Please use Mailbox::recv") recv(MailboxPtr chan);                 // 3.17
-  XBT_PUBLIC(void*) XBT_ATTRIB_DEPRECATED("Please use Mailbox::recv") recv(MailboxPtr chan, double timeout); // 3.17
+  XBT_PUBLIC(void*) XBT_ATTRIB_DEPRECATED("Please use Mailbox::get") recv(MailboxPtr chan);                 // 3.17
+  XBT_PUBLIC(void*) XBT_ATTRIB_DEPRECATED("Please use Mailbox::get") recv(MailboxPtr chan, double timeout); // 3.17
   XBT_PUBLIC(CommPtr)
   XBT_ATTRIB_DEPRECATED("Please use Mailbox::recv_async") irecv(MailboxPtr chan, void** data); // 3.17
 
@@ -316,13 +316,13 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
    * See \ref Comm for the full communication API (including non blocking communications).
   */
   XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED("Please use Mailbox::send") send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
+  XBT_ATTRIB_DEPRECATED("Please use Mailbox::put") send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
   XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED("Please use Mailbox::send")
+  XBT_ATTRIB_DEPRECATED("Please use Mailbox::put")
   send(MailboxPtr chan, void* payload, double simulatedSize, double timeout); // 3.17
 
   XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED("Please use Mailbox::send_async") isend(MailboxPtr chan, void* payload, double simulatedSize);
+  XBT_ATTRIB_DEPRECATED("Please use Mailbox::put_async") isend(MailboxPtr chan, void* payload, double simulatedSize);
 
   /** @brief Returns the actor ID of the current actor (same as pid). */
   XBT_PUBLIC(aid_t) pid();
index 2032de7..16682aa 100644 (file)
@@ -55,34 +55,34 @@ public:
     return idx;
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::send_init") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_init") // 3.17
       send_init(MailboxPtr dest)
   {
-    return dest->send_init();
+    return dest->put_init();
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::send_init") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_init") // 3.17
       send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
-    return dest->send_init(data, simulatedByteAmount);
+    return dest->put_init(data, simulatedByteAmount);
   }
   /** Creates and start an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::send_async") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_async") // 3.17
       send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
-    return dest->send_async(data, simulatedByteAmount);
+    return dest->put_async(data, simulatedByteAmount);
   }
   /** Creates (but don't start) an async recv onto the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::recv_init") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::get_init") // 3.17
       recv_init(MailboxPtr from)
   {
-    return from->recv_init();
+    return from->get_init();
   }
   /** Creates and start an async recv to the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::recv_async") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::get_async") // 3.17
       recv_async(MailboxPtr from, void** data)
   {
-    return from->recv_async(data);
+    return from->get_async(data);
   }
 
   void start() override;
index 1abc9b2..42e08f7 100644 (file)
@@ -149,27 +149,27 @@ public:
   /** Return the actor declared as permanent receiver, or nullptr if none **/
   ActorPtr receiver();
 
-  /** Creates (but don't start) an async send to that mailbox */
-  CommPtr send_init();
-  /** Creates (but don't start) an async send to that mailbox */
-  CommPtr send_init(void* data, int simulatedByteAmount);
-  /** Creates and start an async send to that mailbox */
-  CommPtr send_async(void* data, int simulatedByteAmount);
-
-  /** Blocking send */
-  void send(void* payload, double simulatedSize);
-  /** Blocking send with timeout */
-  void send(void* payload, double simulatedSize, double timeout);
-
-  /** Creates (but don't start) an async recv onto the mailbox @p from */
-  CommPtr recv_init();
-  /** Creates and start an async recv to the mailbox @p from */
-  CommPtr recv_async(void** data);
-
-  /** Blocking receive */
-  void* recv();
-  /** Blocking receive with timeout */
-  void* recv(double timeout);
+  /** Creates (but don't start) an emission to that mailbox */
+  CommPtr put_init();
+  /** Creates (but don't start) an emission to that mailbox */
+  CommPtr put_init(void* data, int simulatedByteAmount);
+  /** Creates and start an async emission to that mailbox */
+  CommPtr put_async(void* data, int simulatedByteAmount);
+
+  /** Blocking put */
+  void put(void* payload, double simulatedSize);
+  /** Blocking put with timeout */
+  void put(void* payload, double simulatedSize, double timeout);
+
+  /** Creates (but don't start) a reception onto that mailbox */
+  CommPtr get_init();
+  /** Creates and start an async reception to that mailbox */
+  CommPtr get_async(void** data);
+
+  /** Blocking reception */
+  void* get();
+  /** Blocking reception with timeout */
+  void* get(double timeout);
 };
 
 }} // namespace simgrid::s4u
index 8d05ad2..342bfb5 100644 (file)
@@ -220,32 +220,32 @@ e_smx_state_t execute(double flops) {
 }
 
 void* recv(MailboxPtr chan) {
-  return chan->recv();
+  return chan->get();
 }
 
 void* recv(MailboxPtr chan, double timeout)
 {
-  return chan->recv(timeout);
+  return chan->get(timeout);
 }
 
 void send(MailboxPtr chan, void* payload, double simulatedSize)
 {
-  chan->send(payload, simulatedSize);
+  chan->put(payload, simulatedSize);
 }
 
 void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
 {
-  chan->send(payload, simulatedSize, timeout);
+  chan->put(payload, simulatedSize, timeout);
 }
 
 CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize)
 {
-  return chan->send_async(payload, simulatedSize);
+  return chan->put_async(payload, simulatedSize);
 }
 
 CommPtr irecv(MailboxPtr chan, void** data)
 {
-  return chan->recv_async(data);
+  return chan->get_async(data);
 }
 
 aid_t pid()
index 9642de0..f514ce5 100644 (file)
@@ -64,71 +64,71 @@ ActorPtr Mailbox::receiver() {
   return pimpl_->permanent_receiver->iface();
 }
 
-CommPtr Mailbox::send_init()
+CommPtr Mailbox::put_init()
 {
   CommPtr res   = CommPtr(new s4u::Comm());
   res->sender_  = SIMIX_process_self();
   res->mailbox_ = this;
   return res;
 }
-s4u::CommPtr Mailbox::send_init(void* data, int simulatedSize)
+s4u::CommPtr Mailbox::put_init(void* data, int simulatedSize)
 {
-  s4u::CommPtr res = send_init();
+  s4u::CommPtr res = put_init();
   res->setRemains(simulatedSize);
   res->srcBuff_     = data;
   res->srcBuffSize_ = sizeof(void*);
   return res;
 }
-s4u::CommPtr Mailbox::send_async(void* data, int simulatedSize)
+s4u::CommPtr Mailbox::put_async(void* data, int simulatedSize)
 {
-  s4u::CommPtr res = send_init(data, simulatedSize);
+  s4u::CommPtr res = put_init(data, simulatedSize);
   res->start();
   return res;
 }
-void Mailbox::send(void* payload, double simulatedSize)
+void Mailbox::put(void* payload, double simulatedSize)
 {
-  CommPtr c = send_init();
+  CommPtr c = put_init();
   c->setRemains(simulatedSize);
   c->setSrcData(payload);
   c->wait();
 }
 /** Blocking send with timeout */
-void Mailbox::send(void* payload, double simulatedSize, double timeout)
+void Mailbox::put(void* payload, double simulatedSize, double timeout)
 {
-  CommPtr c = send_init();
+  CommPtr c = put_init();
   c->setRemains(simulatedSize);
   c->setSrcData(payload);
   // c->start() is optional.
   c->wait(timeout);
 }
 
-s4u::CommPtr Mailbox::recv_init()
+s4u::CommPtr Mailbox::get_init()
 {
   CommPtr res    = CommPtr(new s4u::Comm());
   res->receiver_ = SIMIX_process_self();
   res->mailbox_  = this;
   return res;
 }
-s4u::CommPtr Mailbox::recv_async(void** data)
+s4u::CommPtr Mailbox::get_async(void** data)
 {
-  s4u::CommPtr res = recv_init();
+  s4u::CommPtr res = get_init();
   res->setDstData(data, sizeof(*data));
   res->start();
   return res;
 }
 
-void* Mailbox::recv()
+void* Mailbox::get()
 {
   void* res = nullptr;
-  CommPtr c = recv_init();
+  CommPtr c = get_init();
   c->setDstData(&res, sizeof(res));
   c->wait();
   return res;
 }
-void* Mailbox::recv(double timeout)
+void* Mailbox::get(double timeout)
 {
   void* res = nullptr;
-  CommPtr c = recv_init();
+  CommPtr c = get_init();
   c->setDstData(&res, sizeof(res));
   c->wait(timeout);
   return res;
index 84141ec..6827ed4 100644 (file)
@@ -56,32 +56,32 @@ static void sender(std::vector<std::string> args)
     switch (args[0][test - 1]) {
       case 'r':
         XBT_INFO("Test %d: r (regular send)", test);
-        mbox->send((void*)mboxName, 42.0);
+        mbox->put((void*)mboxName, 42.0);
         break;
       case 'R':
         XBT_INFO("Test %d: R (sleep + regular send)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
-        mbox->send((void*)mboxName, 42.0);
+        mbox->put((void*)mboxName, 42.0);
         break;
 
       case 'i':
         XBT_INFO("Test %d: i (asynchronous isend)", test);
-        mbox->send_async((void*)mboxName, 42.0)->wait();
+        mbox->put_async((void*)mboxName, 42.0)->wait();
         break;
       case 'I':
         XBT_INFO("Test %d: I (sleep + isend)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
-        mbox->send_async((void*)mboxName, 42.0)->wait();
+        mbox->put_async((void*)mboxName, 42.0)->wait();
         break;
 
       case 'd':
         XBT_INFO("Test %d: d (detached send)", test);
-        mbox->send_init((void*)mboxName, 42.0)->detach();
+        mbox->put_init((void*)mboxName, 42.0)->detach();
         break;
       case 'D':
         XBT_INFO("Test %d: D (sleep + detached send)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
-        mbox->send_init((void*)mboxName, 42.0)->detach();
+        mbox->put_init((void*)mboxName, 42.0)->detach();
         break;
       default:
         xbt_die("Unknown sender spec for test %d: '%c'", test, args[0][test - 1]);
@@ -104,44 +104,44 @@ static void receiver(std::vector<std::string> args)
     switch (args[0][test - 1]) {
       case 'r':
         XBT_INFO("Test %d: r (regular receive)", test);
-        received = mbox->recv();
+        received = mbox->get();
         break;
       case 'R':
         XBT_INFO("Test %d: R (sleep + regular receive)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
-        received = mbox->recv();
+        received = mbox->get();
         break;
 
       case 'i':
         XBT_INFO("Test %d: i (asynchronous irecv)", test);
-        mbox->recv_async(&received)->wait();
+        mbox->get_async(&received)->wait();
         break;
       case 'I':
         XBT_INFO("Test %d: I (sleep + asynchronous irecv)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
-        mbox->recv_async(&received)->wait();
+        mbox->get_async(&received)->wait();
         break;
       case 'p':
         XBT_INFO("Test %d: p (regular receive on permanent mailbox)", test);
         mbox->setReceiver(Actor::self());
-        received = mbox->recv();
+        received = mbox->get();
         break;
       case 'P':
         XBT_INFO("Test %d: P (sleep + regular receive on permanent mailbox)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->setReceiver(Actor::self());
-        received = mbox->recv();
+        received = mbox->get();
         break;
       case 'j':
         XBT_INFO("Test %d: j (irecv on permanent mailbox)", test);
         mbox->setReceiver(Actor::self());
-        mbox->recv_async(&received)->wait();
+        mbox->get_async(&received)->wait();
         break;
       case 'J':
         XBT_INFO("Test %d: J (sleep + irecv on permanent mailbox)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->setReceiver(Actor::self());
-        mbox->recv_async(&received)->wait();
+        mbox->get_async(&received)->wait();
         break;
       default:
         xbt_die("Unknown receiver spec for test %d: '%c'", test, args[0][test - 1]);
index a5e1d5c..6b96583 100644 (file)
@@ -21,7 +21,7 @@ static void receiver()
   XBT_INFO("Placing %d asynchronous recv requests", NUM_COMMS);
   void* data;
   for (int i = 0; i < NUM_COMMS; i++) {
-    simgrid::s4u::CommPtr comm = mymailbox->recv_async(&data);
+    simgrid::s4u::CommPtr comm = mymailbox->get_async(&data);
     pending_comms.push_back(comm);
   }
 
@@ -44,7 +44,7 @@ static void sender()
 
   for (int i = 0; i < NUM_COMMS; i++) {
     XBT_INFO("Sending a message to the receiver");
-    theirmailbox->send(&data, 4);
+    theirmailbox->put(&data, 4);
     XBT_INFO("Sleeping for 1000 seconds");
     simgrid::s4u::this_actor::sleep_for(1000.0);
   }
index cfd9027..7e07dc9 100644 (file)
@@ -17,11 +17,11 @@ static void server()
 {
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mailbox");
 
-  simgrid::s4u::CommPtr sendComm = mailbox->send_async(xbt_strdup("Some data"), 0);
+  simgrid::s4u::CommPtr sendComm = mailbox->put_async(xbt_strdup("Some data"), 0);
 
   xbt_assert(mailbox->listen()); // True (1)
   XBT_INFO("Task listen works on regular mailboxes");
-  char* res = static_cast<char*>(mailbox->recv());
+  char* res = static_cast<char*>(mailbox->get());
 
   xbt_assert(not strcmp("Some data", res), "Data received: %s", res);
   XBT_INFO("Data successfully received from regular mailbox");
@@ -31,12 +31,12 @@ static void server()
   simgrid::s4u::MailboxPtr mailbox2 = simgrid::s4u::Mailbox::byName("mailbox2");
   mailbox2->setReceiver(simgrid::s4u::Actor::self());
 
-  mailbox2->send_init(xbt_strdup("More data"), 0)->detach();
+  mailbox2->put_init(xbt_strdup("More data"), 0)->detach();
 
   xbt_assert(mailbox2->listen()); // used to break.
   XBT_INFO("Task listen works on asynchronous mailboxes");
 
-  res = static_cast<char*>(mailbox2->recv());
+  res = static_cast<char*>(mailbox2->get());
   xbt_assert(not strcmp("More data", res));
   xbt_free(res);
 
index d92d7d5..2624b07 100644 (file)
@@ -21,7 +21,7 @@ static void sendpid()
   simgrid::s4u::this_actor::onExit((int_f_pvoid_pvoid_t)my_onexit, &pid);
 
   XBT_INFO("Sending pid of \"%d\".", pid);
-  mailbox->send(&pid, comm_size);
+  mailbox->put(&pid, comm_size);
   XBT_INFO("Send of pid \"%d\" done.", pid);
 
   simgrid::s4u::this_actor::suspend();
@@ -31,7 +31,7 @@ static void killall()
 {
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mailbox");
   for (int i = 0; i < 3; i++) {
-    int* pid = static_cast<int*>(mailbox->recv());
+    int* pid = static_cast<int*>(mailbox->get());
     XBT_INFO("Killing process \"%d\".", *pid);
     simgrid::s4u::Actor::byPid(*pid)->kill();
   }
index 85eabc7..569b8cc 100644 (file)
@@ -56,7 +56,7 @@ static void hsm_put(const char* remote_host, const char* src, const char* dest)
   XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::name().c_str(), read_size, remote_host);
   char* payload                    = bprintf("%s %llu", dest, read_size);
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(remote_host);
-  mailbox->send(payload, static_cast<double>(read_size));
+  mailbox->put(payload, static_cast<double>(read_size));
   simgrid::s4u::this_actor::sleep_for(.4);
 }
 
@@ -130,7 +130,7 @@ static void client()
   hsm_put("alice", "/home/doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c", "c:\\Windows\\tata.c");
 
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("alice");
-  mailbox->send(xbt_strdup("finalize"), 0);
+  mailbox->put(xbt_strdup("finalize"), 0);
 
   get_set_storage_data("Disk1");
 }
@@ -142,7 +142,7 @@ static void server()
 
   XBT_INFO("Server waiting for transfers ...");
   while (1) {
-    char* msg = static_cast<char*>(mailbox->recv());
+    char* msg = static_cast<char*>(mailbox->get());
     if (not strcmp(msg, "finalize")) { // Shutdown ...
       xbt_free(msg);
       break;