set processor number

I just read the user guide and found if running a parallel program, using NCPUS to indicate the number of processor. However, I remember for pgi compiler it should use OMP_NUM_THREAD, while NCPUS is for Intel

Therefore I made a simple test and found OMP_NUM_THREAD rules over NCPUS. But NCPUS works if OMP_NUM_THREAD is not given.

I am wondering if there is any difference between these two variables

Thanks very much

Yisen

However, I remember for pgi compiler it should use OMP_NUM_THREAD, while NCPUS is for Intel

You might have this backwards since I don’t think Intel recognizes NCPUS. NCPUS is a pre-OpenMP environment variable from High-performance Fortran (HPF) and Floating-point systems where PGI’s very first compiler came from.

There is no difference between NCPUS and OMP_NUM_THREADS. However, I would use OMP_NUM_THREADS since it’s the standard way of setting the number of threads in OpenMP.

  • Mat