Hi,

I've created the following to test the performance of parallel processing 
on our departments server.  But the @everywhere isn't working because 
"ERROR: k not defined".   What's wrong?  And any advice on improving the 
test?  (Right now for small n there is little benefit for > 12 processes, 
but this seems expected behaviour to me.  There are many other processes 
maxing out CPU simultaneous with the test.)

Sheehan 



function timemat(n,m,b,p)
    rmprocs(procs()[2:end])
    tms=Array(Float64,p,b)
    for j=1:p
        for k=1:b
            @everywhere blas_set_num_threads(k)

            # following line is just to make sure everything is precompiled
            @parallel (+) for k=1:2p
                last(randn(n,n)\[1;zeros(n-1)])
             end;

            tms[j,k]=@elapsed(@parallel (+) for k=1:m
                last(randn(n,n)\[1;zeros(n-1)])
             end)

            println("procs=$j blas=$k $(tms[j,k])")
        end
        addprocs(1)
    end
    tms
end

Reply via email to