Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleaning the actor twice seems somewhat overplayed
[simgrid.git] / src / smpi / plugins / load_balancer / load_balancer.hpp
index ff94b57..69b2dae 100644 (file)
@@ -1,3 +1,7 @@
+/* Copyright (c) 2006-2019. 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. */
 
 #ifndef HAVE_SG_PLUGIN_LB
 #define HAVE_SG_PLUGIN_LB
@@ -41,7 +45,7 @@ public:
     return host_to_actors.count(host); // TODO This is linear in the size of the map. Maybe replace by constant lookup through another map?
   }
 
-  void for_each_actor(simgrid::s4u::Host* host, std::function<void(simgrid::s4u::ActorPtr)> callback)
+  void for_each_actor(simgrid::s4u::Host* host, const std::function<void(simgrid::s4u::ActorPtr)>& callback)
   {
     auto range = host_to_actors.equal_range(host);
     std::for_each(
@@ -66,9 +70,8 @@ public:
   /**
    * FIXME These are functions used for testing and should be re-written or removed
    */
-  simgrid::s4u::Host* get_mapping();
+  simgrid::s4u::Host* get_mapping(simgrid::s4u::ActorPtr);
   void record_actor_computation(simgrid::s4u::ActorPtr actor, double load);
-private:
 };
 
 }