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

Potential fix when master has compute intensive work and must schedule workers #207

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

raminammour
Copy link
Contributor

Fixes issue #206 , please see the issue description for an explanation of the fix.

Fixes issue JuliaParallel#206 , please see the issue description for an explanation of the fix.
@ViralBShah
Copy link
Member

@andreasnoack Any thoughts on this?

@andreasnoack
Copy link
Member

It's a good observation and a pretty simple though not super pretty fix.

I'm wondering if we with the new multithreading can now just delegate all the scheduling to a separate task that won't block while the local work is being executed. I'd like to hear @vchuravy 's thoughts.

@raminammour
Copy link
Contributor Author

raminammour commented May 20, 2020

Looking at the code, the pattern

@sync for i in pids
    @async remotecall_fetch(**do_work**,i,...)

is common (and natural). So this may happen anywhere where **do_work** is heavy. I guess adding yield() in the correct places would work...

Or, at construction of DArray, by convention, have the id==myid() be last and preserve the invariant, pid[i] holds chunck i.

Cheers!

@vchuravy
Copy link
Member

vchuravy commented May 20, 2020

I think we need to carefully go through Distributed.jl and look at whether we can start using @spawn instead of @async, and then do the same for DistributedArrays.jl
Won't be easy since a whole bunch of this code is based on cooperative tasking, and switching to parallelism will expose races.

I might be able to have a UROP look at this transition.

@raminammour raminammour changed the title Update darray.jl Potential fix when master has compute intensive work and must schedule workers Nov 22, 2022
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