[Numpy-discussion] Python ctypes and OpenMP mystery

Eric Carlson ecarlson@eng.ua....
Wed Feb 16 19:24:33 CST 2011


Hello Francesc,
The problem appears to related to my lack of optimization in the 
compilation. If I use

gcc -O3 -c my_lib.c -fPIC -fopenmp -ffast-math


the C executable and ctypes/python versions behave almost identically. 
Getting decent behavior takes some thought, though, far from the 
incredible almost-automatic behavior of numexpr.

Now I've got to figure out how to scale up a bunch of vector 
adds/multiplies. Neither numexpr or openmp get you very far with a bunch 
of "z=a*x+b*y"-type calcs.

Cheers,
Eric



More information about the NumPy-Discussion mailing list