+ xbt_free(communication_amounts);
+ xbt_free(computation_amounts);
+
+ XBT_INFO("We can do the same with a timeout of one second enabled.");
+ computation_amounts = xbt_new0(double, hosts_count);
+ communication_amounts = xbt_new0(double, hosts_count* hosts_count);
+ for (int i = 0; i < hosts_count; i++)
+ computation_amounts[i] = 1e9; // 1 Gflop
+ for (int i = 0; i < hosts_count; i++)
+ for (int j = i + 1; j < hosts_count; j++)
+ communication_amounts[i * hosts_count + j] = 1e7; // 10 MB
+ ptask =
+ MSG_parallel_task_create("parallel task", hosts_count, hosts, computation_amounts, communication_amounts, NULL);
+ msg_error_t errcode = MSG_parallel_task_execute_with_timeout(ptask, 1 /* timeout (in seconds)*/);
+ xbt_assert(errcode == MSG_TIMEOUT, "Woops, this did not timeout as expected... Please report that bug.");
+ MSG_task_destroy(ptask);
+ xbt_free(communication_amounts);
+ xbt_free(computation_amounts);