// Load balancing algorithm
std::string loba_algo("simple");
bool bookkeeping = false;
// Load balancing algorithm
std::string loba_algo("simple");
bool bookkeeping = false;
- // fixme: find better defaults
- cost_func comp_cost("1e9, 0");
- cost_func comm_cost("1, 0");
- double min_iter_duration = 1.0;
+ cost_func comp_cost("1e9, 0"); // fixme: find better defaults
+ cost_func comm_cost("1e6, 0"); // fixme: find better defaults
+ double min_comp_iter_duration = 1.0; // fixme: find better defaults
// Named parameters lists
loba_algorithms_type loba_algorithms;
loba_algorithms_type::loba_algorithms_type()
{
NOL_INSERT("fairstrategy", "balance with fair strategy", loba_fairstrategy);
// Named parameters lists
loba_algorithms_type loba_algorithms;
loba_algorithms_type::loba_algorithms_type()
{
NOL_INSERT("fairstrategy", "balance with fair strategy", loba_fairstrategy);
NOL_INSERT("none", "no load-balancing (for testing only)", process);
NOL_INSERT("simple", "balance with least loaded neighbor", loba_simple);
}
NOL_INSERT("none", "no load-balancing (for testing only)", process);
NOL_INSERT("simple", "balance with least loaded neighbor", loba_simple);
}
+template <typename T>
+bool opt_helper::parse_arg(char opt, const char *arg, T& val)
+{
+ std::istringstream str(arg);
+ bool result = (str >> val) && str.eof();
+ if (!result)
+ XBT_ERROR("invalid argument for option '-%c' -- \"%s\"", opt, arg);
+ return result;
+}
+
opt::program_name = argv[0];
opt::program_name.erase(0, 1 + opt::program_name.find_last_of('/'));
opt::program_name = argv[0];
opt::program_name.erase(0, 1 + opt::program_name.find_last_of('/'));
DESCR("log rate", "%s", h.val_or_string(log_rate, "disabled"));
DESCR("platform file", "\"%s\"", platform_file.c_str());
if (auto_depl::enabled) {
DESCR("log rate", "%s", h.val_or_string(log_rate, "disabled"));
DESCR("platform file", "\"%s\"", platform_file.c_str());
if (auto_depl::enabled) {
DESCR("- topology", "%s", auto_depl::topology.c_str());
DESCR("- number of hosts", "%s", h.val_or_string(auto_depl::nhosts,
"auto"));
DESCR("- topology", "%s", auto_depl::topology.c_str());
DESCR("- number of hosts", "%s", h.val_or_string(auto_depl::nhosts,
"auto"));
}
DESCR("load balancing algorithm", "%s", loba_algo.c_str());
DESCR("bookkeeping", "%s", h.on_off(bookkeeping));
}
DESCR("load balancing algorithm", "%s", loba_algo.c_str());
DESCR("bookkeeping", "%s", h.on_off(bookkeeping));
DESCR("computation cost factors", "[%s]", comp_cost.to_string().c_str());
DESCR("communication cost factors", "[%s]", comm_cost.to_string().c_str());
DESCR("computation cost factors", "[%s]", comp_cost.to_string().c_str());
DESCR("communication cost factors", "[%s]", comm_cost.to_string().c_str());
DESCR("maximum number of lb. iterations", "%s",
h.val_or_string(lb_maxiter, "infinity"));
DESCR("maximum number of comp. iterations", "%s",
h.val_or_string(comp_maxiter, "infinity"));
DESCR("time limit", "%s", h.val_or_string(time_limit, "infinity"));
DESCR("exit on close", "%s", h.on_off(exit_on_close));
DESCR("maximum number of lb. iterations", "%s",
h.val_or_string(lb_maxiter, "infinity"));
DESCR("maximum number of comp. iterations", "%s",
h.val_or_string(comp_maxiter, "infinity"));
DESCR("time limit", "%s", h.val_or_string(time_limit, "infinity"));
DESCR("exit on close", "%s", h.on_off(exit_on_close));
- << "print current load every n-th lb iterations, 0 to disable"
- << " (" << opt::log_rate << ")\n";
+ << "print current load every n lb iterations, 0 to disable"
+ << " [" << opt::log_rate << "]\n";
std::clog << o("-v")
<< "verbose: do not override the default logging parameters\n";
std::clog << "\nAutomatic deployment options\n";
std::clog << o("-T name")
<< "enable automatic deployment with selected topology"
std::clog << o("-v")
<< "verbose: do not override the default logging parameters\n";
std::clog << "\nAutomatic deployment options\n";
std::clog << o("-T name")
<< "enable automatic deployment with selected topology"
if (opt::help_requested > 1)
so_list(opt::topologies);
std::clog << o("-L value")
<< "total load with auto deployment, 0 for number of hosts"
if (opt::help_requested > 1)
so_list(opt::topologies);
std::clog << o("-L value")
<< "total load with auto deployment, 0 for number of hosts"
- << "number of hosts to use with auto deployment,"
- << " 0 for max. (" << opt::auto_depl::nhosts << ")\n";
+ << "number of hosts to use with auto deployment, 0 for max."
+ << " [" << opt::auto_depl::nhosts << "]\n";
- std::clog << o("-b") << "enable bookkeeping (\"virtual load\")\n";
+ std::clog << o("-b") << "toggle bookkeeping (\"virtual load\")"
+ << " [" << opt_helper::on_off(opt::bookkeeping) << "]\n";
+ std::clog << o("-s value")
+ << "minimum duration between lb. iterations"
+ << " [" << opt::min_lb_iter_duration << "]\n";
- << " (" << opt::comp_cost.to_string() << ")\n";
- std::clog << o("-C [fn,...]f0")
+ << " [" << opt::comp_cost.to_string() << "]\n";
+ std::clog << o("-C [aN,...]a0")
- << " (" << opt::comm_cost.to_string() << ")\n";
- std::clog << o("-s value")
- << "minimum duration between iterations"
- << " (" << opt::min_iter_duration << ")\n";
+ << " [" << opt::comm_cost.to_string() << "]\n";
+ std::clog << o("-S value")
+ << "minimum duration between comp. iterations"
+ << " [" << opt::min_comp_iter_duration << "]\n";
std::clog << "\nParameters for the end of the simulation\n";
std::clog << o("-i value")
<< "maximum number of lb. iterations, 0 for infinity"
std::clog << "\nParameters for the end of the simulation\n";
std::clog << o("-i value")
<< "maximum number of lb. iterations, 0 for infinity"
std::clog << o("-I value")
<< "maximum number of comp. iterations, 0 for infinity"
std::clog << o("-I value")
<< "maximum number of comp. iterations, 0 for infinity"
std::clog << o("-t value")
<< "time limit (simulated time), 0 for infinity"
std::clog << o("-t value")
<< "time limit (simulated time), 0 for infinity"
- << " (" << opt::time_limit << ")\n";
- std::clog << o("-e") << "exit on reception of \"close\" message\n";
+ << " [" << opt::time_limit << "]\n";
+ std::clog << o("-e") << "toggle exit on reception of \"close\" message"
+ << " [" << opt_helper::on_off(opt::exit_on_close) << "]\n";
<< " depl : messages from auto deployment (inherited from main)\n"
<< " comm : messages from asynchronous pipes\n"
<< " proc : messages from base process class\n"
<< " depl : messages from auto deployment (inherited from main)\n"
<< " comm : messages from asynchronous pipes\n"
<< " proc : messages from base process class\n"