-/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
xbt_assert(argc == 5);
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");
+ long task_comm_size = xbt_str_parse_int(argv[3], "Invalid communication size: %s");
long workers_count = xbt_str_parse_int(argv[4], "Invalid amount of workers: %s");
XBT_INFO("Got %ld workers and %ld tasks to process", workers_count, number_of_tasks);
{
xbt_assert(argc == 2);
char mailbox_name[80];
- double* payload;
long id = xbt_str_parse_int(argv[1], "Invalid argument %s");
snprintf(mailbox_name, 79, "worker-%ld", id);
while (1) {
XBT_INFO("Waiting a message on %s", mailbox_name);
+ double* payload;
sg_comm_t comm = sg_mailbox_get_async(mailbox, (void**)&payload);
sg_error_t retcode = sg_comm_wait(comm);
if (retcode == SG_OK) {
free(payload);
break;
} else {
+ double comp_size = *payload;
+ free(payload);
XBT_INFO("Start execution...");
- sg_actor_execute(*payload);
+ sg_actor_execute(comp_size);
XBT_INFO("Execution complete.");
- free(payload);
}
} else if (retcode == SG_ERROR_NETWORK) {
XBT_INFO("Mmh. Something went wrong. Nevermind. Let's keep going!");