Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
You don't send a mailbox, but instead put stuff on it
[simgrid.git] / examples / s4u / app-token-ring / s4u_app-token-ring.cpp
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);
     }
   }
 };