sg4::Mailbox* my_mbox = sg4::Mailbox::by_name("peer-" + std::to_string(my_id));
my_mbox->set_receiver(sg4::Actor::self());
- std::vector<sg4::CommPtr> pending_comms;
+ sg4::ActivitySet pending_comms;
/* Start dispatching all messages to peers others that myself */
for (int i = 0; i < messages_count; i++) {
// 'message' is not a stable storage location
XBT_INFO("Send '%s' to '%s'", message.c_str(), mbox->get_cname());
/* Create a communication representing the ongoing communication */
- pending_comms.push_back(mbox->put_async(payload, payload_size));
+ pending_comms.push(mbox->put_async(payload, payload_size));
}
}
}
if (peer_id != my_id) {
sg4::Mailbox* mbox = sg4::Mailbox::by_name("peer-" + std::to_string(peer_id));
auto* payload = new std::string("finalize"); // Make a copy of the data we will send
- pending_comms.push_back(mbox->put_async(payload, payload_size));
+ pending_comms.push(mbox->put_async(payload, payload_size));
XBT_INFO("Send 'finalize' to 'peer-%d'", peer_id);
}
}
}
XBT_INFO("I'm done, just waiting for my peers to receive the messages before exiting");
- sg4::Comm::wait_all(pending_comms);
+ pending_comms.wait_all();
XBT_INFO("Goodbye now!");
}
mailbox->put(payload, comm_size);
} else {
// Start all comms in parallel, and wait for all completions in one shot
- std::vector<sg4::CommPtr> comms;
+ sg4::ActivitySet comms;
for (int i = 0; i < flow_amount; i++)
- comms.push_back(mailbox->put_async(bprintf("%d", i), comm_size));
- sg4::Comm::wait_all(comms);
+ comms.push(mailbox->put_async(bprintf("%d", i), comm_size));
+ comms.wait_all();
}
XBT_INFO("sender done.");
}
std::vector<char*> data(flow_amount);
// Start all comms in parallel, and wait for their completion in one shot
- std::vector<sg4::CommPtr> comms;
+ sg4::ActivitySet comms;
for (int i = 0; i < flow_amount; i++)
- comms.push_back(mailbox->get_async<char>(&data[i]));
+ comms.push(mailbox->get_async<char>(&data[i]));
- sg4::Comm::wait_all(comms);
+ comms.wait_all();
for (int i = 0; i < flow_amount; i++)
xbt_free(data[i]);
}
simgrid::plugin::Jbod::create_jbod(zone, "jbod_raid6", 1e9, 4, simgrid::plugin::Jbod::RAID::RAID6, 1e7, 5e6);
zone->add_route(host->get_netpoint(), jbod_raid6->get_netpoint(), nullptr, nullptr, {sg4::LinkInRoute(link)});
+ zone->seal();
+
XBT_INFO("XXXXXXXXXXXXXXX RAID 0 XXXXXXXXXXXXXXXX");
sg4::Actor::create("", host, write_then_read, jbod_raid0);
e.run();
auto* router = cluster->create_router("cluster_router");
std::vector<sg4::LinkInRoute> links; // empty
cluster->add_route(router, nullptr, nullptr, nullptr, links);
+ cluster->seal();
simgrid::plugin::ProducerConsumerPtr<int> pc = simgrid::plugin::ProducerConsumer<int>::create(2);