We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cad3301 + 5e677d3 commit e83adaaCopy full SHA for e83adaa
src/cman.jl
@@ -168,7 +168,21 @@ macro mpi_do(manager, expr)
168
refs[end] = remotecall(()->eval(Main,$(Expr(:quote,expr))), myid())
169
end
170
171
- [wait(r) for r in refs]
+ # Retrieve remote exceptions if any
172
+ @sync begin
173
+ for r in refs
174
+ @async begin
175
+ resp = remotecall_fetch(r.where, r) do rr
176
+ wrkr_result = take!(rr)
177
+ # Only return result if it is an exception, i.e.,
178
+ # Don't return a valid result of worker computation.
179
+ # The call is a mpi_do and not mpi_callfetch
180
+ return isa(wrkr_result, Exception) ? wrkr_result : nothing
181
+ end
182
+ isa(resp, Exception) && throw(resp)
183
184
185
186
nothing
187
188
0 commit comments