Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not talk about tasks anymore
[simgrid.git] / examples / s4u / energy-exec / s4u-energy-exec.cpp
index 7e90219ecee4a7a5d92970919093232308b19bfa..f8afce0c08ac5db40f7530b444abe64fa4d0a3fd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2020. 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. */
@@ -13,7 +13,7 @@ static void dvfs()
   simgrid::s4u::Host* host1 = simgrid::s4u::Host::by_name("MyHost1");
   simgrid::s4u::Host* host2 = simgrid::s4u::Host::by_name("MyHost2");
 
-  XBT_INFO("Energetic profile: %s", host1->get_property("watt_per_state"));
+  XBT_INFO("Energetic profile: %s", host1->get_property("wattage_per_state"));
   XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", host1->get_speed(),
            sg_host_get_consumed_energy(host1));
 
@@ -26,13 +26,13 @@ static void dvfs()
   // Execute something
   start             = simgrid::s4u::Engine::get_clock();
   double flopAmount = 100E6;
-  XBT_INFO("Run a task of %.0E flops", flopAmount);
+  XBT_INFO("Run a computation of %.0E flops", flopAmount);
   simgrid::s4u::this_actor::execute(flopAmount);
-  XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW"
-           " depending on load; Energy dissipated=%.0f J",
-           simgrid::s4u::Engine::get_clock() - start, host1->get_speed(),
-           sg_host_get_wattmin_at(host1, host1->get_pstate()), sg_host_get_wattmax_at(host1, host1->get_pstate()),
-           sg_host_get_consumed_energy(host1));
+  XBT_INFO(
+      "Computation done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW"
+      " depending on load; Energy dissipated=%.0f J",
+      simgrid::s4u::Engine::get_clock() - start, host1->get_speed(), sg_host_get_wattmin_at(host1, host1->get_pstate()),
+      sg_host_get_wattmax_at(host1, host1->get_pstate()), sg_host_get_consumed_energy(host1));
 
   // ========= Change power peak =========
   int pstate = 2;
@@ -40,11 +40,11 @@ static void dvfs()
   XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)", pstate,
            host1->get_pstate_speed(pstate), host1->get_speed());
 
-  // Run another task
+  // Run another computation
   start = simgrid::s4u::Engine::get_clock();
-  XBT_INFO("Run a task of %.0E flops", flopAmount);
+  XBT_INFO("Run a computation of %.0E flops", flopAmount);
   simgrid::s4u::this_actor::execute(flopAmount);
-  XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
+  XBT_INFO("Computation done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
            simgrid::s4u::Engine::get_clock() - start, host1->get_speed(), sg_host_get_consumed_energy(host1));
 
   start = simgrid::s4u::Engine::get_clock();