X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/558e19f535bb0c65b610bc758c8133ded549ca3c..d1614bd7c880c562af7dce339b0564a21f30c24d:/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 8d31f14b12..bcbb01ade0 100644 --- a/examples/msg/cloud-masterworker/cloud-masterworker.c +++ b/examples/msg/cloud-masterworker/cloud-masterworker.c @@ -1,9 +1,12 @@ -/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2018. 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 "simgrid/msg.h" +#include "simgrid/plugins/live_migration.h" + +#include /* snprintf */ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); @@ -83,10 +86,7 @@ static int master_fun(int argc, char *argv[]) XBT_INFO("create %s on PM(%s)", vm_name, MSG_host_get_name(pm)); msg_vm_t vm = MSG_vm_create_core(pm, vm_name); - s_vm_params_t params; - memset(¶ms, 0, sizeof(params)); - params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes - MSG_vm_set_params(vm, ¶ms); + MSG_vm_set_ramsize(vm, 1L * 1024 * 1024 * 1024); // 1GiB MSG_vm_start(vm); xbt_dynar_push(vms, &vm); @@ -122,8 +122,8 @@ static int master_fun(int argc, char *argv[]) XBT_INFO("# Add one more process on each VM"); xbt_dynar_foreach(vms, i, vm) { unsigned int index = i + xbt_dynar_length(vms); - char *vm_name = bprintf("VM%02u", i); - char *pr_name = bprintf("WRK%02u", index); + char* vm_name = bprintf("VM%02u", i); + char* pr_name = bprintf("WRK%02u", index); XBT_INFO("put a process (%s) on %s", pr_name, vm_name); MSG_process_create(pr_name, worker_fun, NULL, (msg_host_t)vm); @@ -178,7 +178,9 @@ int main(int argc, char *argv[]) const int nb_workers = 2; MSG_init(&argc, argv); - xbt_assert(argc >1,"Usage: %s example/platforms/cluster.xml\n", argv[0]); + MSG_vm_live_migration_plugin_init(); + + xbt_assert(argc >1,"Usage: %s example/platforms/cluster_backbone.xml\n", argv[0]); /* Load the platform file */ MSG_create_environment(argv[1]);