-
Notifications
You must be signed in to change notification settings - Fork 7
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
Return and args #20
Comments
May be modyfing a little bit the function mpi_do for returning the args, will do the job function mpi_callfetch(mgr::MPIManager, expr)
!mgr.initialized && wait(mgr.cond_initialized)
jpids = keys(mgr.j2mpi)
refs = Array{Any}(undef, length(jpids))
for (i,p) in enumerate(Iterators.filter(x -> x != myid(), jpids))
refs[i] = remotecall(expr, p)
end
# Execution on local process should be last, since it can block the main
# event loop
if myid() in jpids
refs[end] = remotecall(expr, myid())
end
# Retrieve remote exceptions if any
@sync begin
for r in refs
@async begin
resp = remotecall_fetch(r.where, r) do rr
wrkr_result = rr[]
end
isa(resp, Exception) && throw(resp)
end
end
end
wrkr_result
end When I have time, I will fork to test that solution. it is a copy-paste of mpi_do function where we do not filter the remote_callfetch results. Authors of the package say that @mpi_do is not a mpi_callfetch (it is logical, "do" in the name explicits it is a void function), |
I ended up making an |
Nice ! I hope authors will accept your PR. I'm currently writing a poster for Julia Con advocating for @mpi_do, but having also a @mpicall_fetch would be great. |
I don't know if I missed somethign but I can't seem to fund a way to return value for the " only workers execute MPI code" mode. While the example seemed exciting, I can't seem to find a way to do a simple (pseudo code)
which makes it a bit useless since I can't get a result back.
The text was updated successfully, but these errors were encountered: