question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using joblib to parallelize plotting

See original GitHub issue

I realize there’s another issue about the same functionality using dask, but apparently there are some glitches that haven’t been easy to resolve. There were talks about dask’s map_blocks but nothing got implemented. Today I came across an alternative by @ali-ramadhan, which is joblib, which might be worth considering.

You can see it being used in this script, and apparently the only “trick” needed here was to load the dataset in the function is that he “needed to open the dataset inside the function called by joblib”. Other than that I think all that was needed was the addition of one joblib call in line 127: https://github.com/CliMA/Oceananigans.jl/blob/7a2c52442b780222e6700f5a99e3be24c4de909d/validation/lid_driven_cavity/plot_lid_driven_cavity.py#L127

CC: @dcherian @ali-ramadhan

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tomchorcommented, Apr 12, 2021

I started both this issue and PR #35, and I completely agree that this is about to be made obsolete! I started this before opening #35 just to discuss and see what the best way to implement was.

My vote is that you can close this whenever you feel appropriate.

1reaction
jbuseckecommented, Mar 10, 2021

Hey folks, thanks for the suggestion. I in fact implemented dask.delayed in my initial approach summarized here, and the speedup was very nice. I am very keen on the implementation in #35, since I think map_blocks seems like a great way to implement this in a general way. But I will definitely keep this in mind until we find a good solution to this important problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plotting in parallel with matplotlib and python | by Paul Gavrikov
First, we have to distribute the data to every worker and then assemble the outputs. We can let multiprocessing handle that by using...
Read more >
A Parallel loop in Python with Joblib.Parallel
In the following, we are going to parallelize a loop with independent iterations. More specifically, we have list of natural numbers and want...
Read more >
Embarrassingly parallel for loops - Joblib - Read the Docs
Parallel provides a special handling for large arrays to automatically dump them on the filesystem and pass a reference to the worker to...
Read more >
Parallel Computing with Joblib and Plotting with Seaborn
I will detail how Joblib enables such computations for CPU-only tasks with minimal overhead to the code. Once those computations are over, visualisation ......
Read more >
crucial python 08 - Easy parallelization with joblib - YouTube
This week, Colin Raffel shows us an easy way to write a parallelized for loop using the joblib module and runs a simple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found