I’m currently interested in compiling the WRF-ARW meteorological model in smpar (i.e.: multithreaded method), but I seem to have some issues with OpenMP.
The machine I’m working on has an 8 core intel CPU i7, therefore should be fully capable of multithreading. I’m testing such capability by compiling and running the example program at page 55 of the PGI Compiler User’s Guide (Release 2013) on an x64 Ubuntu 12.10 OS (bash shell).
I’ve created a FORTRAN file (main.f) with the example program and I’m proceeding this way:
modelstation@modelstation:~$ export OMP_NUM_THREADS=8 modelstation@modelstation:~$ pgf90 -mp main.f
Now, by running the executable, I’m expecting to see 8 threads, but the output is this:
Thread 0 local sum: 500500.0000000000 Global Sum: 500500.0000000000 FORTRAN STOP
I don’t know exactly why and I do not know exactly how to proceed (it’s my first attempt at multithreaded computing).
If it may be helpful for diagnostics: while looking for solutions I’ve also tried testing the OpenMP suggested test-program (http://openmp.org/wp/openmp-compilers/) and I received a “missing predefs.h” error, which I solved by installing libc6-dev-i386 (following this suggestion http://ubuntuforums.org/showthread.php?t=1877944). Even in that case I could see only one thread instead of the expected 8.
Thanks for your help and Best Regards!