static void receiver()
{
sg4::Mailbox* mbox = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name());
- double* payload = nullptr;
while (true) {
- payload = mbox->get<double>();
+ auto payload = mbox->get_unique<double>();
if (*payload < 0)
break;
XBT_INFO("Received data. Elapsed %lf", sg4::Engine::get_clock() - *payload);
- delete payload;
}
XBT_INFO("Bye");
}
{
sg4::Engine e(&argc, argv);
/* keep it simple, no network factors nor crosstrafic */
- simgrid::s4u::Engine::set_config("network/model:CM02");
- simgrid::s4u::Engine::set_config("network/weight-S:20537");
- simgrid::s4u::Engine::set_config("network/crosstraffic:0");
+ sg4::Engine::set_config("network/model:CM02");
+ sg4::Engine::set_config("network/weight-S:20537");
+ sg4::Engine::set_config("network/crosstraffic:0");
/* dog-bone platform */
std::unordered_map<std::string, sg4::Host*> hosts;