[Cython] OpenMP 4.5 array reductions

Nathan Goldbaum nathan12343 at gmail.com
Fri Aug 31 10:51:00 EDT 2018


Hi all,

I'm curious if there would be any interest in adding support for OpenMP 4.5
array reduction in the cython compiler or alternatively detecting these
cases and raising a cython compiler error.

Currently cython is generating code that will compile but might lead to
race conditions. See:

https://github.com/cython/cython/issues/2316
https://github.com/cython/cython/issues/1504

The trouble with fixing this in the cython compiler is that adding the
appropriate OpenMP pragmas might generate code that will no longer compile
on compilers that don't support OpenMP 4.5. However perhaps that's a better
alternative than the status quo, which is generating code that might
produce random results.

I'd very much appreciate any feedback or advice here as this is currently
blocking our ability to easily add OpenMP to our cython code in places
where we'd like threads to do parallel reductions on large arrays. I would
also not be surprised if there is code in the wild that is racy and
silently producing incorrect results.

-Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20180831/1e9e4f41/attachment.html>


More information about the cython-devel mailing list