-int master(int argc, char *argv[])
-{
- m_task_t task_s = NULL;
- m_task_t task_r = NULL;
- unsigned int task_comp_size = 50000000;
- unsigned int task_comm_size = 1000000;
- char mailbox[80];
- char buffer[20];
- int num = atoi(argv[1]);
-
- sprintf(mailbox, "host%d", num+1);
- if(num == totalHosts-1)
- sprintf(mailbox, "host%d", 0);
- sprintf(buffer, "Token");
-
- task_s = MSG_task_create(buffer,
- task_comp_size,
- task_comm_size,
- NULL);
- MSG_task_send(task_s,mailbox);
- XBT_INFO("Send Data to \"%s\"", mailbox);
-
- sprintf(mailbox, "host%d", num);
- MSG_task_receive(&(task_r), mailbox);
- XBT_INFO("Received \"%s\"", MSG_task_get_name(task_r));
- return 0;
-}
-
-int slave(int argc, char *argv[])
-{
- m_task_t task_s = NULL;
- m_task_t task_r = NULL;
- unsigned int task_comp_size = 50000000;
- unsigned int task_comm_size = 1000000;
- char mailbox[80];
- char buffer[20];
- int num = atoi(argv[1]);
-
- sprintf(mailbox, "host%d", num);
- MSG_task_receive(&(task_r), mailbox);
- XBT_INFO("Received \"%s\"", MSG_task_get_name(task_r));
- sprintf(mailbox, "host%d", num+1);
- if(num == totalHosts-1)
- sprintf(mailbox, "host%d", 0);
- sprintf(buffer, "Token");
- task_s = MSG_task_create(buffer,
- task_comp_size,
- task_comm_size,
- NULL);
- MSG_task_send(task_s, mailbox);
- XBT_INFO("Send Data to \"%s\"", mailbox);
-
- return 0;
-}
-
-static int surf_parse_bypass_application(void)