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

Private GIT Repository
Bug fix: we really need to consume all messages in proc::receive!
[loba.git] / options.cpp
index 827a064935cfa4d2fdeb4572e258c5d22a100d18..fd9b8f7c435ba6c071b355aa40328f9fccb62b1f 100644 (file)
@@ -170,13 +170,14 @@ bool opt::parse_args(int* argc, char* argv[])
     
     int c;
     opterr = 0;
-    while ((c = getopt(*argc, argv, "a:bc:C:ehi:I:l:L:N:T:vV")) != -1) {
+    while ((c = getopt(*argc, argv, "a:bc:C:ehi:I:l:L:N:s:T:vV")) != -1) {
         switch (c) {
         case 'a':
             opt::loba_algo = optarg;
             result = opt_helper::nol_find_prefix(opt::loba_algorithms,
                                                  "load balancing algorithm",
-                                                 opt::loba_algo);
+                                                 opt::loba_algo)
+                && result;
             break;
         case 'b':
             opt::bookkeeping = true;
@@ -210,10 +211,14 @@ bool opt::parse_args(int* argc, char* argv[])
         case 'N':
             std::istringstream(optarg) >> opt::auto_depl::nhosts;
             break;
+        case 's':
+            std::istringstream(optarg) >> communicator::send_count_before_flush;
+            break;
         case 'T':
             opt::auto_depl::topology = optarg;
             result = opt_helper::nol_find_prefix(opt::topologies, "topology",
-                                                 opt::auto_depl::topology);
+                                                 opt::auto_depl::topology)
+                && result;
             break;
         case 'v':
             // nothing to do: this option is checked at the very
@@ -280,6 +285,8 @@ void opt::print()
     DESCR("maximum number of lb. iterations", "%s",
           h.val_or_string(lb_maxiter, "infinity"));
     DESCR("exit on close", "%s",                h.on_off(exit_on_close));
+    DESCR("send count before flush", "%d",
+          communicator::send_count_before_flush);
     INFO0("`----");
 
 #undef DESCR
@@ -369,6 +376,11 @@ void opt::usage()
               << "        proc : messages from base process class\n"
               << "        loba : messages from load-balancer\n";
 
+    std::clog << "\nMiscellaneous low-level parameters\n";
+    std::clog << o("-s count")
+              << "check for finished comm. every `count' send operation"
+              << " (" << communicator::send_count_before_flush << ")\n";
+
 #undef so_list
 #undef so
 #undef o