[Numpy-discussion] Fast threading solution thoughts

Sturla Molden sturla at molden.no
Thu Feb 12 10:19:27 EST 2009


On 2/12/2009 4:03 PM, Matthieu Brucher wrote:

> In C89, you will have absolutely no benefit (because there
> are no way you can tell the compiler that there is no aliasing), in
> Fortran, it will be optimized correctly.

In ANSI C (aka C89) the effect is achieved using compiler pragmas.

In ISO C (aka C99) there is a 'restrict' qualifier for tagging pointers 
and arrays as unaliased.

Usually a C compiler will optimize better than most Fortran compilers 
when given enough information.

But the merit of Fortran is the ease by which arrays can be manipulated. 
It is almost comparable to Matlab or Python with NumPy, with performance 
close to C. That makes Fortran excellent for scientific programming.

S.M.




More information about the NumPy-Discussion mailing list