#include <algorithm>
#include <tr1/functional>
#include <iterator>
+#include <numeric>
#include <stdexcept>
#include <sstream>
#include <xbt/log.h>
return last_status;
}
+double process::get_sum_of_to_send() const
+{
+ using std::tr1::bind;
+ using std::tr1::placeholders::_1;
+ using std::tr1::placeholders::_2;
+
+ return std::accumulate(neigh.begin(), neigh.end(), 0.0,
+ bind(std::plus<double>(),
+ _1, bind(&neighbor::get_to_send, _2)));
+}
+
void process::load_balance()
{
if (lb_iter == 1) // warn only once
bool still_running();
+ // Returns the sum of "to_send" for all neighbors.
+ double get_sum_of_to_send() const;
+
// Send procedures
void ctrl_send(neighbor& nb);
void data_send(neighbor& nb);