From c5bd52523201d604353b222bb3dbad21c8388809 Mon Sep 17 00:00:00 2001 From: Hyunjae Woo Date: Thu, 5 Oct 2023 22:56:46 -0700 Subject: [PATCH] Adjust max_threads according to concurrency --- 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(