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

Private GIT Repository
Wip++...
[loba.git] / process.cpp
index d8ec50036a4d6d9d2e93568bc944604bba118375..bc71b9d270a153f5cf20c517b0da2c8cdbb12879 100644 (file)
@@ -30,7 +30,6 @@ process::process(int argc, char* argv[])
     e_xbt_log_priority_t logp = xbt_log_priority_verbose;
     if (!LOG_ISENABLED(logp))
         return;
     e_xbt_log_priority_t logp = xbt_log_priority_verbose;
     if (!LOG_ISENABLED(logp))
         return;
-    LOG1(logp, "My initial load is: %g", load);
     std::ostringstream oss;
     oss << neigh.size() << " neighbor";
     if (!neigh.empty()) {
     std::ostringstream oss;
     oss << neigh.size() << " neighbor";
     if (!neigh.empty()) {
@@ -48,16 +47,21 @@ int process::run()
 {
     bool one_more = true;
     unsigned iter = 0;
 {
     bool one_more = true;
     unsigned iter = 0;
+
+    INFO1("Initial load: %g", load);
     VERB0("Starting...");
     while (one_more) {
         bool close_received;
     VERB0("Starting...");
     while (one_more) {
         bool close_received;
+        ++iter;
 
 
-        if (opt::bookkeeping)
-            INFO3("(%u) current load: %g ; expected: %g",
-                  iter, load, expected_load);
-        else
-            INFO2("(%u) current load: %g",
-                  iter, load);
+        if (opt::log_rate && iter % opt::log_rate == 0) {
+            if (opt::bookkeeping)
+                INFO3("(%u) current load: %g ; expected: %g",
+                      iter, load, expected_load);
+            else
+                INFO2("(%u) current load: %g",
+                      iter, load);
+        }
 
         compute();
         close_received = !receive(false);
 
         compute();
         close_received = !receive(false);
@@ -68,7 +72,6 @@ int process::run()
          */
 
         comm.flush(false);
          */
 
         comm.flush(false);
-        ++iter;
 
         if (opt::exit_on_close && close_received)
             one_more = false;
 
         if (opt::exit_on_close && close_received)
             one_more = false;
@@ -85,6 +88,11 @@ int process::run()
      */
 
     VERB0("Done.");
      */
 
     VERB0("Done.");
+    if (opt::bookkeeping)
+        INFO4("Final load after %d iteration%s: %g ; expected: %g",
+              iter, ESSE(iter), load, expected_load);
+    else
+        INFO3("Final load after %d iteration%s: %g", iter, ESSE(iter), load);
     return 0;
 }
 
     return 0;
 }