- m_task_t task;
- while ((task = comm.recv())) {
- message *msg = (message *)MSG_task_get_data(task);
- DEBUG3("Received load: %g, info: %g from %s",
- msg->transfer, msg->measure,
- MSG_host_get_name(MSG_task_get_source(task)));
- load += msg->transfer;
- // fixme: what is xxx ???
- // neigh[xxx].setLoad(msg->measure);
- }
+ bool received;
+ do {
+ double amount;
+ m_host_t from;
+ received = false;
+ if (comm.recv_info(amount, from)) {
+ // fixme: update neighbor
+ received = true;
+ }
+ if (comm.recv_credit(amount, from)) {
+ expected_load += amount;
+ received = true;
+ }
+ if (comm.recv_load(amount, from)) {
+ load += amount;
+ received = true;
+ }
+ } while (received);