- while(1) {
- m_task_t task = NULL;
- int a;
- a = MSG_task_get(&(task), PORT_22);
- if (a == MSG_OK) {
- if(MSG_task_get_data(task)==FINALIZE) {
- MSG_task_destroy(task);
- break;
+
+ m_task_t task = NULL;
+ int a;
+ int id = 0;
+ double remaining = 0;
+ char id_alias[10];
+
+ if (argc != 2) {
+ INFO1("Strange number of arguments expected 1 got %d", argc - 1);
+ }
+
+ id = atoi(argv[1]);
+ sprintf(id_alias, "%d", id);
+
+ a = MSG_task_receive(&(task), id_alias);
+
+ if (a != MSG_OK) {
+ INFO0("Hey?! What's up?");
+ xbt_assert0(0, "Unexpected behavior.");
+ }
+
+ elapsed_time = MSG_get_clock() - start_time;
+
+ if (!bool_printed) {
+ bool_printed = 1;
+ for (id = 0; id < NTASKS; id++) {
+ if (gl_task_array[id] == NULL) {
+ } else if (gl_task_array[id] == task) {
+ INFO5
+ ("===> Estimated Bw of FLOW[%d] : %f ; message from %s to %s with remaining : %f",
+ id, gl_data_size[id] / elapsed_time, masternames[id],
+ slavenames[id], 0.0);
+ } else {
+ remaining = MSG_task_get_remaining_communication(gl_task_array[id]);
+ INFO5
+ ("===> Estimated Bw of FLOW[%d] : %f ; message from %s to %s with remaining : %f",
+ id, (gl_data_size[id] - remaining) / elapsed_time, masternames[id],
+ slavenames[id], remaining);