You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Iris](https://scitools-iris.readthedocs.io) library, which in turn uses Dask
34
35
Arrays to be able to process datasets that are larger than the available memory.
35
36
It is not necesary to understand how these work exactly to use the ESMValTool,
36
37
but if you are interested there is a
37
38
[Dask Array Tutorial](https://tutorial.dask.org/02_array.html) as a well as a
38
-
[guide to "Lazy Data"](https://scitools-iris.readthedocs.io/en/stable/userguide/real_and_lazy_data.html)
39
+
[guide to "Lazy Data"](https://scitools-iris.readthedocs.io/
40
+
en/stable/userguide/real_and_lazy_data.html)
39
41
available. Lazy data is the term the Iris library uses for Dask Arrays.
40
42
41
43
42
44
### Workers
43
45
The most important concept to understand when using Dask Arrays is the concept
44
-
of a Dask "worker". With Dask, computations are run in parallel by little programs
45
-
that are called "workers". These could be on running on the
46
+
of a Dask "worker". With Dask, computations are run in parallel by little
47
+
programs that are called "workers". These could be on running on the
46
48
same machine that you are running ESMValTool on, or they could be on one or
47
49
more other computers. Dask workers typically require 2 to 4 gigabytes (GiB) of
48
50
memory (RAM) each. In order to avoid running out of memory, it is important
@@ -66,15 +68,15 @@ package is more suitable for larger computations.
66
68
>
67
69
> In the config-user.yml file, there is a setting called ``max_parallel_tasks``.
68
70
> Any variable or diagnostic script in the recipe is considered a 'task' in this
69
-
> context and when settings this to a value larger than 1, these will be processed
70
-
> in parallel on the computer running the ``esmvaltool`` command.
71
+
> context and when settings this to a value larger than 1, these will be
72
+
> processed in parallel on the computer running the ``esmvaltool`` command.
71
73
>
72
74
> With the Dask Distributed scheduler, all the tasks running in parallel
73
75
> can use the same workers, but with the default scheduler each task will
74
-
> start its own workers. If a recipe does not run with ``max_parallel_tasks`` set
75
-
> to a value larger than 1, try reducing the value or setting it to 1. This is
76
-
> especially the case for recipes with high resolution data or many datasets
77
-
> per variable.
76
+
> start its own workers. If a recipe does not run with ``max_parallel_tasks``
77
+
> set to a value larger than 1, try reducing the value or setting it to 1.
78
+
> This is especially the case for recipes with high resolution data or many
79
+
> datasets per variable.
78
80
>
79
81
{: .callout}
80
82
@@ -133,8 +135,8 @@ Open the Dashboard link in a browser to see the Dask Dashboard website.
133
135
When the recipe has finished running, the Dashboard website will stop working.
134
136
The top left panel shows the memory use of each of the workers, the panel on the
135
137
right shows one row for each thread that is doing work, and the panel at the
136
-
bottom shows the progress of all work that the scheduler currently has been asked
137
-
to do.
138
+
bottom shows the progress of all work that the scheduler currently has been
139
+
asked to do.
138
140
139
141
> ## Explore what happens if workers do not have enough memory
140
142
>
@@ -156,8 +158,8 @@ to do.
156
158
>> orange as the worker reaches the maximum amount of memory it is
157
159
>> allowed to use and it starts 'spilling' (writing data temporarily) to disk.
158
160
>> The red blocks in the top right panel represent time spent reading/writing
159
-
>> to disk. While 2 GiB per worker may be enough in other cases, it is apparently
160
-
>> not enough for this recipe.
161
+
>> to disk. While 2 GiB per worker may be enough in other cases, it is
162
+
>> apparently not enough for this recipe.
161
163
>>
162
164
> {: .solution}
163
165
{: .challenge}
@@ -195,9 +197,12 @@ to do.
195
197
## Using an existing Dask Distributed cluster
196
198
197
199
In some cases, it can be useful to start the Dask Distributed cluster before
198
-
running the ``esmvaltool`` command. For example, if you would like to keep the Dashboard available for further investigation after the recipe completes running, or if you are working from a Jupyter notebook environment, see
200
+
running the ``esmvaltool`` command. For example, if you would like to keep the
201
+
Dashboard available for further investigation after the recipe completes
202
+
running, or if you are working from a Jupyter notebook environment, see
199
203
[dask-labextension](https://github.com/dask/dask-labextension) and
To use a cluster that was started in some other way, the following configuration
@@ -208,7 +213,10 @@ client:
208
213
address: "tcp://127.0.0.1:33041"
209
214
```
210
215
where the address depends on the Dask cluster. Code to start a
211
-
[``distributed.LocalCluster``](https://distributed.dask.org/en/stable/api.html#distributed.LocalCluster) that automatically scales between 0 and 2 workers, depending on demand, could look like this:
that automatically scales between 0 and 2 workers, depending on demand, could
219
+
look like this:
212
220
213
221
```python
214
222
from time import sleep
@@ -257,8 +265,8 @@ Dashboard remains available after the recipe completes.
257
265
>> to the screen, edit the file ``~/.esmvaltool/dask.yml`` so it contains the
258
266
lines
259
267
>> ```yaml
260
-
>> client:
261
-
>> address: "tcp://127.0.0.1:34827"
268
+
>> client:
269
+
>> address: "tcp://127.0.0.1:34827"
262
270
>> ```
263
271
>> open the link "http://127.0.0.1:8787/status" in your browser and
264
272
>> run the recipe again with the command ``esmvaltool run recipe_easy_ipcc_short.yml``.
@@ -273,7 +281,7 @@ compute hours you are not using.
273
281
274
282
It is recommended to use the Distributed scheduler explained above for
275
283
processing larger amounts of data. However, in many cases the default scheduler
276
-
is good enough. Note that it does not provide a Dashboard, so it is less
284
+
is good enough. Note that it does not provide a Dashboard, so it is less
277
285
instructive and that is why we did not use it earlier in this tutorial.
278
286
279
287
To use the default scheduler, comment out all the contents of
@@ -359,7 +367,7 @@ in order to find the optimal configuration for your situation.
359
367
>
360
368
>> ## Solution
361
369
>>
362
-
>> The best configuration depends on the HPC system that you are using.
370
+
>> The best configuration depends on the HPC system that you are using.
363
371
>> Discuss your answer with the instructor and the class if possible. If you are
364
372
>> taking this course by yourself, you can have a look at the [Dask configuration examples in the ESMValCore documentation](https://docs.esmvaltool.org/projects/ESMValCore/en/latest/quickstart/configure.html#dask-distributed-configuration).
0 commit comments