Edit: I did try using fetch()
I seem to have break something in Julia this week. I had played with the SharedArray type on a computer with 12 threads (6 doble thread cpu), I maneged to get a result and to print it and save it as matrix text file without problem, more or less following the instructions on http://docs.julialang.org/en/release-0.4/manual/parallel-computing/#shared-arrays. I had this routine where I initialized a number of workers and an Array, pass them as argument to a function, and expected to obtain a SharedArray with numerical values in return. It went more or less like this
addprocs(11)
BCero=rand(128,128)
ConjuntoX=Array[]
for j,k=1:128
push!(ConjuntoX, [j,k])
end
function obtenerKernelParalell(LasB::Array, lasX::Array, jmax::Int)
result=SharedArray(Float64,(jmax,jmax))
@sync @parallel for j=1:jmax
xj=lasX[j]
for k=1:j
xk=lasX[k]
for l=1:jmax
xl=lasX[l]
result[j,k]+= LasB[(xk-xl+xconstante)...]*LasB[(xj-xl+xconstante)...]
end
end
end
end
KSuaveParalel=obtenerKernelParalell(BceroSuave, ConjuntoX,128);
What I did get after runing this for the first time was an array that behaved itself like a normal Array. If I typed KSuaveParalel[3,12] I obtained a value. But now I get the next thing from the REPL:
KSuaveParalel
11-element Array{Any,1}:
RemoteRef{Channel{Any}}(2,1,122)
RemoteRef{Channel{Any}}(3,1,123)
RemoteRef{Channel{Any}}(4,1,124)
RemoteRef{Channel{Any}}(5,1,125)
RemoteRef{Channel{Any}}(6,1,126)
RemoteRef{Channel{Any}}(7,1,127)
RemoteRef{Channel{Any}}(8,1,128)
RemoteRef{Channel{Any}}(9,1,129)
RemoteRef{Channel{Any}}(10,1,130)
RemoteRef{Channel{Any}}(11,1,131)
RemoteRef{Channel{Any}}(12,1,132)
So I got an array of References... and I do not know how to get its values. Also using fetch() doesn't seem to work.
What is going on here?
fetch(KSuaveParalel[1])return? - Alexander Morley