- computation_amounts = new double[hosts_count]();
- communication_amounts = new double[hosts_count * hosts_count]();
- simgrid::s4u::this_actor::parallel_execute(hosts_count, hosts, computation_amounts, communication_amounts);
-
- XBT_INFO("Finally, trick the ptask to do a 'remote execution', on host %s", hosts[1]->getCname());
- computation_amounts = new double[1]{1e9};
-
- simgrid::s4u::Host* remote[] = {hosts[1]};
- simgrid::s4u::this_actor::parallel_execute(1, remote, computation_amounts, nullptr);
+ computation_amounts.clear();
+ communication_amounts.clear();
+ simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts);
+
+ /* ------[ test 5 ]----------------- */
+ XBT_INFO("Then, Monitor the execution of a parallel task");
+ computation_amounts.assign(hosts_count, 1e6 /*1Mflop*/);
+ communication_amounts = {0, 1e6, 0, 0, 0, 1e6, 1e6, 0, 0};
+ simgrid::s4u::ExecPtr activity =
+ simgrid::s4u::this_actor::exec_init(hosts, computation_amounts, communication_amounts);
+ activity->start();
+
+ while (not activity->test()) {
+ XBT_INFO("Remaining flop ratio: %.0f%%", 100 * activity->get_remaining_ratio());
+ simgrid::s4u::this_actor::sleep_for(5);
+ }
+ activity->wait();