OpenMP problem - OMP_NUM_THREADS greater than available cpus

I am having trouble executing a mixed language (C/Fortran 77) program with OpenMP. I get the message

Warning: OMP_NUM_THREADS or NCPUS (2) greater than available cpus (1)

when I attempt to run the program on an SMP enabled dual cpu node using PBS or direct execution.

I am compiling on SLES 9 using the PGI 6.1 64-bit compiler with options: -tp k8-64 -Mbyteswapio -fastsse -mp -mcmodel=medium. I’m using the ACML 2.5 MP library also. The program is linked using the pgf77 command with -Mnomain.

I have compiled simple fortran only and c only mp sample codes and they both run fine directly and under PBS.

Any help would be deeply appreciated.

Hi LisaD,

I’ve seen a similar issue with SuSE 9.3 where the OS doesn’t recognizing both cores of a dual-core system and I think SLES 9 without any service packs has the same problem. Does the command ‘cat /proc/cpuinfo’ on the node show 1 or 2 CPUs? If it only shows 1, then you’ll need to update to the latest service pack.

Note that you can disable the warning by setting the ‘MP_WARN’ environment variable to ‘no’. However, if the OS doesn’t recognize both cores, your application will only run one thread at time.

  • Mat

Mat -
After some testing, I found that my problem was due to linking with the pgc library (-lpgc). Once I removed it, I no longer received the unavailable cpus message and my program ran correctly. (Unfortunately, I don’t remember why I added the library in the first place.)

Thanks for your assistance,
Lisa