Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Give a LD_LIBRARY_PATH to java tests
[simgrid.git] / teshsuite / msg / host_on_off / host_on_off.c
index fa7b228..fcb42c6 100644 (file)
@@ -13,9 +13,7 @@ static int slave(int argc, char *argv[])
   msg_task_t task = NULL;
   XBT_ATTRIB_UNUSED int res;
   int id = -1;
-  char mailbox[80];
-
-  sprintf(mailbox, "jupi");
+  const char * mailbox = "jupi";
 
   while (1) {
     res = MSG_task_receive(&(task), mailbox);
@@ -41,10 +39,9 @@ static int master(int argc, char *argv[])
   double task_comp_size = 5E7;
   double task_comm_size = 1E6;
 
-  char mailbox[256];
+  const char * mailbox = "jupi";
   msg_task_t task = NULL;
   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);
   XBT_INFO("Sending \"%s\"", task->name);
@@ -94,14 +91,12 @@ int main(int argc, char *argv[])
   msg_error_t res;
 
   MSG_init(&argc, 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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
 
   MSG_create_environment(argv[1]);
 
-  MSG_function_register("master", master);
-  MSG_function_register("slave", slave);
-  MSG_launch_application(argv[2]);
+  MSG_process_create("master", master, NULL, MSG_get_host_by_name("Tremblay"));
+  MSG_process_create("slave", slave, NULL, MSG_get_host_by_name("Jupiter"));
 
   res = MSG_main();