- for (int i = 0; i < number_of_tasks; i++) { /* For each task to be executed: */
- /* - Select a @ref worker in a round-robin way */
- mailbox = simgrid::s4u::Mailbox::by_name(std::string("worker-") + std::to_string(i % workers_count));
-
- if (number_of_tasks < 10000 || (number_of_tasks < 100000 && i % 10000 == 0) || i % 100000 == 0)
- XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", (std::string("Task_") + std::to_string(i)).c_str(),
- number_of_tasks, mailbox->get_cname());
-
- /* - Send the computation amount to the @ref worker */
- mailbox->put(new double(comp_size), comm_size);
+ for (int i = 0; i < tasks_count; i++) { /* For each task to be executed: */
+ /* - Select a worker in a round-robin way */
+ simgrid::s4u::Mailbox* mailbox = workers[i % workers.size()];
+
+ /* - Send the computation amount to the worker */
+ if (tasks_count < 10000 || (tasks_count < 100000 && i % 10000 == 0) || i % 100000 == 0)
+ XBT_INFO("Sending task %d of %ld to mailbox '%s'", i, tasks_count, mailbox->get_cname());
+ mailbox->put(new double(compute_cost), communicate_cost);