Commit 5182cc30 authored by Mark Florisson's avatar Mark Florisson

Add documentation for openmp.pxd

parent 208a9bf8
...@@ -175,12 +175,20 @@ particular order:: ...@@ -175,12 +175,20 @@ particular order::
In the example above it is undefined whether an exception shall be raised, In the example above it is undefined whether an exception shall be raised,
whether it will simply break or whether it will return 2. whether it will simply break or whether it will return 2.
Nested Parallelism Using OpenMP Functions
================== ======================
Nested parallelism is currently disabled due to a bug in gcc 4.5 [#]_. However, OpenMP functions can be used by cimporting ``openmp``::
you can freely call functions with parallel sections from a parallel section.
from cython.parallel cimport parallel
cimport openmp
cdef int num_threads
openmp.omp_set_dynamic(1)
with nogil, parallel():
num_threads = openmp.omp_get_num_threads()
...
.. rubric:: References .. rubric:: References
.. [#] http://www.openmp.org/mp-documents/spec30.pdf .. [#] http://www.openmp.org/mp-documents/spec30.pdf
.. [#] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49897
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment