X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5dc8aedf8d80b2eba1577a7b6087b219709e5f6b..57e13ab95885f11dae52bfc84d269a2314db06e8:/examples/msg/cloud-masterworker/cloud-masterworker.c diff --git a/examples/msg/cloud-masterworker/cloud-masterworker.c b/examples/msg/cloud-masterworker/cloud-masterworker.c index 181b22e822..17242ba56d 100644 --- a/examples/msg/cloud-masterworker/cloud-masterworker.c +++ b/examples/msg/cloud-masterworker/cloud-masterworker.c @@ -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,13 +86,13 @@ static int master_fun(int argc, char *argv[]) s_vm_params_t params; memset(¶ms, 0, sizeof(params)); params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes - MSG_host_set_params(vm, ¶ms); + MSG_vm_set_params(vm, ¶ms); MSG_vm_start(vm); xbt_dynar_push(vms, &vm); XBT_INFO("put a process (%s) on %s", pr_name, vm_name); - MSG_process_create(pr_name, worker_fun, NULL, vm); + MSG_process_create(pr_name, worker_fun, NULL, (msg_host_t)vm); xbt_free(vm_name); xbt_free(pr_name); @@ -105,7 +104,7 @@ static int master_fun(int argc, char *argv[]) XBT_INFO("# Suspend all VMs"); xbt_dynar_foreach(vms, i, vm) { - XBT_INFO("suspend %s", MSG_host_get_name(vm)); + XBT_INFO("suspend %s", MSG_vm_get_name(vm)); MSG_vm_suspend(vm); } @@ -127,7 +126,7 @@ static int master_fun(int argc, char *argv[]) char *pr_name = bprintf("WRK%02d", index); XBT_INFO("put a process (%s) on %s", pr_name, vm_name); - MSG_process_create(pr_name, worker_fun, NULL, vm); + MSG_process_create(pr_name, worker_fun, NULL, (msg_host_t)vm); xbt_free(vm_name); xbt_free(pr_name); @@ -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); } @@ -162,9 +161,9 @@ static int master_fun(int argc, char *argv[]) XBT_INFO("# Shutdown and destroy all the VMs. The remaining worker processes will be forcibly killed."); xbt_dynar_foreach(vms, i, vm) { - XBT_INFO("shutdown %s", MSG_host_get_name(vm)); + XBT_INFO("shutdown %s", MSG_vm_get_name(vm)); MSG_vm_shutdown(vm); - XBT_INFO("destroy %s", MSG_host_get_name(vm)); + XBT_INFO("destroy %s", MSG_vm_get_name(vm)); MSG_vm_destroy(vm); }