Open grahamas opened 4 years ago
When you do a t = @distributed for
, you get back a task. The task's value is always nothing
after all the workers come back. You can explicitly make sure no task errored with a fetch(t)
— this is how you can check for both iteration space errors as well as errors inside the distributed work. In this case (#30343), I think we could probably detect it ahead of time and give a nicer error. But there may be interior errors that you'd probably want to check, too — and I'm not sure we can do anything there.
For a simple example:
This should error, as in JuliaLang/Distributed.jl#57, but no error is reported. The code silently never runs the contents of the distributed loop. If you tack on a
@sync
or even put in a reduction, i.e.@distributed (*)
then the error is reported properly.This is relevant to my use-case where I set up a RemoteChannel and listen to it after running the
@distributed
loop asynchronously.