From 96e17fce8528874ca46e1eb63f0de63936713e2c Mon Sep 17 00:00:00 2001 From: Hyunjae Woo <107147848+nv-hwoo@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:37:59 -0700 Subject: [PATCH] Adjust max_threads according to concurrency (#410) --- src/c++/perf_analyzer/command_line_parser.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/c++/perf_analyzer/command_line_parser.cc b/src/c++/perf_analyzer/command_line_parser.cc index b6b2194d6..589704004 100644 --- a/src/c++/perf_analyzer/command_line_parser.cc +++ b/src/c++/perf_analyzer/command_line_parser.cc @@ -1790,6 +1790,24 @@ CLParser::VerifyOptions() "--periodic-concurrency-range option."); } + if (params_->is_using_periodic_concurrency_mode) { + if (params_->periodic_concurrency_range.end == pa::NO_LIMIT) { + std::cerr + << "WARNING: The maximum attainable concurrency will be limited by " + "max_threads specification." + << std::endl; + params_->periodic_concurrency_range.end = params_->max_threads; + } else { + if (params_->max_threads_specified) { + std::cerr << "WARNING: Overriding max_threads specification to ensure " + "requested concurrency range." + << std::endl; + } + params_->max_threads = std::max( + params_->max_threads, params_->periodic_concurrency_range.end); + } + } + if (params_->request_parameters.size() > 0 && params_->protocol != cb::ProtocolType::GRPC) { Usage(