#include <stdio.h>
static int master(int argc, char *argv[])
{
xbt_assert(argc==5,
"The master function expects 4 arguments from the XML deployment file");
XBT_INFO(
"Got %ld workers and %ld tasks to process", workers_count, number_of_tasks);
for (int i = 0; i < number_of_tasks; i++) {
char mailbox[80];
char task_name[80];
snprintf(mailbox,79, "worker-%ld", i % workers_count);
snprintf(task_name,79, "Task_%d", i);
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(
"All tasks have been dispatched. Let's tell everybody the computation is over.");
for (int i = 0; i < workers_count; i++) {
char mailbox[80];
snprintf(mailbox,79, "worker-%ld", i % workers_count);
}
return 0;
}
static int worker(int argc, char *argv[])
{
xbt_assert(argc==2,
"The worker expects a single argument from the XML deployment file: its worker ID (its numerical rank)");
char mailbox[80];
snprintf(mailbox,79, "worker-%ld", id);
while (1) {
break;
}
}
return 0;
}
int main(int argc, char *argv[])
{
xbt_assert(argc > 2,
"Usage: %s platform_file deployment_file\n" "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
}