@@ -26,9 +26,7 @@ keypoints:
2626
2727When processing larger amounts of data, and especially when the tool crashes
2828when running a recipe because there is not enough memory available, it is
29- usually beneficial to change the default
30- [ Dask configuration] (https://docs.esmvaltool.org/
31- projects/ESMValCore/en/latest/quickstart/configure.html#dask-configuration).
29+ usually beneficial to change the default [ Dask configuration] [ dask-configuration ] .
3230
3331The preprocessor functions in ESMValCore use the
3432[ Iris] ( https://scitools-iris.readthedocs.io ) library, which in turn uses Dask
@@ -60,15 +58,15 @@ workers.
6058
6159In order to distribute the computations over the workers, Dask makes use of a
6260* scheduler* . There are two different schedulers available. The default
63- scheduler can be good choice for smaller computations that can run
61+ scheduler can be a good choice for smaller computations that can run
6462on a single computer, while the scheduler provided by the Dask Distributed
6563package is more suitable for larger computations.
6664
6765> ## On using `` max_parallel_tasks ``
6866>
6967> In the config-user.yml file, there is a setting called `` max_parallel_tasks `` .
7068> Any variable or diagnostic script in the recipe is considered a 'task' in this
71- > context and when settings this to a value larger than 1, these will be
69+ > context and this is set to a value larger than 1, these will be
7270> processed in parallel on the computer running the `` esmvaltool `` command.
7371>
7472> With the Dask Distributed scheduler, all the tasks running in parallel
@@ -112,8 +110,7 @@ cluster:
112110This tells ESMValCore to start a new cluster of one worker, that can use 2
113111gigabytes (GiB) of memory and run computations using 2 threads. For a more
114112extensive description of the available arguments and their values, see
115- [` ` distributed.LocalCluster` ` ](https://distributed.dask.org/
116- en/stable/api.html#distributed.LocalCluster).
113+ [` ` distributed.LocalCluster` ` ][distributed-localcluster].
117114
118115To see this configuration in action, run we will run a version of
119116[recipe_easy_ipcc.yml](https://docs.esmvaltool.org/
@@ -157,13 +154,17 @@ asked to do.
157154>> threads_per_worker: 2
158155>> memory_limit: 2GiB
159156>>```
160- >> Note that the bars representing the memory use turn
161- >> orange as the worker reaches the maximum amount of memory it is
162- >> allowed to use and it starts 'spilling' (writing data temporarily) to disk.
157+ >> Note that the bars representing the memory use turn orange as the worker
158+ >> reaches the maximum amount of memory it is allowed to use and it starts
159+ >> 'spilling' (writing data temporarily) to disk.
163160>> The red blocks in the top right panel represent time spent reading/writing
164161>> to disk. While 2 GiB per worker may be enough in other cases, it is
165162>> apparently not enough for this recipe.
166163>>
164+ >> Warning messages about high memory usage by workers and/or killed workers
165+ >> will also be written to the terminal, which may be convenient to diagnose
166+ >> issues that occurred while you were not watching the dashboard.
167+ >>
167168> {: .solution}
168169{: .challenge}
169170
@@ -176,6 +177,10 @@ asked to do.
176177> workers so they use total amount available minus a few gigabytes for your
177178> other work. Run the recipe again and notice that it completed faster.
178179>
180+ > If are working on a computer that is shared with other users, please be
181+ > mindful of them and only use a modest amount of memory instead of all
182+ > available memory.
183+ >
179184>> # # Solution
180185>>
181186>> For example, if your computer has 16 GiB of memory and you do not have too
@@ -200,14 +205,12 @@ asked to do.
200205
201206# # Using an existing Dask Distributed cluster
202207
203- In some cases, it can be useful to start the Dask Distributed cluster before
208+ It can be useful to start the Dask Distributed cluster before
204209running the ``esmvaltool`` command. For example, if you would like to keep the
205210Dashboard available for further investigation after the recipe completes
206211running, or if you are working from a Jupyter notebook environment, see
207212[dask-labextension](https://github.com/dask/dask-labextension) and
208- [dask_jobqueue interactive use](https://jobqueue.dask.org/
209- en/latest/interactive.html)
210- for more information.
213+ [dask_jobqueue interactive use][dask-jobqueue-interactive] for more information.
211214
212215To use a cluster that was started in some other way, the following configuration
213216can be used in ``~/.esmvaltool/dask.yml`` :
@@ -217,8 +220,7 @@ client:
217220 address: "tcp://127.0.0.1:33041"
218221` ` `
219222where the address depends on the Dask cluster. Code to start a
220- [``distributed.LocalCluster``](https://distributed.dask.org/
221- en/stable/api.html#distributed.LocalCluster)
223+ [``distributed.LocalCluster``][distributed-localcluster]
222224that automatically scales between 0 and 2 workers depending on demand, could
223225look like this :
224226
@@ -380,10 +382,8 @@ in order to find the optimal configuration for your situation.
380382>> The best configuration depends on the HPC system that you are using.
381383>> Discuss your answer with the instructor and the class if possible.
382384>> If you are taking this course by yourself, you can have a look at the
383- >> [Dask configuration examples in the ESMValCore documentation](
384- >> https://docs.esmvaltool.org/projects/ESMValCore/en/latest/quickstart/
385- >> configure.html#dask-distributed-configuration).
386- >>
385+ >> [Dask configuration examples][dask-configuration] in the ESMValCore
386+ >> documentation.
387387> {: .solution}
388388{: .challenge}
389389
0 commit comments