- xbt_dynar_t slaves_dynar;
- int slaves_count = 0;
- msg_host_t *slaves = NULL;
- double task_comp_size = 100000;
- double task_comm_size = 10000;
- double *computation_amount = NULL;
- double *communication_amount = NULL;
- msg_task_t ptask = NULL;
- int i, j;
-
- slaves_dynar = MSG_hosts_as_dynar();
- slaves_count = xbt_dynar_length(slaves_dynar);
- slaves = xbt_dynar_to_array(slaves_dynar);
-
- computation_amount = xbt_new0(double, slaves_count);
- communication_amount = xbt_new0(double, slaves_count * slaves_count);
-
- for (i = 0; i < slaves_count; i++)
- computation_amount[i] = task_comp_size;
-
- for (i = 0; i < slaves_count; i++)
- for (j = i + 1; j < slaves_count; j++)
- communication_amount[i * slaves_count + j] = task_comm_size;
-
- ptask = MSG_parallel_task_create("parallel task",
- slaves_count, slaves,
- computation_amount,
- communication_amount, NULL);
+ /* Retrieve the list of all hosts as an array of hosts */
+ xbt_dynar_t slaves_dynar = MSG_hosts_as_dynar();
+ int slaves_count = xbt_dynar_length(slaves_dynar);
+ msg_host_t *slaves = xbt_dynar_to_array(slaves_dynar);
+
+ XBT_INFO("First, build a classical parallel task, with 1 Gflop to execute on each node, and 10MB to exchange between each pair");
+ double *computation_amounts = xbt_new0(double, slaves_count);
+ double *communication_amounts = xbt_new0(double, slaves_count * slaves_count);
+
+ for (int i = 0; i < slaves_count; i++)
+ computation_amounts[i] = 1e9; // 1 Gflop
+
+ for (int i = 0; i < slaves_count; i++)
+ for (int j = i + 1; j < slaves_count; j++)
+ communication_amounts[i * slaves_count + j] = 1e7; // 10 MB
+
+ msg_task_t ptask =
+ MSG_parallel_task_create("parallel task", slaves_count, slaves, computation_amounts, communication_amounts, NULL);