From e040a98b11c3cdf9fb14014dac3e22b053dd0fca Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Mon, 22 Feb 2021 16:38:17 +0100 Subject: [PATCH] fix: num-threads wasn't working since it was used before cli parsing --- src/rs_t265_vio.cpp | 12 ++++++------ src/vio.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/rs_t265_vio.cpp b/src/rs_t265_vio.cpp index 5b353ea..5f012b6 100644 --- a/src/rs_t265_vio.cpp +++ b/src/rs_t265_vio.cpp @@ -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; 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 { diff --git a/src/vio.cpp b/src/vio.cpp index 90bab30..e40ba1f 100644 --- a/src/vio.cpp +++ b/src/vio.cpp @@ -222,6 +222,12 @@ int main(int argc, char** argv) { "Save trajectory. Supported formats "); 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; 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);