From b4ded7fdcd100a44224a46313dad6d86edbf89c0 Mon Sep 17 00:00:00 2001 From: Samuel Lepetit Date: Wed, 4 Jul 2012 16:35:16 +0200 Subject: [PATCH 1/1] Update cloud example to use MSG_vm_reboot. Update the tesh file --- examples/msg/cloud/masterslave_virtual_machines.c | 8 ++++++-- examples/msg/cloud/masterslave_virtual_machines.tesh | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/msg/cloud/masterslave_virtual_machines.c b/examples/msg/cloud/masterslave_virtual_machines.c index 4d6a84d794..d1df1c7edb 100644 --- a/examples/msg/cloud/masterslave_virtual_machines.c +++ b/examples/msg/cloud/masterslave_virtual_machines.c @@ -66,6 +66,7 @@ int master(int argc, char *argv[]) { MSG_vm_bind(vm, MSG_process_create_with_arguments(slavename,slave_fun,NULL,slaves[i],2,argv)); } + xbt_dynar_t vms = MSG_vms_as_dynar(); XBT_INFO("Launched %ld VMs", xbt_dynar_length(vms)); @@ -99,6 +100,10 @@ int master(int argc, char *argv[]) { MSG_vm_bind(vm, MSG_process_create_with_arguments(slavename,slave_fun,NULL,slaves[i],2,argv)); } + XBT_INFO("Reboot all the VMs"); + for (i=0;i=2, "slave processes need to be given their rank as parameter"); mailbox_name=bprintf("Slave_%s",argv[1]); - + XBT_INFO("Slave listenning on %s",argv[1]); while (1) { res = MSG_task_receive(&(task),mailbox_name); xbt_assert(res == MSG_OK, "MSG_task_get failed"); diff --git a/examples/msg/cloud/masterslave_virtual_machines.tesh b/examples/msg/cloud/masterslave_virtual_machines.tesh index f63e78db99..e3e62a5373 100644 --- a/examples/msg/cloud/masterslave_virtual_machines.tesh +++ b/examples/msg/cloud/masterslave_virtual_machines.tesh @@ -116,3 +116,4 @@ $ $SG_TEST_EXENV ${bindir:=.}/cloud/masterslave_virtual_machines$EXEEXT ${srcdir > [ 2835.981646] (0:@) Simulation time 2835.98 > [ 2835.981646] (11:Slave 9@Provost) Received "finalize" from mailbox Slave_9 > [ 2835.981646] (1:master@Jacquelin) Goodbye now! + -- 2.20.1