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) {
int main(int argc, char* argv[])
{
simgrid::s4u::Engine e(&argc, argv);
- std::vector<std::string> args;
xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
e.load_platform(argv[1]);
thehost->set_property(exist, "180");
}
-static int alice(int argc, char* argv[])
+static void alice(std::vector<std::string> /*args*/)
{
/* Dump what we have on the current host */
test_host("host1");
- return 0;
}
-static int carole(int argc, char* argv[])
+static void carole(std::vector<std::string> /*args*/)
{
/* Dump what we have on a remote host */
simgrid::s4u::this_actor::sleep_for(1); // Wait for alice to be done with its experiment
test_host("host1");
- return 0;
}
-static int david(int argc, char* argv[])
+static void david(std::vector<std::string> /*args*/)
{
/* Dump what we have on a remote host */
simgrid::s4u::this_actor::sleep_for(2); // Wait for alice and carole to be done with its experiment
test_host("node-0.acme.org");
- return 0;
}
-static int bob(int argc, char* argv[])
+static void bob(std::vector<std::string> /*args*/)
{
/* this host also tests the properties of the AS*/
simgrid::s4u::NetZone* root = simgrid::s4u::Engine::get_instance()->get_netzone_root();
value = simgrid::s4u::Actor::self()->get_property(noexist);
xbt_assert(not value, "The property is defined (it should not)");
- return 0;
}
int main(int argc, char* argv[])