Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
partially fix the energy public API (massive renames ongoing)
[simgrid.git] / examples / msg / energy / e1 / e1.c
index 74013fb..bfbb0c0 100644 (file)
@@ -1,8 +1,9 @@
-/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013-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 "msg/msg.h"
 #include "xbt/sysdep.h"         /* calloc */
 
@@ -37,10 +38,10 @@ int dvfs(int argc, char *argv[])
   int new_peak_index=2;
   host = MSG_host_self();; //MSG_get_host_by_name("MyHost1");
 
-  int nb = MSG_get_host_nb_pstates(host);
+  int nb = MSG_host_get_pstate_number(host);
   XBT_INFO("Number of Processor states=%d", nb);
 
-  double current_peak = MSG_get_host_current_power_peak(host);
+  double current_peak = MSG_host_get_current_power_peak(host);
   XBT_INFO("Current power peak=%f", current_peak);
 
   // Run a task
@@ -58,12 +59,12 @@ int dvfs(int argc, char *argv[])
          return 0;
          }
 
-  double peak_at = MSG_get_host_power_peak_at(host, new_peak_index);
+  double peak_at = MSG_host_get_power_peak_at(host, new_peak_index);
   XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_peak_index);
 
-  MSG_set_host_power_peak_at(host, new_peak_index);
+  MSG_host_set_pstate(host, new_peak_index);
 
-  current_peak = MSG_get_host_current_power_peak(host);
+  current_peak = MSG_host_get_current_power_peak(host);
   XBT_INFO("Current power peak=%f", current_peak);
 
   // Run a second task
@@ -77,10 +78,10 @@ int dvfs(int argc, char *argv[])
 
   // Verify the default pstate is set to 0
   host = MSG_get_host_by_name("MyHost2");
-  int nb2 = MSG_get_host_nb_pstates(host);
+  int nb2 = MSG_host_get_pstate_number(host);
   XBT_INFO("Number of Processor states=%d", nb2);
 
-  double current_peak2 = MSG_get_host_current_power_peak(host);
+  double current_peak2 = MSG_host_get_current_power_peak(host);
   XBT_INFO("Current power peak=%f", current_peak2);
   return 0;
 }