comp_iter, load);
}
- if (opt::bookkeeping)
- expected_load -= load_balance(expected_load);
- else
- load -= load_balance(load);
+ double ld = lb_load();
+ ld -= load_balance(ld);
+ lb_load() = ld;
print_loads(true, xbt_log_priority_debug);
// block on receiving unless there is something to compute or
// to send
- bool wait = (load == 0 &&
- ((opt::bookkeeping ? expected_load : load)
- == prev_load_broadcast));
+ bool wait = (load == 0 && lb_load() == prev_load_broadcast);
receive(wait);
// one of our neighbor is finalizing
#include <xbt/log.h>
#include "communicator.h"
#include "neighbor.h"
+#include "options.h"
class process {
public:
double load; // current load
double expected_load; // expected load in bookkeeping mode
+ double& lb_load() { return opt::bookkeeping ? expected_load : load; }
+
// The load balancing algorithm comes here...
// Parameter "my_load" is the load to take into account for myself
// (may be load or expected load).