From help-octave-request at bevo dot che dot wisc dot edu Sat Jan 17 21:58:44 2004 Subject: Re: Octave and threaded ATLAS and FFTW From: "Dmitri A. Sergatskov" To: "Henry F. Mollet" Cc: "John W. Eaton" , Octave_post Date: Sat, 17 Jan 2004 20:58:06 -0700 Henry F. Mollet wrote: > With a 400 Mhz Power PC G3 the two items tested take considerably longer. I > can understand a factor of 2000/400 = 5. Not that I need the speed, but does > it imply that vecLib (with BLAS and LAPACk) in Mac OS X Dev Tools is about > 4-10 times slower compared to ATLAS 2.6.0? > Henry > > octave:1> tic; t1=cputime ; a=rand(2000); t2=cputime ; toc > ans = 5.0177 > octave:2> t2-t1 > ans = 3.1200 % ca. 20 times longer > octave:3> tic; t1=cputime ; b=inv(a); t2=cputime ; toc > ans = 87.499 > octave:4> t2-t1 > ans = 72.130 % ca. 39 times longer I was trying to make a different point. On a lightly loaded system the tic/toc and cputime normally give very close to each other results withing 0.1 second or even better. E.g. (on AthlonXP 1700MHz single cpu): octave:7> tic; t1=cputime ; a=rand(2000); t2=cputime ; toc ans = 0.17543 octave:8> t2-t1 ans = 0.17000 octave:9> tic; t1=cputime ; b=inv(a); t2=cputime ; toc ans = 9.1615 octave:10> t2-t1 ans = 9.1500 octave:11> tic; t1=cputime ; c=b*a; t2=cputime ; toc ans = 5.9397 octave:12> t2-t1 ans = 5.9200 If I load a CPU (run say setiathome at nice 1) then they start to differe more: octave:13> tic; t1=cputime ; a=rand(2000); t2=cputime ; toc ans = 0.18272 octave:14> t2-t1 ans = 0.17000 octave:15> tic; t1=cputime ; b=inv(a); t2=cputime ; toc ans = 17.289 octave:16> t2-t1 ans = 9.1900 octave:17> tic; t1=cputime ; c=b*a; t2=cputime ; toc ans = 11.818 octave:18> t2-t1 ans = 5.9700 That is well understood. What is odd is that when I recompile octave against thread-enabled ATLAS (and consequently had to link-in pthread library) the cputime numbers stopped making sense. As far as your (Henry Mollet) data, I have two suspicions: Since you do not have octave-forge installed you are using slow rand() which came with octave proper. The fact that you get significant discrepancy between tic/toc and cputime() data suggests that you might be running some CPU intensive job on the background. The number still puzzling and I am wondering if it might be the case of G3 vs G4 optimization and using wrong library for the CPU. I admit knowing next to nothing about Macs so don't shoot me if it sounds stupid. Regards, Dmitri. p.s. I did verify with a stopwatch that tic/toc times on threaded Octave are correct, so for large problems one can get perhaps up to 50% speedup for some tasks (matrix multiplication is one of them). I will post some numbers soon. ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------