int help_requested = 0;
bool version_requested = false;
- cost_func comp_cost("1, 0");
- cost_func comm_cost("1, 0");
+ bool bookkeeping = false;
+
+ cost_func comp_cost("1e9, 0"); // fixme: find better defaults
} // namespace opt
+namespace {
+
+ const char* on_off(bool b)
+ {
+ return b ? "on" : "off";
+ }
+
+}
+
int opt::parse_args(int* argc, char* argv[])
{
- char *tmp = strrchr(argv[0], '/');
+ char* tmp = strrchr(argv[0], '/');
opt::program_name = (tmp ? tmp + 1 : argv[0]);
int c;
opterr = 0;
- while ((c = getopt(*argc, argv, "hc:C:V")) != -1) {
+ while ((c = getopt(*argc, argv, "bc:hV")) != -1) {
switch (c) {
+ case 'b':
+ opt::bookkeeping = true;
+ break;
case 'h':
opt::help_requested++;
break;
case 'c':
opt::comp_cost = cost_func(optarg);
break;
- case 'C':
- opt::comm_cost = cost_func(optarg);
- break;
case 'V':
opt::version_requested = true;
break;
return 1;
}
-
+
void opt::print()
{
INFO0(",----[ Simulation parameters ]");
INFO1("| platform_file.......: \"%s\"", opt::platform_file);
INFO1("| application_file....: \"%s\"", opt::application_file);
- INFO1("| comp. cost factors..: [%s]", opt::comp_cost.to_string().c_str());
- INFO1("| comm. cost factors..: [%s]", opt::comm_cost.to_string().c_str());
+ INFO1("| bookkeeping.........: %s", on_off(opt::bookkeeping));
+ INFO1("| comp. cost factors..: [%s]", opt::comp_cost.to_string().c_str());
INFO0("`----");
}
if (opt::help_requested < 1)
return;
std::clog << o("-V") << "print version and exit\n";
+ std::clog << o("-b") << "activate bookkeeping\n";
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";
#undef o
#undef oo