How to run parallel Julia code using distributed array computing

I run on Windows an example from the documentation :

julia> function compute_something(A::DArray) B = darray(eltype(A), size(A), 3) for i = 1:size(A,3) @spawnat owner(B,i) B[:,:,i] = sqrt(A[:,:,i]) end B end julia> A = drand(10, 15, 4) julia> compute_something(A) 

But I get an error message:

 in compute_something: B not defined 

Why am I getting this error?

In Web REPL, this example works.

+4
source share

Source: https://habr.com/ru/post/1447298/


All Articles