Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
yet another bunch of int -> unsigned long
[simgrid.git] / src / plugins / host_dvfs.cpp
index 85ed693c7b40e68ea2b7e3afac2fc1841f573c17..bb830cf0747c668ea3de8b2fbf344a7266f9a96d 100644 (file)
@@ -205,7 +205,7 @@ public:
        */
       // Load is now < freq_up_threshold; exclude pstate 0 (the fastest)
       // because pstate 0 can only be selected if load > freq_up_threshold_
-      unsigned long new_pstate = static_cast<unsigned long>(get_max_pstate() - load * (get_max_pstate() + 1));
+      auto new_pstate = get_max_pstate() - static_cast<unsigned long>(load) * (get_max_pstate() + 1);
       if (new_pstate < get_min_pstate())
         new_pstate = get_min_pstate();
       get_host()->set_pstate(new_pstate);