Problem with max available threads when using openMP

Hi all,
I have installed the workstation 12.10 for evaluating openMP of pgfortran. But the maximum available threads given by the compiler is always 1, while other compilers(gfortran and ifort) return the correct value(8). Is there anything wrong with my installation? By the way, my computer’s cpu is Intel i7 930. The OS running on my PC is fedora 17. Thanks!

Below is the simple code to test maximum threads available.

PROGRAM test_parallel_env
USE omp_lib

IMPLICIT NONE
INTEGER(omp_integer_kind)::max_treads ! The max number of threads

max_threads=omp_get_max_threads()
WRITE(*,*)max_threads

END PROGRAM test_parallel_env

CPU INFO

[kepu@kepu-desktop Parallel]$ grep "model name" /proc/cpuinfo
model name	: Intel(R) Core(TM) i7 CPU         930  @ 2.80GHz
model name	: Intel(R) Core(TM) i7 CPU         930  @ 2.80GHz
model name	: Intel(R) Core(TM) i7 CPU         930  @ 2.80GHz
model name	: Intel(R) Core(TM) i7 CPU         930  @ 2.80GHz
model name	: Intel(R) Core(TM) i7 CPU         930  @ 2.80GHz
model name	: Intel(R) Core(TM) i7 CPU         930  @ 2.80GHz
model name	: Intel(R) Core(TM) i7 CPU         930  @ 2.80GHz
model name	: Intel(R) Core(TM) i7 CPU         930  @ 2.80GHz
[kepu@kepu-desktop Parallel]$

Test Result

[kepu@kepu-desktop Parallel]$ pgfortran -mp test_parallel_env.f90 -o test_parallel_env.o
[kepu@kepu-desktop Parallel]$ ./test_parallel_env.o
            1

Hi kk1999,

By default, the number threads is set to 1. To change the default to use all available cores, please use the flag “-mp=allcores”. You can also set the environment variable “OMP_NUM_THREADS” to the number of threads to use.

% pgfortran -mp test_parallel_env.f90 -o test_parallel_env.o -V12.10
% test_parallel_env.o
            1
% setenv OMP_NUM_THREADS 8
% test_parallel_env.o
            8

% pgfortran -mp=allcores test_parallel_env.f90 -o test_parallel_env.o -V12.10
% unsetenv OMP_NUM_THREADS
% test_parallel_env.o
            8
% setenv OMP_NUM_THREADS 4
% test_parallel_env.o
            4

Hope this helps,
Mat