X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dd96d5146134f3ff468a7835db49556c8e6225a5..b4ace96f8a501a6659817d9741aeb103cbcfd2c4:/src/smpi/plugins/load_balancer/LoadBalancer.cpp diff --git a/src/smpi/plugins/load_balancer/LoadBalancer.cpp b/src/smpi/plugins/load_balancer/LoadBalancer.cpp index dde6fa6ac8..cc67e00628 100644 --- a/src/smpi/plugins/load_balancer/LoadBalancer.cpp +++ b/src/smpi/plugins/load_balancer/LoadBalancer.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. */ +/* 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. */ @@ -42,20 +42,11 @@ bool compare_hosts::operator()(simgrid::s4u::Host* const a, simgrid::s4u::Host* } -LoadBalancer::LoadBalancer() -{ -} - -LoadBalancer::~LoadBalancer() -{ -} - void LoadBalancer::run() { simgrid::s4u::Engine* engine = simgrid::s4u::Engine::get_instance(); - std::vector available_hosts = engine->get_filtered_hosts([](simgrid::s4u::Host* host) { - return not host->is_off(); - }); + std::vector available_hosts = + engine->get_filtered_hosts([](simgrid::s4u::Host* host) { return host->is_on(); }); xbt_assert(available_hosts.size() > 0, "No hosts available; are they all switched off?"); // TODO: Account for daemon background load (-> use especially the availability file) @@ -145,9 +136,9 @@ simgrid::s4u::Host* LoadBalancer::get_mapping(simgrid::s4u::ActorPtr actor) return new_mapping.get_host(actor); } -void LoadBalancer::record_actor_computation(simgrid::s4u::ActorPtr actor, double load) +void LoadBalancer::record_actor_computation(simgrid::s4u::Actor const& actor, double load) { - actor_computation[actor->get_pid()] += load; + actor_computation[actor.get_pid()] += load; } } }