fix: num-threads wasn't working since it was used before cli parsing
This commit is contained in:
parent
7df0427753
commit
e040a98b11
|
@ -137,6 +137,12 @@ int main(int argc, char** argv) {
|
|||
app.add_option("--num-threads", num_threads, "Number of threads.");
|
||||
app.add_option("--step-by-step", step_by_step, "Path to config file.");
|
||||
|
||||
try {
|
||||
app.parse(argc, argv);
|
||||
} catch (const CLI::ParseError& e) {
|
||||
return app.exit(e);
|
||||
}
|
||||
|
||||
// global thread limit is in effect until global_control object is destroyed
|
||||
std::unique_ptr<tbb::global_control> tbb_global_control;
|
||||
if (num_threads > 0) {
|
||||
|
@ -144,12 +150,6 @@ int main(int argc, char** argv) {
|
|||
tbb::global_control::max_allowed_parallelism, num_threads);
|
||||
}
|
||||
|
||||
try {
|
||||
app.parse(argc, argv);
|
||||
} catch (const CLI::ParseError& e) {
|
||||
return app.exit(e);
|
||||
}
|
||||
|
||||
if (!config_path.empty()) {
|
||||
vio_config.load(config_path);
|
||||
} else {
|
||||
|
|
12
src/vio.cpp
12
src/vio.cpp
|
@ -222,6 +222,12 @@ int main(int argc, char** argv) {
|
|||
"Save trajectory. Supported formats <tum, euroc, kitti>");
|
||||
app.add_option("--use-imu", use_imu, "Use IMU.");
|
||||
|
||||
try {
|
||||
app.parse(argc, argv);
|
||||
} catch (const CLI::ParseError& e) {
|
||||
return app.exit(e);
|
||||
}
|
||||
|
||||
// global thread limit is in effect until global_control object is destroyed
|
||||
std::unique_ptr<tbb::global_control> tbb_global_control;
|
||||
if (num_threads > 0) {
|
||||
|
@ -229,12 +235,6 @@ int main(int argc, char** argv) {
|
|||
tbb::global_control::max_allowed_parallelism, num_threads);
|
||||
}
|
||||
|
||||
try {
|
||||
app.parse(argc, argv);
|
||||
} catch (const CLI::ParseError& e) {
|
||||
return app.exit(e);
|
||||
}
|
||||
|
||||
if (!config_path.empty()) {
|
||||
vio_config.load(config_path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue