snprintf(task_name,79, "Task_%d", i);
msg_task_t task = MSG_task_create(task_name, comp_size, comm_size, NULL); /* - Create a task */
if (number_of_tasks < 10000 || i % 10000 == 0)
- XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", task->name, number_of_tasks, mailbox);
+ XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", MSG_task_get_name(task), number_of_tasks, mailbox);
MSG_task_send(task, mailbox); /* - Send the task to the @ref worker */
}
snprintf(sprintf_buffer,256, "Task_%d", i);
msg_task_t task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, NULL);
if (number_of_tasks < 10000 || i % 10000 == 0)
- XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", task->name, number_of_tasks, mailbox);
+ XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", MSG_task_get_name(task), number_of_tasks, mailbox);
MSG_task_send(task, mailbox);
}
double sender_time = *((double*)(pong_task->data));
double communication_time = MSG_get_clock() - sender_time;
- XBT_INFO("Task received : %s", pong_task->name);
+ XBT_INFO("Task received : %s", MSG_task_get_name(pong_task));
xbt_free(pong_task->data);
MSG_task_destroy(pong_task);
XBT_INFO("Pong time (bandwidth bound): %.3f", communication_time);
double sender_time = *((double*)(ping_task->data));
double communication_time = MSG_get_clock() - sender_time;
- XBT_INFO("Task received : %s", ping_task->name);
+ XBT_INFO("Task received : %s", MSG_task_get_name(ping_task));
xbt_free(ping_task->data);
MSG_task_destroy(ping_task);
XBT_INFO(" Ping time (latency bound) %f", communication_time);
snprintf(mailbox, 255, "%d", rank + 1);
unsigned int task_comm_size = 1000000; /* The token is 1MB long*/
msg_task_t task = MSG_task_create("Token", 0, task_comm_size, NULL);
- XBT_INFO("Host \"%d\" send '%s' to Host \"%s\"", rank, task->name, mailbox);
+ XBT_INFO("Host \"%d\" send '%s' to Host \"%s\"", rank, MSG_task_get_name(task), mailbox);
MSG_task_send(task, mailbox);
task = NULL;
int res = MSG_task_receive(&task, MSG_process_get_name(MSG_process_self()));
snprintf(mailbox, 255, "0");
else
snprintf(mailbox, 255, "%d", rank + 1);
- XBT_INFO("Host \"%d\" send '%s' to Host \"%s\"", rank, task->name, mailbox);
+ XBT_INFO("Host \"%d\" send '%s' to Host \"%s\"", rank, MSG_task_get_name(task), mailbox);
MSG_task_send(task, mailbox);
}
return 0;
msg_host_t jupiter = MSG_host_by_name("Jupiter");
msg_task_t task = MSG_task_create("task on", task_comp_size, task_comm_size, NULL);
- XBT_INFO("Sending \"%s\"", task->name);
+ XBT_INFO("Sending \"%s\"", MSG_task_get_name(task));
if (MSG_task_send_with_timeout(task, mailbox, 1) != MSG_OK)
MSG_task_destroy(task);
MSG_host_off(jupiter);
task = MSG_task_create("task off", task_comp_size, task_comm_size, NULL);
- XBT_INFO("Sending \"%s\"", task->name);
+ XBT_INFO("Sending \"%s\"", MSG_task_get_name(task));
if (MSG_task_send_with_timeout(task, mailbox, 1) != MSG_OK)
MSG_task_destroy(task);
xbt_dynar_free(&jupi_processes);
task = MSG_task_create("task on without proc", task_comp_size, task_comm_size, NULL);
- XBT_INFO("Sending \"%s\"", task->name);
+ XBT_INFO("Sending \"%s\"", MSG_task_get_name(task));
if (MSG_task_send_with_timeout(task, mailbox, 1) != MSG_OK)
MSG_task_destroy(task);
MSG_process_create_with_arguments("slave", slave, NULL, MSG_host_by_name("Jupiter"), 1, argvF);
task = MSG_task_create("task on with proc", task_comp_size, task_comm_size, NULL);
- XBT_INFO("Sending \"%s\"", task->name);
+ XBT_INFO("Sending \"%s\"", MSG_task_get_name(task));
if (MSG_task_send_with_timeout(task, mailbox, 1) != MSG_OK)
MSG_task_destroy(task);
task = MSG_task_create("finalize", 0, 0, 0);
- XBT_INFO("Sending \"%s\"", task->name);
+ XBT_INFO("Sending \"%s\"", MSG_task_get_name(task));
if (MSG_task_send_with_timeout(task, mailbox, 1) != MSG_OK)
MSG_task_destroy(task);
XBT_INFO(" Start RX");
msg_error_t error = MSG_task_receive(&(task), mailbox);
if (error == MSG_OK) {
- XBT_INFO(" Receive message: %s", task->name);
+ XBT_INFO(" Receive message: %s", MSG_task_get_name(task));
MSG_task_destroy(task);
} else if (error == MSG_HOST_FAILURE) {
XBT_INFO(" Receive message: HOST_FAILURE");
double timeout = 1;
msg_task_t task = MSG_task_create("normal", task_comp_size, task_comm_size, NULL);
- XBT_INFO("Sending task: \"%s\"", task->name);
+ XBT_INFO("Sending task: \"%s\"", MSG_task_get_name(task));
MSG_task_send_with_timeout(task, "worker_mailbox", timeout);
task = MSG_task_create("cancel directly", task_comp_size, task_comm_size, NULL);
- XBT_INFO("Canceling task \"%s\" directly", task->name);
+ XBT_INFO("Canceling task \"%s\" directly", MSG_task_get_name(task));
MSG_task_cancel(task);
MSG_task_destroy(task);
task = MSG_task_create("destroy directly", task_comp_size, task_comm_size, NULL);
- XBT_INFO("Destroying task \"%s\" directly", task->name);
+ XBT_INFO("Destroying task \"%s\" directly", MSG_task_get_name(task));
MSG_task_destroy(task);
task = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL);
msg_comm_t comm = MSG_task_isend(task, "worker_mailbox");
- XBT_INFO("Canceling task \"%s\" during comm", task->name);
+ XBT_INFO("Canceling task \"%s\" during comm", MSG_task_get_name(task));
MSG_task_cancel(task);
if (MSG_comm_wait(comm, -1) != MSG_OK)
MSG_comm_destroy(comm);
task = MSG_task_create("finalize", task_comp_size, task_comm_size, NULL);
comm = MSG_task_isend(task, "worker_mailbox");
- XBT_INFO("Destroying task \"%s\" during comm", task->name);
+ XBT_INFO("Destroying task \"%s\" during comm", MSG_task_get_name(task));
MSG_task_destroy(task);
if (MSG_comm_wait(comm, -1) != MSG_OK)
MSG_comm_destroy(comm);
{
msg_task_t task = (msg_task_t) MSG_process_get_data(MSG_process_self());
msg_error_t res;
- XBT_INFO("Start %s", task->name);
+ XBT_INFO("Start %s", MSG_task_get_name(task));
res = MSG_task_execute(task);
XBT_INFO("Task %s", res == MSG_OK ? "done" : "failed");
MSG_task_destroy(task);
XBT_INFO("Handling task \"%s\"", MSG_task_get_name(task));
if (not strcmp(MSG_task_get_name(task), "finalize")) {
- XBT_INFO("Destroying task \"%s\"", task->name);
+ XBT_INFO("Destroying task \"%s\"", MSG_task_get_name(task));
MSG_task_destroy(task);
break;
}
if (not strcmp(MSG_task_get_name(task), "cancel")) {
MSG_process_create("worker1", worker_main, task, MSG_host_self());
MSG_process_sleep(0.1);
- XBT_INFO("Canceling task \"%s\"", task->name);
+ XBT_INFO("Canceling task \"%s\"", MSG_task_get_name(task));
MSG_task_cancel(task);
continue;
}
msg_task_t task = MSG_task_create("simple", task_comp_size, task_comm_size, NULL);
tasks.push_back(task);
- XBT_INFO("get the progress of %s before the task starts", task->name);
+ XBT_INFO("get the progress of %s before the task starts", MSG_task_get_name(task));
progress = MSG_task_get_remaining_work_ratio(task);
xbt_assert(progress == 1.0, "Progress should be 1.0 not %f", progress);
- XBT_INFO("Executing task: \"%s\"", task->name);
+ XBT_INFO("Executing task: \"%s\"", MSG_task_get_name(task));
MSG_task_execute(task);
- XBT_INFO("get the progress of %s after the task finishes", task->name);
+ XBT_INFO("get the progress of %s after the task finishes", MSG_task_get_name(task));
progress = MSG_task_get_remaining_work_ratio(task);
xbt_assert(progress == 0.0, "Progress should be equal to 0.0 not %f", progress);
msg_task_t task = MSG_parallel_task_create("ptask", 2, hosts_to_use.data(), computation_amount, communication_amount, NULL);
tasks.push_back(task);
- XBT_INFO("get the progress of %s before the task starts", task->name);
+ XBT_INFO("get the progress of %s before the task starts", MSG_task_get_name(task));
progress = MSG_task_get_remaining_work_ratio(task);
xbt_assert(progress == 1.0, "Progress should be 1.0 not %f", progress);
- XBT_INFO("Executing task: \"%s\"", task->name);
+ XBT_INFO("Executing task: \"%s\"", MSG_task_get_name(task));
MSG_parallel_task_execute(task);
- XBT_INFO("get the progress of %s after the task finishes", task->name);
+ XBT_INFO("get the progress of %s after the task finishes", MSG_task_get_name(task));
progress = MSG_task_get_remaining_work_ratio(task);
xbt_assert(progress == 0.0, "Progress should be equal to 0.0 not %f", progress);
progress = MSG_task_get_remaining_work_ratio(task);
xbt_assert(progress >= 0 and progress < 1, "Progress should be in [0, 1[, and not %f", progress);
xbt_assert(progress < progress_prev, "Progress should decrease, not increase");
- XBT_INFO("Progress of \"%s\": %f", task->name, progress);
+ XBT_INFO("Progress of \"%s\": %f", MSG_task_get_name(task), progress);
progress_prev = progress;
}
}