A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Wait a while before effective shutdown.
[simgrid.git]
/
examples
/
msg
/
cloud
/
masterslave_virtual_machines.c
diff --git
a/examples/msg/cloud/masterslave_virtual_machines.c
b/examples/msg/cloud/masterslave_virtual_machines.c
index
bfbc81f
..
e1527eb
100644
(file)
--- a/
examples/msg/cloud/masterslave_virtual_machines.c
+++ b/
examples/msg/cloud/masterslave_virtual_machines.c
@@
-63,7
+63,11
@@
int master(int argc, char *argv[]) {
argv[0] = xbt_strdup(slavename);
argv[1] = bprintf("%d",i);
argv[2] = NULL;
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));
}
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);
}
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);
xbt_dynar_foreach(vms,i,vm) {
MSG_vm_shutdown(vm);
MSG_vm_destroy(vm);