[Cython] OpenMP support

Francesc Alted faltet at pytables.org
Tue Mar 8 20:13:03 CET 2011


A Tuesday 08 March 2011 17:38:46 Sturla Molden escrigué:
> But should we care if this is implemented with OpenMP or Python
> threads? It's just an implementation detail in the library, not
> visible to the user.
> 
> Also I am not against OpenMP, I use it all the time in Fortran :-)
> 
> Another problem with using OpenMP inside the compiler, as opposed to
> an external library, is that it depends on a stabile ABI. If an ABI
> change to Cython's generated C code is made, even a minor change,
> OpenMP support will be broken.

And another problem that should be taken in account is that MS Visual 
Studio does not offer OpenMP in the Express edition (the free, as in 
beer, one).  And, in addition, we can expect problems with the OpenMP 
support in GCC for Win.

As I see this, if we could stick using just Python threads, that would 
be our best bet for having a good adoption of future Cython parallel 
capabilities.  In the case that we need dealing with a low-level C-API 
thread library, I'd use pthreads, with a possible light wrapper for 
using it from the Windows thread API on Windows machines.

-- 
Francesc Alted


More information about the cython-devel mailing list