[Numpy-discussion] Fast threading solution thoughts
Thu Feb 12 05:05:53 CST 2009
Brian Granger schrieb:
>> I am curious: would you know what would be different in numpy's case
>> compared to matlab array model concerning locks ? Matlab, up to
>> recently, only spreads BLAS/LAPACK on multi-cores, but since matlab 7.3
>> (or 7.4), it also uses multicore for mathematical functions (cos,
>> etc...). So at least in matlab's model, it looks like it can be useful.
> Good point. Is it possible to tell what array size it switches over
> to using multiple threads? Also, do you happen to iknow how Matlab is
> doing this?
Recent Matlab versions use Intels Math Kernel Library, which performs
automatic multi-threading - also for mathematical functions like sin
etc, but not for addition, multiplication etc. It seems to me Matlab
itself does not take care of multi-threading. On
you can have a look at the performance data of the MKL vectorized math
functions. Around a vector length between 100-1000, depending on which
function, precision, cpu architecture, they switch to multi-threading.
More information about the Numpy-discussion