Hi all,

I swear I tried to look into the documentation or online but I can't figure 
out what I want to do.
I have a lot of sequential code executed and at some point I want to 
parallelize the following loop:

mat_a = zeros(n, n)
for i = 1:n
    mat_a[i,i:n] = mean(mat_b[:,i] .* mat_b[:,i:n], 1)
end

with mat_b being computed before.

I have a bunch of questions in order to better understand things:

- how to best choose the number of procs with which I run julia?
- since each operation on the rows of mat_a can be done independently from 
the others, I'd like to send mat_b to each worker so that it can compute 
certain lines of the matrix mat_a in the form of an array of vector which I 
would concatenate afterwards to retrieve mat_a. I wanted to send mat_b with 
the @everywhere macro but it seems this works only for definitions of 
variables directly on a worker. I don't know how to send already computed 
data to a specific worker.
- more generally, is this the best approach to parallelizing this kind of 
code?

Any advice appreciated,

Thanks a lot,

Reply via email to