aboutsummaryrefslogtreecommitdiff
path: root/build2/b-options.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-17 16:57:49 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-17 16:57:49 +0200
commitb5960ebbe7236eef62620b0a07df8de93dffc81e (patch)
treec95f4f54ca67a9886211d2c27b0a2a2fef5012e6 /build2/b-options.cxx
parentfdb3931c1948fbf9d56c98165f411aa5abf1b02d (diff)
Shorten scheduler queue depth, make it customizable via command line
Diffstat (limited to 'build2/b-options.cxx')
-rw-r--r--build2/b-options.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/build2/b-options.cxx b/build2/b-options.cxx
index d89adcf..d31868c 100644
--- a/build2/b-options.cxx
+++ b/build2/b-options.cxx
@@ -578,6 +578,8 @@ namespace build2
jobs_specified_ (false),
max_jobs_ (),
max_jobs_specified_ (false),
+ queue_depth_ (4),
+ queue_depth_specified_ (false),
serial_stop_ (),
no_column_ (),
no_line_ (),
@@ -706,6 +708,13 @@ namespace build2
<< " scheduler implementation for details." << ::std::endl;
os << std::endl
+ << "\033[1m--queue-depth\033[0m|\033[1m-Q\033[0m \033[4mnum\033[0m The queue depth as a multiplier over the number of active" << ::std::endl
+ << " jobs. Normally we want a deeper queue if the jobs take" << ::std::endl
+ << " long (for example, compilation) and shorter if they are" << ::std::endl
+ << " quick (for example, simple tests). The default is 4. See" << ::std::endl
+ << " the build system scheduler implementation for details." << ::std::endl;
+
+ os << std::endl
<< "\033[1m--serial-stop\033[0m|\033[1m-s\033[0m Run serially and stop at the first error. This mode is" << ::std::endl
<< " useful to investigate build failures that are caused by" << ::std::endl
<< " build system errors rather than compilation errors. Note" << ::std::endl
@@ -801,6 +810,12 @@ namespace build2
_cli_options_map_["-J"] =
&::build2::cl::thunk< options, size_t, &options::max_jobs_,
&options::max_jobs_specified_ >;
+ _cli_options_map_["--queue-depth"] =
+ &::build2::cl::thunk< options, size_t, &options::queue_depth_,
+ &options::queue_depth_specified_ >;
+ _cli_options_map_["-Q"] =
+ &::build2::cl::thunk< options, size_t, &options::queue_depth_,
+ &options::queue_depth_specified_ >;
_cli_options_map_["--serial-stop"] =
&::build2::cl::thunk< options, bool, &options::serial_stop_ >;
_cli_options_map_["-s"] =