X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b5153dbf05347b73879a8eff9702e9411c61cb56..41f8a753a029e349539da446fc3e63fda2789f1d:/examples/msg/cloud/two_tasks_vm.c diff --git a/examples/msg/cloud/two_tasks_vm.c b/examples/msg/cloud/two_tasks_vm.c index a4c1017e54..0e2aaabea3 100644 --- a/examples/msg/cloud/two_tasks_vm.c +++ b/examples/msg/cloud/two_tasks_vm.c @@ -1,9 +1,8 @@ -/* - * vm_bug.c - * - * Created on: Jan 30, 2014 - * Author: bedaride - */ +/* Copyright (c) 2014. 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. */ #include #include "msg/msg.h" @@ -65,10 +64,10 @@ static int master_main(int argc, char *argv[]) msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t); msg_vm_t vm0; vm0 = MSG_vm_create_core(pm0, "VM0"); - + MSG_vm_start(vm0); //MSG_process_sleep(1); - launch_computation_worker(pm0); + launch_computation_worker(vm0); while(MSG_get_clock()<100) { if (atask != NULL) @@ -77,6 +76,8 @@ static int master_main(int argc, char *argv[]) } MSG_process_sleep(10000); + MSG_vm_destroy(vm0); + xbt_dynar_free(&hosts_dynar); return 1; } @@ -102,6 +103,7 @@ int main(int argc, char *argv[]){ int res = MSG_main(); XBT_INFO("Bye (simulation time %g)", MSG_get_clock()); + xbt_dynar_free(&hosts_dynar); return !(res == MSG_OK); }