[Numpy-discussion] Fast threading solution thoughts

Dag Sverre Seljebotn dagss@student.matnat.uio...
Thu Feb 12 07:43:12 CST 2009


Sturla Molden wrote:
> On 2/12/2009 1:50 PM, Francesc Alted wrote:
>
>   
>> Hey!  That's very nice to know.  We already have OpenMP support in 
>> Cython for free (or apparently it seems so :-)
>>     
>
> Not we don't, as variable names are different in C and Cython. But 
> adding support for OpenMP would not bloat the Cython language.
>   
What I meant was "bloat the Cython compiler", i.e. Cython has to know 
about OpenMP and there must be OpenMP-specific code in the compiler. The 
grammar etc. wouldn't change.

But I think I'll be able to lobby it in, given a good spec and some time 
to implement it (about a day of work, so I think this is likely to 
happen within a year).

As Cython must understand what is going on anyway, having things like 
"with cython.openmp.parallell" is actually a lot easier to implement in 
Cython than using comments/pragmas, and looks nicer too IMO. (It means 
that only code generation and not the parser must be modified.)

Dag Sverre


More information about the Numpy-discussion mailing list