Python and OpenMP question

Asked by heiland

Slightly off-topic, but can one of the developers tell me if a Python-wrapped C/C++ code that uses OpenMP will "just work" (i.e. take advantage of multicore)? I happen to be using Swig to do the wrapping, but perhaps you use Boost in your project. Anyway, I'm wondering what additional tricks, if any, need to be performed. E.g. does the Python need to be compiled with the -fopenmp flag or somesuch?

thanks, Randy

Question information

Language:
English Edit question
Status:
Answered
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Lutz Gross (l-gross) said :
#1

You need to make sure that you close any parallel region before returning to the python level. Under Linux there is no specific work required for boost or python. It will be sufficient to just compile your c++ with openmp. We are actually calling an intel icc compiled library using openmp from python and boost compiled with gcc without openmp. I wouldn't expect a similar situation with swig. I am not a windows expert but for windows this might be very different.

Can you help with this problem?

Provide an answer of your own, or ask heiland for more information if necessary.

To post a message you must log in.