double compute_cost;
do {
- double* msg = static_cast<double*>(mailbox->get());
+ double* msg = mailbox->get<double>();
compute_cost = *msg;
delete msg;
double compute_cost;
do {
- double* msg = static_cast<double*>(mailbox->get());
+ double* msg = mailbox->get<double>();
compute_cost = *msg;
delete msg;
simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(mailbox_name);
while (true) { // Master forcefully kills the workers by the end of the simulation
- double* msg = static_cast<double*>(mailbox->get());
+ double* msg = mailbox->get<double>();
double compute_cost = *msg;
delete msg;
simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(mailbox_name);
while (true) { // Master forcefully kills the workers by the end of the simulation
- double* msg = static_cast<double*>(mailbox->get());
+ double* msg = mailbox->get<double>();
double compute_cost = *msg;
delete msg;
XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->get_cname());
- const auto* msg1 = static_cast<std::string*>(mailbox->get());
- const auto* msg2 = static_cast<std::string*>(mailbox->get());
- const auto* msg3 = static_cast<std::string*>(mailbox->get());
+ const auto* msg1 = mailbox->get<std::string>();
+ const auto* msg2 = mailbox->get<std::string>();
+ const auto* msg3 = mailbox->get<std::string>();
XBT_INFO("I received '%s', '%s' and '%s'", msg1->c_str(), msg2->c_str(), msg3->c_str());
delete msg1;
delete msg2;
xbt_assert(argc >= 3, "Actor forwarder requires 2 parameters, but got only %d", argc - 1);
simgrid::s4u::Mailbox* in = simgrid::s4u::Mailbox::by_name(argv[1]);
simgrid::s4u::Mailbox* out = simgrid::s4u::Mailbox::by_name(argv[2]);
- auto* msg = static_cast<std::string*>(in->get());
+ auto* msg = in->get<std::string>();
XBT_INFO("Forward '%s'.", msg->c_str());
out->put(msg, msg->size());
}
simgrid::s4u::this_actor::sleep_for(3);
XBT_INFO("And now, induce a deadlock by waiting for a message that will never come\n\n");
- simgrid::s4u::Mailbox::by_name("nobody")->get();
+ simgrid::s4u::Mailbox::by_name("nobody")->get<void>();
xbt_die("Receiving is not supposed to succeed when nobody is sending");
}
}
try {
- auto* answer = static_cast<TrackerAnswer*>(mailbox_->get(GET_PEERS_TIMEOUT));
+ auto* answer = mailbox_->get<TrackerAnswer>(GET_PEERS_TIMEOUT);
// Add the peers the tracker gave us to our peer list.
for (auto const& peer_id : answer->getPeers())
if (id != peer_id)
void joinChain()
{
- const auto* msg = static_cast<ChainMessage*>(me->get());
+ const auto* msg = me->get<ChainMessage>();
prev = msg->prev_;
next = msg->next_;
total_pieces = msg->num_pieces;
{
double compute_cost;
do {
- const auto* msg = static_cast<double*>(mailbox->get());
+ const auto* msg = mailbox->get<double>();
compute_cost = *msg;
delete msg;
double compute_cost;
do {
- const auto* msg = static_cast<double*>(mailbox->get());
+ const auto* msg = mailbox->get<double>();
compute_cost = *msg;
delete msg;
mailbox_out->put(payload, 1);
/* - ... then wait for the (large) pong */
- const auto* sender_time = static_cast<double*>(mailbox_in->get());
+ const auto* sender_time = mailbox_in->get<double>();
double communication_time = simgrid::s4u::Engine::get_clock() - *sender_time;
XBT_INFO("Payload received : large communication (bandwidth bound)");
XBT_INFO("Pong from mailbox %s to mailbox %s", mailbox_in->get_name().c_str(), mailbox_out->get_name().c_str());
/* - Receive the (small) ping first ....*/
- const auto* sender_time = static_cast<double*>(mailbox_in->get());
+ const auto* sender_time = mailbox_in->get<double>();
double communication_time = simgrid::s4u::Engine::get_clock() - *sender_time;
XBT_INFO("Payload received : small communication (latency bound)");
XBT_INFO("Ping time (latency bound) %f", communication_time);
XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->get_cname());
std::string msg = "Token";
neighbor_mailbox->put(&msg, token_size);
- const auto* res = static_cast<std::string*>(my_mailbox->get());
+ const auto* res = my_mailbox->get<std::string>();
XBT_INFO("Host \"%u\" received \"%s\"", rank, res->c_str());
} else {
- auto* res = static_cast<std::string*>(my_mailbox->get());
+ auto* res = my_mailbox->get<std::string>();
XBT_INFO("Host \"%u\" received \"%s\"", rank, res->c_str());
XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->get_cname());
neighbor_mailbox->put(res, token_size);
const char* host_name = simgrid::s4u::this_actor::get_host()->get_cname();
simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(args.at(0));
- const auto* payload = static_cast<struct s_payload*>(mbox->get());
+ const auto* payload = mbox->get<struct s_payload>();
double clock_end = simgrid::s4u::Engine::get_clock();
XBT_INFO("%s:%s to %s:%s => %g sec", payload->tx_host->get_cname(), payload->tx_actor_name, host_name, actor_name,
while (pending_finalize_messages > 0) {
if (my_mbox->ready()) {
double start = simgrid::s4u::Engine::get_clock();
- const auto* received = static_cast<std::string*>(my_mbox->get());
+ const auto* received = my_mbox->get<std::string>();
double waiting_time = simgrid::s4u::Engine::get_clock() - start;
xbt_assert(
waiting_time == 0,
static void receiver(int, char**)
{
simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name("receiver");
-
XBT_INFO("Wait for the message.");
- void* payload = mbox->get();
+ const auto* received = mbox->get<std::string>();
- const auto* received = static_cast<std::string*>(payload);
XBT_INFO("I got '%s'.", received->c_str());
-
delete received;
}
{
XBT_INFO("Wait for my first message");
for (bool cont = true; cont;) {
- const auto* received = static_cast<std::string*>(mbox->get());
+ const auto* received = mbox->get<std::string>();
XBT_INFO("I got a '%s'.", received->c_str());
cont = (*received != "finalize"); // If it's a finalize message, we're done
// Receiving the message was all we were supposed to do
{
XBT_INFO("Wait for my first message");
for (bool cont = true; cont;) {
- const auto* received = static_cast<std::string*>(mbox->get());
+ const auto* received = mbox->get<std::string>();
XBT_INFO("I got a '%s'.", received->c_str());
cont = (*received != "finalize"); // If it's a finalize message, we're done
// Receiving the message was all we were supposed to do
XBT_INFO("Wait for my first message");
for (bool cont = true; cont;) {
- const auto* received = static_cast<std::string*>(mbox->get());
+ const auto* received = mbox->get<std::string>();
XBT_INFO("I got a '%s'.", received->c_str());
if (*received == "finalize")
cont = false; // If it's a finalize message, we're done.
simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(std::string("message"));
if (flow_amount == 1) {
- void* res = mailbox->get();
+ char* res = mailbox->get<char>();
xbt_free(res);
} else {
std::vector<void*> data(flow_amount);
std::string mbName = "MailBoxRCV";
XBT_INFO("RECEIVING on mb %s", mbName.c_str());
simgrid::s4u::Mailbox *myBox = simgrid::s4u::Mailbox::by_name(mbName);
- myBox->get();
+ myBox->get<std::string>();
XBT_INFO("received all messages");
}
{
ensure_other_tid();
- const auto* payload = static_cast<std::string*>(simgrid::s4u::Mailbox::by_name("some mailbox")->get());
+ const auto* payload = simgrid::s4u::Mailbox::by_name("some mailbox")->get<std::string>();
XBT_INFO("Task received");
delete payload;
}
simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name("coordinator");
while (true) {
- m = static_cast<Message*>(mbox->get());
+ m = mbox->get<Message>();
if (m->kind == Message::Kind::REQUEST) {
if (CS_used) {
XBT_INFO("CS already used. Queue the request.");
XBT_INFO("Propositions changed : r=1, cs=0");
}
- const auto* grant = static_cast<Message*>(my_mailbox->get());
+ const auto* grant = my_mailbox->get<Message>();
if ((id == 1) && (grant->kind == Message::Kind::GRANT)) {
cs = 1;
static void server()
{
- void* received = nullptr;
- int count = 0;
+ int* received = nullptr;
+ int count = 0;
while (count < N) {
if (received) {
- delete static_cast<int*>(received);
+ delete received;
received = nullptr;
}
- received = simgrid::s4u::Mailbox::by_name("mymailbox")->get();
+ received = simgrid::s4u::Mailbox::by_name("mymailbox")->get<int>();
count++;
}
- int value_got = *(static_cast<int*>(received));
+ int value_got = *received;
MC_assert(value_got == 3);
XBT_INFO("OK");
static void server()
{
- void* received1 = nullptr;
- void* received2 = nullptr;
+ int* received1 = nullptr;
+ int* received2 = nullptr;
- received1 = simgrid::s4u::Mailbox::by_name("mymailbox")->get();
- long val1 = *(static_cast<int*>(received1));
+ received1 = simgrid::s4u::Mailbox::by_name("mymailbox")->get<int>();
+ long val1 = *received1;
received1 = nullptr;
XBT_INFO("Received %ld", val1);
- received2 = simgrid::s4u::Mailbox::by_name("mymailbox")->get();
- long val2 = *(static_cast<int*>(received2));
+ received2 = simgrid::s4u::Mailbox::by_name("mymailbox")->get<int>();
+ long val2 = *received2;
received2 = nullptr;
XBT_INFO("Received %ld", val2);
MC_assert(std::min(val1, val2) == 1);
- received1 = simgrid::s4u::Mailbox::by_name("mymailbox")->get();
- val1 = *(static_cast<int*>(received1));
+ received1 = simgrid::s4u::Mailbox::by_name("mymailbox")->get<int>();
+ val1 = *received1;
XBT_INFO("Received %ld", val1);
- received2 = simgrid::s4u::Mailbox::by_name("mymailbox")->get();
- val2 = *(static_cast<int*>(received2));
+ received2 = simgrid::s4u::Mailbox::by_name("mymailbox")->get<int>();
+ val2 = *received2;
XBT_INFO("Received %ld", val2);
XBT_INFO("OK");
int value_got = -1;
simgrid::s4u::Mailbox* mb = simgrid::s4u::Mailbox::by_name("server");
for (int count = 0; count < worker_amount; count++) {
- const auto* msg = static_cast<int*>(mb->get());
+ const auto* msg = mb->get<int>();
value_got = *msg;
delete msg;
}
static void receiver(std::string mailbox)
{
auto* mbox = simgrid::s4u::Mailbox::by_name(mailbox);
- auto msg = std::unique_ptr<Message>(static_cast<Message*>(mbox->get()));
+ auto msg = std::unique_ptr<Message>(mbox->get<Message>());
XBT_INFO("[%s] %s received %d bytes from %s",
mailbox.c_str(),
simgrid::s4u::this_actor::get_host()->get_name().c_str(),
XBT_DEBUG("Worker started");
- const auto* payload = static_cast<double*>(mbox->get());
+ const auto* payload = mbox->get<double>();
count_finished--;
if (count_finished == 0) {
static void receiver(simgrid::s4u::Mailbox* mailbox)
{
XBT_INFO("Wait for a message.");
- mailbox->get();
+ mailbox->get<std::string>();
XBT_INFO("Done.");
}
while (true) {
try {
XBT_INFO("Waiting a message on %s", mailbox->get_cname());
- const auto* payload = static_cast<double*>(mailbox->get());
+ const auto* payload = mailbox->get<double>();
xbt_assert(payload != nullptr, "mailbox->get() failed");
double comp_size = *payload;
delete payload;
static void sender(const std::string& mailbox, uint64_t msg_size)
{
auto mbox = simgrid::s4u::Mailbox::by_name(mailbox);
- mbox->put((void*)1, msg_size);
+ static int payload = 42;
+ mbox->put(&payload, msg_size);
}
static void receiver(const std::string& mailbox)
{
auto mbox = simgrid::s4u::Mailbox::by_name(mailbox);
- mbox->get();
+ mbox->get<int>();
}
static void run_transfer(simgrid::s4u::Host* src_host, simgrid::s4u::Host* dst_host, const std::string& mailbox,
ACT_DEBUG("Receiving: %s -- Actor %s on mailbox %s", NAME.c_str(), simgrid::s4u::this_actor::get_cname(),
from->get_cname());
- delete static_cast<std::string*>(from->get());
+ delete from->get<std::string>();
log_action(action, simgrid::s4u::Engine::get_clock() - clock);
}
};
{
auto mbox = simgrid::s4u::Mailbox::by_name("master_mailbox");
while (true) {
- const auto* task = static_cast<Task*>(mbox->get());
+ const auto* task = mbox->get<Task>();
if (task->name == "finalize") {
delete task;
break;
TRACE_host_variable_set(my_hostname, "task_computation", 0);
while (true) {
- const auto* task = static_cast<Task*>(mailbox->get());
+ const auto* task = mailbox->get<Task>();
if (task->name == "finalize") {
delete task;
break;
simgrid::s4u::this_actor::sleep_for(2);
while (true) { // I am an eternal emigrant
- auto destination = std::unique_ptr<std::string>(static_cast<std::string*>(mailbox->get()));
+ auto destination = std::unique_ptr<std::string>(mailbox->get<std::string>());
if (destination->empty())
break; // there is no destination, die
simgrid::s4u::this_actor::set_host(simgrid::s4u::Host::by_name(*destination));
double compute_cost;
do {
- const auto* msg = static_cast<double*>(mailbox->get());
+ const auto* msg = mailbox->get<double>();
compute_cost = *msg;
delete msg;
.def(
"get",
[](Mailbox* self) {
- py::object data = pybind11::reinterpret_steal<py::object>(static_cast<PyObject*>(self->get()));
+ py::object data = pybind11::reinterpret_steal<py::object>(self->get<PyObject>());
// data.dec_ref(); // FIXME: why does it break python-actor-create?
return data;
},
std::string("__mig_stage3:") + vm_->get_cname() + "(" + src_pm_->get_cname() + "-" + dst_pm_->get_cname() + ")";
while (not received_finalize) {
- const std::string* payload = static_cast<std::string*>(mbox->get());
+ const std::string* payload = mbox->get<std::string>();
if (finalize_task_name == *payload)
received_finalize = true;
XBT_DEBUG("wait for reception of the final ACK (i.e. migration has been correctly performed");
simgrid::s4u::Mailbox* mbox_ctl = simgrid::s4u::Mailbox::by_name(
std::string("__mbox_mig_ctl:") + vm->get_cname() + "(" + src_pm->get_cname() + "-" + dst_pm->get_cname() + ")");
- delete static_cast<std::string*>(mbox_ctl->get());
+ delete mbox_ctl->get<std::string>();
tx->join();
rx->join();
auto mb = simgrid::s4u::Mailbox::by_name(box_name);
const int* payload;
- payload = static_cast<int*>(mb->get());
+ payload = mb->get<int>();
MC_assert(*payload == 1);
delete payload;
- payload = static_cast<int*>(mb->get());
+ payload = mb->get<int>();
MC_assert(*payload == 2);
delete payload;
simgrid::s4u::this_actor::sleep_until(milestone[i]);
REQUIRE_NETWORK_FAILURE({
INFO("get(" << ('A' + i) << ")");
- simgrid::s4u::Mailbox::by_name("mb")->get();
+ simgrid::s4u::Mailbox::by_name("mb")->get<int>();
});
}
simgrid::s4u::this_actor::sleep_until(milestone[4]);
simgrid::s4u::Actor::create("receiver", all_hosts[2], [&recv_done]() {
assert_exit(true, 5);
- void* payload = simgrid::s4u::Mailbox::by_name("mb")->get();
+ char* payload = simgrid::s4u::Mailbox::by_name("mb")->get<char>();
xbt_free(payload);
recv_done = true;
});
simgrid::s4u::Actor::create("receiver", all_hosts[2], [&recv_done]() {
assert_exit(true, 3);
simgrid::s4u::this_actor::sleep_for(2);
- void* payload = simgrid::s4u::Mailbox::by_name("mb")->get();
+ char* payload = simgrid::s4u::Mailbox::by_name("mb")->get<char>();
xbt_free(payload);
recv_done = true;
});
simgrid::s4u::Actor::create("receiver", all_hosts[2], [&recv_done]() {
assert_exit(true, 3);
- void* payload = simgrid::s4u::Mailbox::by_name("mb")->get();
+ char* payload = simgrid::s4u::Mailbox::by_name("mb")->get<char>();
xbt_free(payload);
recv_done = true;
});
simgrid::s4u::Actor::create("receiver", all_hosts[2], [&recv_done]() {
assert_exit(true, 2);
REQUIRE_NETWORK_FAILURE({
- void* payload = simgrid::s4u::Mailbox::by_name("mb")->get();
+ char* payload = simgrid::s4u::Mailbox::by_name("mb")->get<char>();
xbt_free(payload);
});
recv_done = true;
&in_catch_before_on_exit, &in_catch_after_on_exit]() {
assert_exit(false, 1);
try {
- simgrid::s4u::Mailbox::by_name("mb")->get();
+ simgrid::s4u::Mailbox::by_name("mb")->get<int>();
} catch (simgrid::NetworkFailureException const&) {
// Shouldn't get in here after the on_exit function
in_catch_before_on_exit = not in_on_exit;
{
XBT_INFO("Starting.");
auto mailbox = simgrid::s4u::Mailbox::by_name("receiver");
- int data = *(int*)mailbox->get();
+ int data = *mailbox->get<int>();
XBT_INFO("Got %d at the end", data);
}
};
XBT_INFO("Receiver spec: %s", args[0].c_str());
for (unsigned int test = 1; test <= args[0].size(); test++) {
simgrid::s4u::this_actor::sleep_until(test * 5 - 5);
- std::string mboxName = "Test #" + std::to_string(test);
- simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(mboxName);
- void* received = nullptr;
+ std::string mboxName = "Test #" + std::to_string(test);
+ simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(mboxName);
+ std::string* received = nullptr;
switch (args[0][test - 1]) {
case 'r':
XBT_INFO("Test %u: r (regular receive)", test);
- received = mbox->get();
+ received = mbox->get<std::string>();
break;
case 'R':
XBT_INFO("Test %u: R (sleep + regular receive)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- received = mbox->get();
+ received = mbox->get<std::string>();
break;
case 'i':
XBT_INFO("Test %u: i (asynchronous irecv)", test);
- mbox->get_async(&received)->wait();
+ mbox->get_async<std::string>(&received)->wait();
break;
case 'I':
XBT_INFO("Test %u: I (sleep + asynchronous irecv)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
- mbox->get_async(&received)->wait();
+ mbox->get_async<std::string>(&received)->wait();
break;
case 'p':
XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test);
mbox->set_receiver(simgrid::s4u::Actor::self());
- received = mbox->get();
+ received = mbox->get<std::string>();
break;
case 'P':
XBT_INFO("Test %u: P (sleep + regular receive on permanent mailbox)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->set_receiver(simgrid::s4u::Actor::self());
- received = mbox->get();
+ received = mbox->get<std::string>();
break;
case 'j':
XBT_INFO("Test %u: j (irecv on permanent mailbox)", test);
mbox->set_receiver(simgrid::s4u::Actor::self());
- mbox->get_async(&received)->wait();
+ mbox->get_async<std::string>(&received)->wait();
break;
case 'J':
XBT_INFO("Test %u: J (sleep + irecv on permanent mailbox)", test);
simgrid::s4u::this_actor::sleep_for(0.5);
mbox->set_receiver(simgrid::s4u::Actor::self());
- mbox->get_async(&received)->wait();
+ mbox->get_async<std::string>(&received)->wait();
break;
default:
xbt_die("Unknown receiver spec for test %u: '%c'", test, args[0][test - 1]);
}
- const std::string* receivedStr = static_cast<std::string*>(received);
- xbt_assert(*receivedStr == mboxName);
- delete receivedStr;
+ xbt_assert(*received == mboxName);
+ delete received;
XBT_INFO("Test %u OK", test);
}
simgrid::s4u::this_actor::sleep_for(0.5);
const std::string* payload = nullptr;
XBT_INFO(" Start RX");
try {
- payload = static_cast<std::string*>(simgrid::s4u::Mailbox::by_name("comm")->get());
+ payload = simgrid::s4u::Mailbox::by_name("comm")->get<std::string>();
XBT_INFO(" Receive message: %s", payload->c_str());
} catch (const simgrid::HostFailureException&) {
XBT_INFO(" Receive message: HOST_FAILURE");
XBT_INFO("Worker receiving");
try {
- payload = static_cast<std::string*>(mailbox->get());
+ payload = mailbox->get<std::string>();
} catch (const simgrid::HostFailureException&) {
XBT_DEBUG("The host has been turned off, this was expected");
delete payload;
while (true) {
try {
- payload = static_cast<std::string*>(mailbox->get());
+ payload = mailbox->get<std::string>();
} catch (const simgrid::HostFailureException&) {
XBT_DEBUG("The host has been turned off, this was expected");
return;
XBT_INFO("Mailbox::listen_from() returns %ld (should return my pid, which is %ld)", mailbox->listen_from(),
simgrid::s4u::this_actor::get_pid());
- const std::string* res = static_cast<std::string*>(mailbox->get());
+ const std::string* res = mailbox->get<std::string>();
xbt_assert(*res == "Some data", "Data received: %s", res->c_str());
XBT_INFO("Data successfully received from regular mailbox");
xbt_assert(mailbox2->listen()); // used to break.
XBT_INFO("Task listen works on asynchronous mailboxes");
- res = static_cast<std::string*>(mailbox2->get());
+ res = mailbox2->get<std::string>();
xbt_assert(*res == "More data");
delete res;
{
for (int nb_message = 0; nb_message < nb_message_to_send * nb_sender; nb_message++) {
XBT_VERB("waiting for messages");
- int* ptr = (int*)(box->get());
+ int* ptr = box->get<int>();
int id = *ptr;
XBT_VERB("received messages #%i", id);
delete ptr;
static void test_receive(){
for (int nb_message = 0; nb_message < nb_message_to_send * nb_sender; nb_message++) {
XBT_VERB("waiting for messages");
- int* ptr = (int*)(box->get());
+ int* ptr = box->get<int>();
int id = *ptr;
XBT_VERB("received messages #%i", id);
delete ptr;
{
simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name("mailbox");
for (int i = 0; i < 3; i++) {
- const auto* pid = static_cast<aid_t*>(mailbox->get());
+ const auto* pid = mailbox->get<aid_t>();
XBT_INFO("Killing process \"%ld\".", *pid);
simgrid::s4u::Actor::by_pid(*pid)->kill();
}
XBT_INFO("Server waiting for transfers ...");
while (true) {
- const std::string* msg = static_cast<std::string*>(mailbox->get());
+ const std::string* msg = mailbox->get<std::string>();
if (*msg == "finalize") { // Shutdown ...
delete msg;
break;
XBT_INFO("Actual result: Sending %d bytes from '%s' to '%s' takes %f seconds.", data_size,
simgrid::s4u::this_actor::get_host()->get_cname(), dest, end_time - start_time);
});
- simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest), [mailbox]() { mailbox->get(); });
+ simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest),
+ [mailbox]() { mailbox->get<std::string>(); });
const auto* ap1 = simgrid::s4u::Link::by_name("AP1");
ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(src), 0);
ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(dest), 0);
XBT_INFO("Actual result: Sending %d bytes from '%s' to '%s' takes %f seconds.", data_size,
simgrid::s4u::this_actor::get_host()->get_cname(), dest, end_time - start_time);
});
- simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest), [mailbox]() { mailbox->get(); });
+ simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest),
+ [mailbox]() { mailbox->get<std::string>(); });
auto* l = (simgrid::kernel::resource::NetworkWifiLink*)simgrid::s4u::Link::by_name("AP1")->get_impl();
if(!l->toggle_decay_model())
l->toggle_decay_model();