Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove completely the energy concern from the core
[simgrid.git] / examples / msg / energy / onoff / onoff.c
index 6287a86..56ce160 100644 (file)
@@ -4,11 +4,11 @@
 /* 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<stdio.h>
+#include <stdio.h>
 
 #include "simgrid/msg.h"
 #include "xbt/sysdep.h"         /* calloc */
-#include "simgrid/plugins.h"
+#include "simgrid/plugins/energy.h"
 
 /* Create a log channel to have nice outputs. */
 #include "xbt/log.h"
@@ -70,25 +70,25 @@ static int onoff(int argc, char *argv[]) {
        XBT_INFO("Energetic profile: %s",
                        MSG_host_get_property_value(host1,"watt_per_state"));
        XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J",
-                       MSG_host_get_current_power_peak(host1), MSG_host_get_consumed_energy(host1));
+                       MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
        XBT_INFO("Sleep for 10 seconds");
        MSG_process_sleep(10);
        XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J",
-                       MSG_host_get_current_power_peak(host1), MSG_host_get_consumed_energy(host1));
+                       MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
        simulate_shutdown(host1);
        XBT_INFO("Host1 is now OFF. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
-                       MSG_host_get_current_power_peak(host1), MSG_host_get_consumed_energy(host1));
+                       MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
        XBT_INFO("Sleep for 10 seconds");
        MSG_process_sleep(10);
        XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J",
-                       MSG_host_get_current_power_peak(host1), MSG_host_get_consumed_energy(host1));
+                       MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
        simulate_bootup(host1);
        XBT_INFO("Host1 is now ON again. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
-                       MSG_host_get_current_power_peak(host1), MSG_host_get_consumed_energy(host1));
+                       MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
 
 
        return 0;