Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
correctly use clumsy xbt_dynar interface
[simgrid.git] / examples / msg / cloud-masterworker / cloud-masterworker.c
index ab01626..41fa989 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -87,7 +86,7 @@ static int master_fun(int argc, char *argv[])
     s_vm_params_t params;
     memset(&params, 0, sizeof(params));
     params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
-    MSG_host_set_params(vm, &params);
+    MSG_vm_set_params(vm, &params);
 
     MSG_vm_start(vm);
     xbt_dynar_push(vms, &vm);
@@ -118,7 +117,7 @@ static int master_fun(int argc, char *argv[])
   }
 
   XBT_INFO("# Sleep long enough for everyone to be done with previous batch of work");
-  MSG_process_sleep(1000 - MSG_get_clock());
+  MSG_process_sleep(10 - MSG_get_clock());
 
   XBT_INFO("# Add one more process on each VM");
   xbt_dynar_foreach(vms, i, vm) {
@@ -152,7 +151,7 @@ static int master_fun(int argc, char *argv[])
   XBT_INFO("# Shutdown the half of worker processes gracefully. The remaining half will be forcibly killed.");
   for (i = 0; i < nb_workers; i++) {
     char mbox[MAXMBOXLEN];
-    snprintf(mbox, MAXMBOXLEN, "MBOX:WRK%02d", i);
+    snprintf(mbox, MAXMBOXLEN, "MBOX:WRK%02u", i);
     msg_task_t finalize = MSG_task_create("finalize", 0, 0, 0);
     MSG_task_send(finalize, mbox);
   }
@@ -179,7 +178,7 @@ int main(int argc, char *argv[])
   const int nb_workers = 2;
 
   MSG_init(&argc, argv);
-  xbt_assert(argc >1,"Usage: %s example/msg/msg_platform.xml\n", argv[0]);
+  xbt_assert(argc >1,"Usage: %s example/platforms/cluster.xml\n", argv[0]);
 
   /* Load the platform file */
   MSG_create_environment(argv[1]);