Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using dask with iris #7

Open
DamienIrving opened this issue Mar 26, 2018 · 2 comments
Open

Using dask with iris #7

DamienIrving opened this issue Mar 26, 2018 · 2 comments

Comments

@DamienIrving
Copy link
Owner

One major new feature of Iris 2.0.0 was dask integration.

To activate dask in your scripts, add the following:

import dask
dask.set_options(get=dask.get)

This puts you in sequential mode. If you want to try to profit from speedup through parallelisation you might try:

import dask
import dask.multiprocessing
dask.set_options(get=dask.multiprocessing.get)

which would give you parallelisation based on multiprocessing instead of multithreading that should not suffer from the same problem.

@DamienIrving
Copy link
Owner Author

In a notebook you can run:

from dask.distributed import Client, progress, LocalCluster

client = LocalCluster() 
client

It will then give you a URL to click to watch all the cores being used on your machine.

This is essentially the method used in the pangeo example notebooks with xarray - I really need to try a MemoryError-inducing task using both xarray and iris on the NCI virtual desktop environment.

@DamienIrving
Copy link
Owner Author

DamienIrving commented May 13, 2019

There's also some pangeo teaching materials here that cover dask:
https://github.com/jmunroe/pangeo-tutorial-c3dis-2019

The setup for using it on your own machine was:

from dask.distributed import LocalCluster
from dask.distributed import Client

cluster = LocalCluster(n_workers=4)
cluster

client = Client(cluster)
client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant