@@ -21,21 +21,38 @@ pytask-parallel
2121Parallelize the execution of tasks with `pytask-parallel ` which is a plugin for `pytask
2222<https://github.com/pytask-dev/pytask> `_.
2323
24+
25+ Installation
26+ ------------
27+
2428Install the plugin via ``conda `` with
2529
26- .. code-block :: bash
30+ .. code-block :: console
2731
2832 $ conda config --add channels conda-forge --add channels pytask
2933 $ conda install pytask-parallel
3034
3135 The plugin uses the ``ProcessPoolExecutor `` or ``ThreadPoolExecutor `` in the
3236`concurrent.futures <https://docs.python.org/3/library/concurrent.futures.html >`_ module
33- to execute tasks asynchronously.
37+ to execute tasks asynchronously. By default, processes are used for parallelization.
38+
39+ It is also possible to install ``loky `` with
40+
41+ .. code-block :: console
42+
43+ $ conda install -c conda-forge loky
44+
45+ which is a more robust implementation of the ``ProcessPoolExecutor `` and the default
46+ backend if installed.
47+
48+
49+ Usage
50+ -----
3451
3552To parallelize your tasks across many workers, pass an integer greater than 1 or
3653``'auto' `` to the command-line interface.
3754
38- .. code-block :: bash
55+ .. code-block :: console
3956
4057 $ pytask -n 2
4158 $ pytask --n-workers 2
@@ -44,15 +61,14 @@ To parallelize your tasks across many workers, pass an integer greater than 1 or
4461 $ pytask -n auto
4562
4663
47- By default, processes are used to parallelize the execution of tasks. This is useful for
48- CPU bound tasks such as numerical computations. (`Here
49- <https://stackoverflow.com/a/868577/7523785> `_ is an explanation on what CPU or IO bound
50- means.)
64+ Using processes to parallelize the execution of tasks is useful for CPU bound tasks such
65+ as numerical computations. (`Here <https://stackoverflow.com/a/868577/7523785 >`_ is an
66+ explanation on what CPU or IO bound means.)
5167
5268For IO bound tasks, tasks where the limiting factor are network responses, accesses to
5369files, you can parallelize via threads.
5470
55- .. code-block :: bash
71+ .. code-block :: console
5672
5773 $ pytask --parallel-backend threads
5874
@@ -65,7 +81,7 @@ You can also set the options in one of the configuration files (``pytask.ini``,
6581
6682 [pytask]
6783 n_processes = 1
68- parallel_backend = processes
84+ parallel_backend = processes # or loky if installed.
6985
7086
7187 Changes
0 commit comments