From: Arnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Date: Wed, 9 Mar 2011 10:13:45 +0000 (+0100)
Subject: Flush pending comms just before send.
X-Git-Tag: v0.1~82
X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/649387470ee21c08fb4763f17dd4720c12ef3a38

Flush pending comms just before send.
---

diff --git a/process.cpp b/process.cpp
index 21eeb7a..54fea8a 100644
--- a/process.cpp
+++ b/process.cpp
@@ -142,6 +142,7 @@ void process::load_balance_loop()
         print_loads(true, xbt_log_priority_debug);
 
         // send
+        comm.ctrl_flush(false);
         std::for_each(neigh.begin(), neigh.end(),
                       bind(&process::ctrl_send, this, _1));
         prev_load_broadcast = expected_load;
@@ -149,8 +150,6 @@ void process::load_balance_loop()
 
         sleep_until_date(next_iter_after_date, opt::min_lb_iter_duration);
         ctrl_receive(0.0);
-
-        comm.ctrl_flush(false);
     }
 
     XBT_VERB("Going to finalize for %s...", __func__);
@@ -181,9 +180,8 @@ void process::compute_loop()
             data_receive(opt::min_comp_iter_duration);
         mutex.release();
 
-        comm.data_flush(false);
-
         // send
+        comm.data_flush(false);
         mutex.acquire();
         std::for_each(neigh.begin(), neigh.end(),
                       bind(&process::data_send, this, _1));