Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
one step toward a live migration plugin
[simgrid.git] / examples / msg / cloud-capping / cloud-capping.c
index b27d11e..5ef1028 100644 (file)
@@ -1,10 +1,10 @@
-/* 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. */
 
 #include "simgrid/msg.h"
+#include "simgrid/plugins/live_migration.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
@@ -76,8 +76,8 @@ static void test_dynamic_change(void)
   MSG_process_create("worker0", worker_busy_loop_main, &task0, (msg_host_t)vm0);
   MSG_process_create("worker1", worker_busy_loop_main, &task1, (msg_host_t)vm1);
 
-  double task0_remain_prev = MSG_task_get_remaining_work_ratio(task0);
-  double task1_remain_prev = MSG_task_get_remaining_work_ratio(task1);
+  double task0_remain_prev = MSG_task_get_flops_amount(task0);
+  double task1_remain_prev = MSG_task_get_flops_amount(task1);
 
   const double cpu_speed = MSG_host_get_speed(pm0);
   for (int i = 0; i < 10; i++) {
@@ -86,8 +86,8 @@ static void test_dynamic_change(void)
     MSG_vm_set_bound(vm1, new_bound);
     MSG_process_sleep(100);
 
-    double task0_remain_now = MSG_task_get_remaining_work_ratio(task0);
-    double task1_remain_now = MSG_task_get_remaining_work_ratio(task1);
+    double task0_remain_now = MSG_task_get_flops_amount(task0);
+    double task1_remain_now = MSG_task_get_flops_amount(task1);
 
     double task0_flops_per_sec = task0_remain_prev - task0_remain_now;
     double task1_flops_per_sec = task1_remain_prev - task1_remain_now;
@@ -297,6 +297,7 @@ int main(int argc, char *argv[])
 {
   /* Get the arguments */
   MSG_init(&argc, argv);
+  MSG_vm_live_migration_plugin_init();
 
   /* load the platform file */
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/small_platform.xml\n", argv[0], argv[0]);