double min_transfer_amount = 0.0;
double max_transfer_amount = 0.0;
bool integer_transfer = false;
+ unsigned loba_best_divisor = 1;
// Application parameters
cost_func comp_cost("1e9, 0"); // fixme: find better defaults
int c;
opterr = 0;
while ((c = getopt(*argc, argv,
- "a:bc:C:d:D:eEhi:I:l:L:m:M:N:r:Rs:S:t:T:vVx:X:Z"))
+ "a:bc:C:d:D:eEhi:I:k:l:L:m:M:N:r:Rs:S:t:T:vVx:X:Z"))
!= -1) {
switch (c) {
case 'a':
case 'i':
PARSE_ARG(opt::lb_maxiter);
break;
+ case 'k':
+ PARSE_ARG(opt::loba_best_divisor);
+ break;
case 'I':
PARSE_ARG(opt::comp_maxiter);
break;
#undef PARSE_ARG
+ if (opt::option_x) { // FIXME: remove this one day...
+ opt::loba_best_divisor = opt::option_x;
+ XBT_WARN("divisor for algorithms *best* set from option -x (%d => %u),"
+ " use -k instead",
+ opt::option_x, opt::loba_best_divisor);
+ }
+
if (opt::version_requested || opt::help_requested)
return 1;
if (opt::max_transfer_amount &&
opt::max_transfer_amount < opt::min_transfer_amount) {
- XBT_ERROR("max. data transfer amount < min. data transfer amount");
+ XBT_ERROR("max. data transfer amount (%g) <"
+ " min. data transfer amount (%g)",
+ opt::max_transfer_amount, opt::min_transfer_amount);
+ result = false;
+ }
+
+ if (opt::loba_best_divisor <= 0) {
+ XBT_ERROR("divisor for algorithms *best* (%u) should be positive",
+ opt::loba_best_divisor);
result = false;
}
DESCR("- initial load (total)", "%g", auto_depl::load);
DESCR("- random initial load distribution", "%s",
h.on_off(auto_depl::random_distribution));
- DESCR("- random seed", "%s",
- h.val_or_string(auto_depl::random_seed, "time based"));
+ DESCR("- random seed", "%s", // NOTE: cannot be 0 here anymore
+ h.val_or_string(auto_depl::random_seed, "constant random", 1UL));
} else {
DESCR("deployment file", "\"%s\"", deployment_file.c_str());
}
h.val_or_string(max_transfer_amount, "no limit"));
DESCR("only transfer integer data shares", "%s",
h.on_off(integer_transfer));
+ DESCR("divisor for algorithms *best*", "%u", loba_best_divisor);
DESCR("minimum duration between comp. iterations", "%g",
min_comp_iter_duration);
DESCR("computations start after lb. iter", "%u", comp_iter_delay);
<< " [" << opt_helper::on_off(opt::auto_depl::random_distribution)
<< "]\n";
std::clog << o("-r value")
- << "random seed, 0 for a seed based on current date"
+ << "random seed for initial load distribution, or 0, or 1"
<< " [" << opt::auto_depl::random_seed << "]\n";
+ if (opt::help_requested > 1)
+ std::clog << o("") << "- use 0 for a seed based on current date\n"
+ << o("") << "- use 1 for a constant random\n";
std::clog << "\nLoad balancing algorithm:\n";
std::clog << o("-a name") << "load balancing algorithm"
if (opt::help_requested > 1)
std::clog << o("")
<< "(a not so good idea introduced by git commit f5336c5)\n";
+ std::clog << o("-k value") << "divisor for algorithms *best*"
+ << " [" << opt::loba_best_divisor << "]\n";
std::clog << "\nLb. and comp. iterations:\n";
std::clog << o("-s value")