X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/c771a55e40d2a41d607a0da1b67cd1f7d546ccc8..325b135f0ee33c6c0242a14e2f58a54fb571b032:/options.cpp?ds=sidebyside diff --git a/options.cpp b/options.cpp index 61861f0..4f9c52c 100644 --- a/options.cpp +++ b/options.cpp @@ -8,7 +8,7 @@ #include #include "misc.h" -XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simu); +XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(main); namespace opt { @@ -28,6 +28,7 @@ namespace opt { bool bookkeeping = false; cost_func comp_cost("1e9, 0"); // fixme: find better defaults + cost_func comm_cost("1, 0"); // fixme: find better defaults } // namespace opt @@ -49,7 +50,7 @@ int opt::parse_args(int* argc, char* argv[]) int c; opterr = 0; - while ((c = getopt(*argc, argv, "bc:ehi:l:V")) != -1) { + while ((c = getopt(*argc, argv, "bc:C:ehi:l:V")) != -1) { switch (c) { case 'b': opt::bookkeeping = true; @@ -63,6 +64,9 @@ int opt::parse_args(int* argc, char* argv[]) case 'c': opt::comp_cost = cost_func(optarg); break; + case 'C': + opt::comm_cost = cost_func(optarg); + break; case 'i': std::istringstream(optarg) >> opt::maxiter; break; @@ -114,6 +118,7 @@ void opt::print() INFO1("| exit on close.......: %s", on_off(opt::exit_on_close)); INFO1("| bookkeeping.........: %s", on_off(opt::bookkeeping)); INFO1("| comp. cost factors..: [%s]", opt::comp_cost.to_string().c_str()); + INFO1("| comm. cost factors..: [%s]", opt::comm_cost.to_string().c_str()); INFO0("`----"); } @@ -140,6 +145,9 @@ void opt::usage() std::clog << oo("-c", "[fn,...]f0") << "polynomial factors for computation cost (" << opt::comp_cost.to_string() << ")\n"; + std::clog << oo("-C", "[fn,...]f0") + << "polynomial factors for communication cost (" + << opt::comm_cost.to_string() << ")\n"; std::clog << o("-e") << "exit on close reception\n"; std::clog << oo("-i", "value") << "maximum number of iterations, 0 for infinity ("