-/* Copyright (c) 2010-2014. The SimGrid Team.
+/* Copyright (c) 2010-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
char mailbox[256];
msg_task_t task = NULL;
- msg_host_t jupiter = MSG_get_host_by_name("Jupiter");
+ msg_host_t jupiter = MSG_host_by_name("Jupiter");
sprintf(mailbox, "jupi");
task = MSG_task_create("task on", task_comp_size, task_comm_size, NULL);
char **argvF = xbt_new(char*, 2);
argvF[0] = xbt_strdup("slave");
- MSG_process_create_with_arguments("slave", slave, NULL, MSG_get_host_by_name("Jupiter"), 1, argvF);
+ MSG_process_create_with_arguments("slave", slave, NULL, MSG_host_by_name("Jupiter"), 1, argvF);
task = MSG_task_create("task on with proc", task_comp_size, task_comm_size, NULL);
XBT_INFO("Sending \"%s\"", task->name);
int slave(int argc, char *argv[])
{
msg_task_t task = NULL;
- _XBT_GNUC_UNUSED int res;
+ XBT_ATTRIB_UNUSED int res;
int id = -1;
char mailbox[80];
const char *application_file;
MSG_init(&argc, argv);
- if (argc != 3) {
- printf("Usage: %s platform_file deployment_file\n", argv[0]);
- printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
+
platform_file = argv[1];
application_file = argv[2];
- /* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
MSG_create_environment(platform_file);
}
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
} /* end_of_main */