- XBT_INFO("Then, build a parallel task involving only computations and no communication (1 Gflop per node)");
- computation_amounts = new double[hosts_count]();
- for (int i = 0; i < hosts_count; i++)
- computation_amounts[i] = 1e9; // 1 Gflop
- simgrid::s4u::this_actor::parallel_execute(hosts_count, hosts.data(), computation_amounts, nullptr /* no comm */);
-
- XBT_INFO("Then, build a parallel task with no computation nor communication (synchro only)");
- computation_amounts = new double[hosts_count]();
- communication_amounts = new double[hosts_count * hosts_count]();
- simgrid::s4u::this_actor::parallel_execute(hosts_count, hosts.data(), computation_amounts, communication_amounts);
-
- XBT_INFO("Finally, trick the ptask to do a 'remote execution', on host %s", hosts[1]->get_cname());
- computation_amounts = new double[1]{1e9};
-
- simgrid::s4u::Host* remote[] = {hosts[1]};
- simgrid::s4u::this_actor::parallel_execute(1, remote, computation_amounts, nullptr);
+ /* ------[ test 3 ]----------------- */
+ XBT_INFO("Then, build a parallel activity involving only computations (of different amounts) and no communication");
+ computation_amounts = {3e8, 6e8, 1e9}; // 300Mflop, 600Mflop, 1Gflop
+ communication_amounts.clear(); // no comm
+ simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts);
+
+ /* ------[ test 4 ]----------------- */
+ XBT_INFO("Then, build a parallel activity with no computation nor communication (synchro only)");
+ 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 activity");
+ 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();