Is it possible to check a Future
object for any remote error without actually retrieving the remotely computed data ? Sometimes the data is very large and using a fetch()
result in undesired large data mouvement.
Consider the following example
using DistributedArrays
A = drand((1000,1000),workers())
B = drand((2000,2000),workers())
# Compute the sum A+B on each worker. This produces an error because the sizes don't match
AB_future = [@spawnat p B[:l] + A[:l] for p in workers()]
AB = DArray(reshape(AB_future, (2,2)))
The last line throws an error MethodError: no method matching size(::RemoteException)
I would rather have this RemoteException
displayed.
I tried the following as a workaround.
using DistributedArrays
A = drand((1000,1000),workers())
B = drand((2000,2000),workers())
# Compute the sum A+B on each worker. This produces an error because the sizes don't match
AB_future = [@spawnat p B[:l] + A[:l] for p in workers()]
for f in AB_future
println(fetch(f))
end
AB = DArray(reshape(AB_future, (2,2)))
It is not suitable as it performs a useless data mouvement.
How can I perform this check without retrieving the remote data ?