Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Wait a while before effective shutdown.
[simgrid.git] / examples / msg / cloud / masterslave_virtual_machines.c
index bfbc81f..e1527eb 100644 (file)
@@ -63,7 +63,11 @@ int master(int argc, char *argv[]) {
     argv[0] = xbt_strdup(slavename);
     argv[1] = bprintf("%d",i);
     argv[2] = NULL;
-    msg_vm_t vm = MSG_vm_start(slaves[i],2);
+
+    char vmName[64];
+    snprintf(vmName, 64, "vm_%d", i);
+
+    msg_vm_t vm = MSG_vm_start(slaves[i],vmName,2);
     MSG_vm_bind(vm, MSG_process_create_with_arguments(slavename,slave_fun,NULL,slaves[i],2,argv));
   }
 
@@ -130,6 +134,9 @@ int master(int argc, char *argv[]) {
     MSG_task_send(finalize, mailbox_buffer);
   }
 
+  XBT_INFO("Wait a while before effective shutdown.");
+  MSG_process_sleep(2);
+
   xbt_dynar_foreach(vms,i,vm) {
     MSG_vm_shutdown(vm);
     MSG_vm_destroy(vm);