[Numpy-discussion] Openmp support (was numpy's future (1.1 and beyond): which direction(s) ?)

Anne Archibald peridot.faceted@gmail....
Sun Mar 23 13:59:06 CDT 2008


On 23/03/2008, David Cournapeau <david@ar.media.kyoto-u.ac.jp> wrote:
> Gnata Xavier wrote:
>  >
>  > Hi,
>  >
>  > I have a very limited knowledge of openmp but please consider this
>  > testcase :
>  >
>  >
>
>
> Honestly, if it was that simple, it would already have been done for a
>  long time. The problem is that your test-case is not even remotely close
>  to how things have to be done in numpy.

Actually, there are a few places where a parallel for would serve to
accelerate all ufuncs. There are build issues, yes, though they are
mild; we would also want to provide some API to turn parallelization
on and off, and we'd have to verify that OpenMP did not slow down
small arrays, but that would be it. (And I suspect that OpenMP is
smart enough to use single threads without locking when multiple
threads won't help. Certainly all the information is available to
OpenMP to make such decisions.)

This is why I suggested making this change: it should be a low-cost,
high-gain change.

Anne


More information about the Numpy-discussion mailing list