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());
- simgrid::s4u::this_actor::send(to, payload, size);
+ to->send(payload, size);
xbt_free(payload);
log_action(action, simgrid::s4u::Engine::getClock() - clock);
XBT_INFO("Hello s4u, I have something to send");
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mb42");
- simgrid::s4u::this_actor::send(mailbox, xbt_strdup(msg.c_str()), msg.size());
+ mailbox->send(xbt_strdup(msg.c_str()), msg.size());
XBT_INFO("I'm done. See you.");
}
};
{
XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->name());
- char* msg1 = static_cast<char*>(simgrid::s4u::this_actor::recv(mailbox));
- char* msg2 = static_cast<char*>(simgrid::s4u::this_actor::recv(mailbox));
+ char* msg1 = static_cast<char*>(mailbox->recv());
+ char* msg2 = static_cast<char*>(mailbox->recv());
XBT_INFO("I received '%s' and '%s'", msg1, msg2);
xbt_free(msg1);
xbt_free(msg2);
/* - Send the task to the @ref worker */
char* payload = bprintf("%f", comp_size);
- simgrid::s4u::this_actor::send(mailbox, payload, comm_size);
+ mailbox->send(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));
- simgrid::s4u::this_actor::send(mailbox, xbt_strdup("finalize"), 0);
+ mailbox->send(xbt_strdup("finalize"), 0);
}
}
};
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());
- simgrid::s4u::this_actor::send(neighbor_mailbox, xbt_strdup("Token"), task_comm_size);
+ neighbor_mailbox->send(xbt_strdup("Token"), task_comm_size);
char* res = static_cast<char*>(simgrid::s4u::this_actor::recv(my_mailbox));
XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
xbt_free(res);
char* res = static_cast<char*>(simgrid::s4u::this_actor::recv(my_mailbox));
XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->name());
- simgrid::s4u::this_actor::send(neighbor_mailbox, res, task_comm_size);
+ neighbor_mailbox->send(res, task_comm_size);
}
}
};
XBT_DEBUG("Sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
try {
- simgrid::s4u::this_actor::send(simgrid::s4u::Mailbox::byName(std::to_string(fingers_[0])), pred_msg, 10, timeout);
+ simgrid::s4u::Mailbox::byName(std::to_string(fingers_[0]))->send(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]);
XBT_DEBUG("Sending a 'SUCCESSOR_LEAVING' to my predecessor %d", pred_id_);
try {
- simgrid::s4u::this_actor::send(simgrid::s4u::Mailbox::byName(std::to_string(pred_id_)), succ_msg, 10, timeout);
+ simgrid::s4u::Mailbox::byName(std::to_string(pred_id_))->send(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_);
XBT_DEBUG("Sending a 'Predecessor Alive' request to my predecessor %d", pred_id_);
try {
- simgrid::s4u::this_actor::send(mailbox, message, 10, timeout);
+ mailbox->send(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_);
// 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 = simgrid::s4u::this_actor::irecv(return_mailbox, &data);
+ simgrid::s4u::CommPtr comm = return_mailbox->recv_async(&data);
try {
comm->wait(timeout);
// send a "Get Predecessor" request to ask_to_id
XBT_DEBUG("Sending a 'Get Predecessor' request to %d", ask_to);
try {
- simgrid::s4u::this_actor::send(mailbox, message, 10, timeout);
+ mailbox->send(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);
// 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 = simgrid::s4u::this_actor::irecv(return_mailbox, &data);
+ simgrid::s4u::CommPtr comm = return_mailbox->recv_async(&data);
try {
comm->wait(timeout);
// 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 {
- simgrid::s4u::this_actor::send(mailbox, message, 10, timeout);
+ mailbox->send(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_);
}
// 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 = simgrid::s4u::this_actor::irecv(return_mailbox, &data);
+ simgrid::s4u::CommPtr comm = return_mailbox->recv_async(&data);
try {
comm->wait(timeout);
// 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));
- simgrid::s4u::this_actor::isend(mailbox, message, 10)->detach();
+ mailbox->send_init(message, 10)->detach();
}
/* This function is called periodically. It checks the immediate successor of the current node. */
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);
- simgrid::s4u::this_actor::isend(message->answer_to, message, 10)->detach();
+ message->answer_to->send_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));
- simgrid::s4u::this_actor::isend(mailbox, message, 10)->detach();
+ mailbox->send_init(message, 10)->detach();
}
break;
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);
- simgrid::s4u::this_actor::isend(message->answer_to, message, 10)->detach();
+ message->answer_to->send_init(message, 10)->detach();
break;
case NOTIFY:
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());
- simgrid::s4u::this_actor::isend(message->answer_to, message, 10)->detach();
+ message->answer_to->send_init(message, 10)->detach();
break;
default:
simgrid::s4u::CommPtr comm_receive = nullptr;
while ((now < (start_time_ + deadline_)) && now < MAX_SIMULATION_TIME) {
if (comm_receive == nullptr)
- comm_receive = simgrid::s4u::this_actor::irecv(mailbox_, &data);
+ comm_receive = mailbox_->recv_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) {
*
* See \ref Comm for the full communication API (including non blocking communications).
*/
- XBT_PUBLIC(void*) recv(MailboxPtr chan);
- XBT_PUBLIC(void*) recv(MailboxPtr chan, double timeout);
- XBT_PUBLIC(CommPtr) irecv(MailboxPtr chan, void** data);
+ 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(CommPtr)
+ XBT_ATTRIB_DEPRECATED("Please use Mailbox::recv_async") irecv(MailboxPtr chan, void** data); // 3.17
/** Block the actor until it delivers a message of the given simulated size to the given mailbox
*
* See \ref Comm for the full communication API (including non blocking communications).
*/
- XBT_PUBLIC(void) send(MailboxPtr chan, void* payload, double simulatedSize);
- XBT_PUBLIC(void) send(MailboxPtr chan, void* payload, double simulatedSize, double timeout);
-
- XBT_PUBLIC(CommPtr) isend(MailboxPtr chan, void* payload, double simulatedSize);
+ XBT_PUBLIC(void)
+ XBT_ATTRIB_DEPRECATED("Please use Mailbox::send") send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
+ XBT_PUBLIC(void)
+ XBT_ATTRIB_DEPRECATED("Please use Mailbox::send")
+ 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);
/** @brief Returns the actor ID of the current actor (same as pid). */
XBT_PUBLIC(aid_t) pid();
#include <simgrid/forward.h>
#include <simgrid/s4u/Activity.hpp>
+#include <simgrid/s4u/Mailbox.hpp> // DEPRECATED 3.17
#include <simgrid/s4u/forward.hpp>
#include <vector>
public:
friend void intrusive_ptr_release(simgrid::s4u::Comm * c);
friend void intrusive_ptr_add_ref(simgrid::s4u::Comm * c);
+ friend Mailbox; // Factory of comms
virtual ~Comm();
return idx;
}
/** Creates (but don't start) an async send to the mailbox @p dest */
- static CommPtr send_init(MailboxPtr dest);
+ static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::send_init") // 3.17
+ send_init(MailboxPtr dest)
+ {
+ return dest->send_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
+ send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
+ {
+ return dest->send_init(data, simulatedByteAmount);
+ }
/** Creates and start an async send to the mailbox @p dest */
- static CommPtr send_async(MailboxPtr dest, void* data, int simulatedByteAmount);
+ static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::send_async") // 3.17
+ send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
+ {
+ return dest->send_async(data, simulatedByteAmount);
+ }
/** Creates (but don't start) an async recv onto the mailbox @p from */
- static CommPtr recv_init(MailboxPtr from);
+ static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::recv_init") // 3.17
+ recv_init(MailboxPtr from)
+ {
+ return from->recv_init();
+ }
/** Creates and start an async recv to the mailbox @p from */
- static CommPtr recv_async(MailboxPtr from, void** data);
+ static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::recv_async") // 3.17
+ recv_async(MailboxPtr from, void** data)
+ {
+ return from->recv_async(data);
+ }
void start() override;
void wait() override;
/** 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);
};
}} // namespace simgrid::s4u
}
void* recv(MailboxPtr chan) {
- void *res = nullptr;
- CommPtr c = Comm::recv_init(chan);
- c->setDstData(&res, sizeof(res));
- c->wait();
- return res;
+ return chan->recv();
}
void* recv(MailboxPtr chan, double timeout)
{
- void* res = nullptr;
- CommPtr c = Comm::recv_init(chan);
- c->setDstData(&res, sizeof(res));
- c->wait(timeout);
- return res;
+ return chan->recv(timeout);
}
void send(MailboxPtr chan, void* payload, double simulatedSize)
{
- CommPtr c = Comm::send_init(chan);
- c->setRemains(simulatedSize);
- c->setSrcData(payload);
- // c->start() is optional.
- c->wait();
+ chan->send(payload, simulatedSize);
}
void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
{
- CommPtr c = Comm::send_init(chan);
- c->setRemains(simulatedSize);
- c->setSrcData(payload);
- // c->start() is optional.
- c->wait(timeout);
+ chan->send(payload, simulatedSize, timeout);
}
CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize)
{
- return Comm::send_async(chan, payload, simulatedSize);
+ return chan->send_async(payload, simulatedSize);
}
CommPtr irecv(MailboxPtr chan, void** data)
{
- return Comm::recv_async(chan, data);
+ return chan->recv_async(data);
}
aid_t pid()
}
}
-s4u::CommPtr Comm::send_init(s4u::MailboxPtr chan)
-{
- CommPtr res = CommPtr(new s4u::Comm());
- res->sender_ = SIMIX_process_self();
- res->mailbox_ = chan;
- return res;
-}
-
-s4u::CommPtr Comm::recv_init(s4u::MailboxPtr chan)
-{
- CommPtr res = CommPtr(new s4u::Comm());
- res->receiver_ = SIMIX_process_self();
- res->mailbox_ = chan;
- return res;
-}
-
void Comm::setRate(double rate) {
xbt_assert(state_==inited);
rate_ = rate;
xbt_assert(state_ == inited, "You cannot detach communications once they are started.");
xbt_assert(srcBuff_ != nullptr && srcBuffSize_ != 0, "You can only detach sends, not recvs");
detached_ = true;
-}
-
-s4u::CommPtr Comm::send_async(MailboxPtr dest, void* data, int simulatedSize)
-{
- s4u::CommPtr res = CommPtr(s4u::Comm::send_init(dest));
- res->setRemains(simulatedSize);
- res->srcBuff_ = data;
- res->srcBuffSize_ = sizeof(void*);
- res->start();
- return res;
-}
-
-s4u::CommPtr Comm::recv_async(MailboxPtr dest, void** data)
-{
- s4u::CommPtr res = CommPtr(s4u::Comm::recv_init(dest));
- res->setDstData(data, sizeof(*data));
- res->start();
- return res;
+ start();
}
void Comm::cancel()
-/* Copyright (c) 2006-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "xbt/log.h"
+#include "simgrid/s4u/Comm.hpp"
+#include "simgrid/s4u/Mailbox.hpp"
#include "src/msg/msg_private.h"
#include "src/simix/ActorImpl.hpp"
#include "src/simix/smx_network_private.h"
-#include "simgrid/s4u/Mailbox.hpp"
+#include "xbt/log.h"
XBT_LOG_EXTERNAL_CATEGORY(s4u);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_channel,s4u,"S4U Communication Mailboxes");
return pimpl_->permanent_receiver->iface();
}
+CommPtr Mailbox::send_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 res = send_init();
+ res->setRemains(simulatedSize);
+ res->srcBuff_ = data;
+ res->srcBuffSize_ = sizeof(void*);
+ return res;
+}
+s4u::CommPtr Mailbox::send_async(void* data, int simulatedSize)
+{
+ s4u::CommPtr res = send_init(data, simulatedSize);
+ res->start();
+ return res;
+}
+void Mailbox::send(void* payload, double simulatedSize)
+{
+ CommPtr c = send_init();
+ c->setRemains(simulatedSize);
+ c->setSrcData(payload);
+ c->wait();
+}
+/** Blocking send with timeout */
+void Mailbox::send(void* payload, double simulatedSize, double timeout)
+{
+ CommPtr c = send_init();
+ c->setRemains(simulatedSize);
+ c->setSrcData(payload);
+ // c->start() is optional.
+ c->wait(timeout);
+}
+
+s4u::CommPtr Mailbox::recv_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 res = recv_init();
+ res->setDstData(data, sizeof(*data));
+ res->start();
+ return res;
+}
+
+void* Mailbox::recv()
+{
+ void* res = nullptr;
+ CommPtr c = recv_init();
+ c->setDstData(&res, sizeof(res));
+ c->wait();
+ return res;
+}
+void* Mailbox::recv(double timeout)
+{
+ void* res = nullptr;
+ CommPtr c = recv_init();
+ c->setDstData(&res, sizeof(res));
+ c->wait(timeout);
+ return res;
+}
}
}
switch (args[0][test - 1]) {
case 'r':
XBT_INFO("Test %d: r (regular send)", test);
- simgrid::s4u::this_actor::send(mbox, (void*)mboxName, 42.0);
+ mbox->send((void*)mboxName, 42.0);
break;
case 'R':
XBT_INFO("Test %d: R (sleep + regular send)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- simgrid::s4u::this_actor::send(mbox, (void*)mboxName, 42.0);
+ mbox->send((void*)mboxName, 42.0);
break;
case 'i':
XBT_INFO("Test %d: i (asynchronous isend)", test);
- simgrid::s4u::this_actor::isend(mbox, (void*)mboxName, 42.0)->wait();
+ mbox->send_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);
- simgrid::s4u::this_actor::isend(mbox, (void*)mboxName, 42.0)->wait();
+ mbox->send_async((void*)mboxName, 42.0)->wait();
break;
case 'd':
XBT_INFO("Test %d: d (detached send)", test);
- simgrid::s4u::this_actor::isend(mbox, (void*)mboxName, 42.0)->detach();
+ mbox->send_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);
- simgrid::s4u::this_actor::isend(mbox, (void*)mboxName, 42.0)->detach();
+ mbox->send_init((void*)mboxName, 42.0)->detach();
break;
default:
xbt_die("Unknown sender spec for test %d: '%c'", test, args[0][test - 1]);
case 'R':
XBT_INFO("Test %d: R (sleep + regular receive)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- received = simgrid::s4u::this_actor::recv(mbox);
+ received = mbox->recv();
break;
case 'i':
XBT_INFO("Test %d: i (asynchronous irecv)", test);
- simgrid::s4u::this_actor::irecv(mbox, &received)->wait();
+ mbox->recv_async(&received)->wait();
break;
case 'I':
XBT_INFO("Test %d: I (sleep + asynchronous irecv)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- simgrid::s4u::this_actor::irecv(mbox, &received)->wait();
+ mbox->recv_async(&received)->wait();
break;
case 'p':
XBT_INFO("Test %d: p (regular receive on permanent mailbox)", test);
mbox->setReceiver(Actor::self());
- received = simgrid::s4u::this_actor::recv(mbox);
+ received = mbox->recv();
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 = simgrid::s4u::this_actor::recv(mbox);
+ received = mbox->recv();
break;
case 'j':
XBT_INFO("Test %d: j (irecv on permanent mailbox)", test);
mbox->setReceiver(Actor::self());
- simgrid::s4u::this_actor::irecv(mbox, &received)->wait();
+ mbox->recv_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());
- simgrid::s4u::this_actor::irecv(mbox, &received)->wait();
+ mbox->recv_async(&received)->wait();
break;
default:
xbt_die("Unknown receiver spec for test %d: '%c'", test, args[0][test - 1]);
XBT_INFO("Placing %d asynchronous recv requests", NUM_COMMS);
void* data;
for (int i = 0; i < NUM_COMMS; i++) {
- simgrid::s4u::CommPtr comm = simgrid::s4u::Comm::recv_async(mymailbox, &data);
+ simgrid::s4u::CommPtr comm = mymailbox->recv_async(&data);
pending_comms.push_back(comm);
}
for (int i = 0; i < NUM_COMMS; i++) {
XBT_INFO("Sending a message to the receiver");
- simgrid::s4u::this_actor::send(theirmailbox, &data, 4);
+ theirmailbox->send(&data, 4);
XBT_INFO("Sleeping for 1000 seconds");
simgrid::s4u::this_actor::sleep_for(1000.0);
}
{
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mailbox");
- simgrid::s4u::CommPtr sendComm = simgrid::s4u::this_actor::isend(mailbox, xbt_strdup("Some data"), 0);
+ simgrid::s4u::CommPtr sendComm = mailbox->send_async(xbt_strdup("Some data"), 0);
xbt_assert(mailbox->listen()); // True (1)
XBT_INFO("Task listen works on regular mailboxes");
simgrid::s4u::MailboxPtr mailbox2 = simgrid::s4u::Mailbox::byName("mailbox2");
mailbox2->setReceiver(simgrid::s4u::Actor::self());
- simgrid::s4u::this_actor::isend(mailbox2, xbt_strdup("More data"), 0)->detach();
+ mailbox2->send_init(xbt_strdup("More data"), 0)->detach();
xbt_assert(mailbox2->listen()); // used to break.
XBT_INFO("Task listen works on asynchronous mailboxes");
simgrid::s4u::this_actor::onExit((int_f_pvoid_pvoid_t)my_onexit, &pid);
XBT_INFO("Sending pid of \"%d\".", pid);
- simgrid::s4u::this_actor::send(mailbox, &pid, comm_size);
+ mailbox->send(&pid, comm_size);
XBT_INFO("Send of pid \"%d\" done.", pid);
simgrid::s4u::this_actor::suspend();
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);
- simgrid::s4u::this_actor::send(mailbox, payload, static_cast<double>(read_size));
+ mailbox->send(payload, static_cast<double>(read_size));
simgrid::s4u::this_actor::sleep_for(.4);
}
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");
- simgrid::s4u::this_actor::send(mailbox, xbt_strdup("finalize"), 0);
+ mailbox->send(xbt_strdup("finalize"), 0);
get_set_storage_data("Disk1");
}