diff options
Diffstat (limited to 'devdocs/gnu_make/parallel.html')
| -rw-r--r-- | devdocs/gnu_make/parallel.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/devdocs/gnu_make/parallel.html b/devdocs/gnu_make/parallel.html new file mode 100644 index 00000000..08427f66 --- /dev/null +++ b/devdocs/gnu_make/parallel.html @@ -0,0 +1,23 @@ + <h1 class="section">Parallel Execution</h1> <p>GNU <code>make</code> knows how to execute several recipes at once. Normally, <code>make</code> will execute only one recipe at a time, waiting for it to finish before executing the next. However, the ‘<samp>-j</samp>’ or ‘<samp>--jobs</samp>’ option tells <code>make</code> to execute many recipes simultaneously. You can inhibit parallelism for some or all targets from within the makefile (see <a href="parallel-disable">Disabling Parallel Execution</a>). </p> <p>On MS-DOS, the ‘<samp>-j</samp>’ option has no effect, since that system doesn’t support multi-processing. </p> <p>If the ‘<samp>-j</samp>’ option is followed by an integer, this is the number of recipes to execute at once; this is called the number of <em>job slots</em>. If there is nothing looking like an integer after the ‘<samp>-j</samp>’ option, there is no limit on the number of job slots. The default number of job slots is one, which means serial execution (one thing at a time). </p> <p>Handling recursive <code>make</code> invocations raises issues for parallel execution. For more information on this, see <a href="options_002frecursion">Communicating Options to a Sub-<code>make</code></a>. </p> <p>If a recipe fails (is killed by a signal or exits with a nonzero status), and errors are not ignored for that recipe (see <a href="errors">Errors in Recipes</a>), the remaining recipe lines to remake the same target will not be run. If a recipe fails and the ‘<samp>-k</samp>’ or ‘<samp>--keep-going</samp>’ option was not given (see <a href="options-summary">Summary of Options</a>), <code>make</code> aborts execution. If make terminates for any reason (including a signal) with child processes running, it waits for them to finish before actually exiting. </p> <p>When the system is heavily loaded, you will probably want to run fewer jobs than when it is lightly loaded. You can use the ‘<samp>-l</samp>’ option to tell <code>make</code> to limit the number of jobs to run at once, based on the load average. The ‘<samp>-l</samp>’ or ‘<samp>--max-load</samp>’ option is followed by a floating-point number. For example, </p> <div class="example"> <pre class="example">-l 2.5 +</pre> +</div> <p>will not let <code>make</code> start more than one job if the load average is above 2.5. The ‘<samp>-l</samp>’ option with no following number removes the load limit, if one was given with a previous ‘<samp>-l</samp>’ option. </p> <p>More precisely, when <code>make</code> goes to start up a job, and it already has at least one job running, it checks the current load average; if it is not lower than the limit given with ‘<samp>-l</samp>’, <code>make</code> waits until the load average goes below that limit, or until all the other jobs finish. </p> <p>By default, there is no load limit. </p> <table class="menu" border="0" cellspacing="0"> <tr> +<td align="left" valign="top">• <a href="parallel-disable" accesskey="1">Parallel Disable</a> +</td> +<td> </td> +<td align="left" valign="top">Disabling parallel execution </td> +</tr> <tr> +<td align="left" valign="top">• <a href="parallel-output" accesskey="2">Parallel Output</a> +</td> +<td> </td> +<td align="left" valign="top">Handling output during parallel execution </td> +</tr> <tr> +<td align="left" valign="top">• <a href="parallel-input" accesskey="3">Parallel Input</a> +</td> +<td> </td> +<td align="left" valign="top">Handling input during parallel execution </td> +</tr> </table><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Free Software Foundation, Inc. <br>Licensed under the GNU Free Documentation License.<br> + <a href="https://www.gnu.org/software/make/manual/html_node/Parallel.html" class="_attribution-link">https://www.gnu.org/software/make/manual/html_node/Parallel.html</a> + </p> +</div> |
