[Numpy-discussion] Fast threading solution thoughts

David Cournapeau david@ar.media.kyoto-u.ac...
Thu Feb 12 08:15:44 CST 2009


Matthieu Brucher wrote:
>
> Sorry, I was refering to my last mail, but I sent so many in 5 minuts ;)
> In C, if you have to arrays (two pointers), the compiler can't make
> aggressive optimizations because they may intersect. With Fortran,
> this is not possible. In this matter, Numpy behaves like C (everyone
> heard about the different a[indices] += a[other_intersecting_indices]
> issues), Matlab is more like Fortran.
>   

I think it is hard to know exactly, because we don't know how matlab is
implemented. It is possible to handle special cases for non overlapping
arrays in numpy, once you are in C; I believe there are many codepath
which we could optimize aggressively, using openMP, SSE, etc... It is
just a lot of work to do so manually, so the real problem is how this
can be handled as generally as possible using a small core.

David


More information about the Numpy-discussion mailing list