On 06/30/11 04:11, Jordi Gutiérrez Hermoso wrote:
On 29 June 2011 18:54,<schloegl@ist.ac.at> wrote:On Tue, Jun 28, 2011 at 09:03:32AM +0200, Alois Schloegl wrote:adding -lgomp to mkoctfile call does not do it. And I've not found any another option to enable openmp at this stage.Did you pass -fopenmp to the compiler? ThomasI tried, but mkoctfile does not accept -fopenmp $ mkoctfile --mex -fopenmp covm_mex.cpp -lz -lgomp mkoctfile: unrecognized argument -fopenmpPass it as an environment variable: CXXFLAGS="-O2 -fopenmp" mkoctifle --mex covm_mex.cpp -lz -lgomp Does that work?
Jordi, thanks for the hint. I tried this too, as well asCFLAGS="-g -O2 -pthread -fopenmp" mkoctfile-3.2.4 --mex covm_mex.cpp -lz -lgomp
CXXFLAGS="-g -O2 -pthread -fopenmp" mkoctfile-3.2.4 --mex covm_mex.cpp -lz -lgomp
In none of these case, more than one CPU core was used. The ratio between cputime() and wall time toc() was always close to 1, and also top showed only 100 % cpu usage at most; with openmp enabled, I saw up to 1200% at the 12 core machine.
Alois