Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't test equality to 0.
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 6 Oct 2016 23:01:06 +0000 (01:01 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 6 Oct 2016 23:01:06 +0000 (01:01 +0200)
src/surf/plugins/energy.cpp

index 3d7c8a853348badaf7d7255af8861219b438958c..9a8879cd816b040740b9123d6aa01ea8c9fcee3c 100644 (file)
@@ -1,17 +1,16 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010, 2012-2016. 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 <utility>
-
 #include "simgrid/plugins/energy.h"
 #include "simgrid/simix.hpp"
 #include "src/surf/plugins/energy.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/virtual_machine.hpp"
 
+#include <utility>
+
 /** @addtogroup SURF_plugin_energy
 
 
@@ -151,7 +150,7 @@ double HostEnergy::getCurrentWattsValue(double cpu_load)
   double max_power     = 0;
   double power_slope   = 0;
 
-  if (cpu_load != 0) { /* Something is going on, the machine is not idle */
+  if (cpu_load > 0) { /* Something is going on, the machine is not idle */
     double min_power = range.min;
     double max_power = range.max;
     double power_slope = max_power - min_power;