[C++-sig] OpenMP and boost-python?

Stefan Seefeld seefeld at sympatico.ca
Mon Feb 1 18:23:43 CET 2010


On 02/01/2010 12:07 PM, Anders Wallin wrote:
> Hello group,
> I have C++ code which uses OpenMP to parallellize some algorithms.
> When wrapped with boost-python only one thread seems to run at a time,
> and there is no speedup (as seen with pure C++) when using multiple
> core machines.
>
> The FAQ says this is pretty much expected, but hints at a possible patch:
> http://www.boost.org/doc/libs/1_41_0/libs/python/doc/v2/faq.html#threadsupport
>
> How difficult is it to make boost-python play nice with OpenMP? Anyone
> done it? Is this ever going to be a feature of boost-python, or always
> going to require special patching and hacking?
>    

I'm not sure in how much boost.python would actually need to care about 
this. Presumably, some OpenMP support needs to be provided by the 
runtime library (such as the thread management), so I would expect the 
Python binary (or whatever your main application is) to be responsible 
for initializing the right runtime library / support.

What compiler are you using ? Does it provide some documentation on what 
needs to be done to activate OpenMP at runtime ?

Regards,
         Stefan


-- 

       ...ich hab' noch einen Koffer in Berlin...



More information about the Cplusplus-sig mailing list