]> AND Private Git Repository - loba.git/blobdiff - process.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Remove unused default for 2nd parameter of sleep_until_date.
[loba.git] / process.cpp
index d0bfc21120b8cbc8ea0230b4eb9bb97e4eeb26f3..bf016ef0078225a27b1dc0c50605d1407282ac2d 100644 (file)
@@ -21,7 +21,7 @@ double process::total_load_exit = 0.0;
 
 namespace {
 
-    void sleep_until_date(double& date, double duration = 0.0)
+    void sleep_until_date(double& date, double duration)
     {
         double sleep_duration = date - MSG_get_clock();
         if (sleep_duration > 0.0)
@@ -179,13 +179,13 @@ void process::compute_loop()
 
         comm.data_flush(false);
 
-        if (real_load == 0.0)
-            continue;
-
         // send
         std::for_each(neigh.begin(), neigh.end(),
                       bind(&process::data_send, this, _1));
 
+        if (real_load == 0.0)
+            continue;
+
         // compute
         ++comp_iter;
         double flops = opt::comp_cost(real_load);
@@ -224,6 +224,10 @@ bool process::still_running()
     if (!last_status) {
         /* nop */
 
+    } else if (opt::exit_request) {
+        XBT_VERB("Global exit requested");
+        last_status = false;
+
     } else if (opt::time_limit && MSG_get_clock() >= opt::time_limit) {
         XBT_VERB("Reached time limit: %g/%g", MSG_get_clock(), opt::time_limit);
         last_status = false;