static int master(int argc, char *argv[])
{
- int i;
-
long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
XBT_INFO("Got %ld workers and %ld tasks to process", workers_count, number_of_tasks);
- for (i = 0; i < number_of_tasks; i++) {
+ for (int i = 0; i < number_of_tasks; i++) {
char mailbox[256];
snprintf(mailbox, 255, "worker-%ld", i % workers_count);
XBT_INFO("Send a message to %s", mailbox);
}
XBT_INFO("All tasks have been dispatched. Let's tell everybody the computation is over.");
- for (i = 0; i < workers_count; i++) {
+ for (int i = 0; i < workers_count; i++) {
char mailbox[256];
snprintf(mailbox, 255, "worker-%ld", i % workers_count);
msg_task_t task = MSG_task_create("finalize", 0, 0, FINALIZE);
snprintf(mailbox, 79,"worker-%ld", id);
while (1) {
- double time1 = MSG_get_clock();
msg_task_t task = NULL;
XBT_INFO("Waiting a message on %s", mailbox);
int retcode = MSG_task_receive( &(task), mailbox);
MSG_task_destroy(task);
break;
}
- if (time1 < *((double *) task->data))
- time1 = *((double *) task->data);
XBT_INFO("Start execution...");
retcode = MSG_task_execute(task);
if (retcode == MSG_OK) {