Ok I'll give it a shot!

Though in my context I can't see a good reason that k is not just auto 
evaluated first...

Sent from my iPad

> On 18 Mar 2015, at 8:29 pm, Andreas Noack <[email protected]> 
> wrote:
> 
> It has caused a lot of frustration. See #9118. I think the easiest right now 
> is
> for p in procs()
> @spawnat p blas_set_num_threads(k)
> end
> 
> 2015-03-17 23:19 GMT-04:00 Sheehan Olver <[email protected]>:
>> 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