Skip to content

Doc ipyparallel & mpi4py concurrent.futures#7665

Merged
jrbourbeau merged 2 commits intodask:mainfrom
jakirkham:doc_exe_lib_apis
May 19, 2021
Merged

Doc ipyparallel & mpi4py concurrent.futures#7665
jrbourbeau merged 2 commits intodask:mainfrom
jakirkham:doc_exe_lib_apis

Conversation

@jakirkham
Copy link
Copy Markdown
Member

Mention ipyparallel and mpi4py also support the concurrent.futures API and could be used as well.

  • Closes #xxxx
  • Tests added / passed
  • Passes black dask / flake8 dask / isort dask

@jakirkham jakirkham mentioned this pull request May 18, 2021
3 tasks
@ncclementi
Copy link
Copy Markdown
Member

@jakirkham @jrbourbeau Do you think examples for these cases would be helpful too? As a relatively new to dask person, I was going through the links and I noticed that the mpi4py case is clear, although the ipyparallel doesn't have examples for the executor.

@jakirkham
Copy link
Copy Markdown
Member Author

It's a good question. There is a little bit of documentation for ipyparallel, but agree it is a bit sparse. Raised issue ( ipython/ipyparallel#459 ) about expanding on this a bit with an example.

Personally think one example with Loky is probably good enough for us (and is also nice for those familiar with the scikit-learn/joblib collection of libraries). The rest of these serve as other executors one might consider based on their needs. Am sure there are probably more that I'm not thinking of that people might want to use for different reasons.

Copy link
Copy Markdown

@leofang leofang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, John! LGTM except for one nitpick.

Co-authored-by: Leo Fang <leofang@bnl.gov>
@jakirkham jakirkham requested a review from jrbourbeau May 19, 2021 02:03
Copy link
Copy Markdown
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jakirkham! This is in

@jrbourbeau jrbourbeau merged commit f547f08 into dask:main May 19, 2021
@jakirkham jakirkham deleted the doc_exe_lib_apis branch May 19, 2021 03:22
@jakirkham
Copy link
Copy Markdown
Member Author

Thanks all! 😀

@jakirkham
Copy link
Copy Markdown
Member Author

jakirkham commented Sep 2, 2021

FWIW here's an example using ipyparallel

from functools import partial

import ipyparallel as ipp

import dask
import dask.array as da


c = ipp.Client()
e = c.executor()

submit = e.submit
num_workers = len(e.view)
get = partial(
    dask.local.get_async,
    submit,
    num_workers
)

with dask.config.set(scheduler=get):
    a = da.ones((1_000, 1_100), chunks=100)
    r = a.sum()
    print(r.compute())

Ideally we could absorb some of the boilerplate around wrapping the submit function to improve usability.

Edit: This should do the trick ( #8112 ). Example usage here ( #8112 (comment) )

@jakirkham jakirkham mentioned this pull request Sep 2, 2021
3 tasks
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

Successfully merging this pull request may close these issues.

4 participants