Community
cancel
Showing results for 
Search instead for 
Did you mean: 
stydofe1
Beginner
53 Views

about OMP_set_num_threads()

I am using Intel composer XE 2011.I have some simple codes as below to test the function OMP_set_num_threads, the program freezes once entering the parallel region.

call OMP_set_num_threads(4)

!$omp parallel

print *, 'hello parallel'

!$omp end parallel



It works fine if I use clause instead.

!$omp parallel num_threads(4)

print *, 'hello parallel'

!$omp end parallel


What am I missing in using the routine OMP_set_num_threads?

0 Kudos
2 Replies
Steven_L_Intel1
Employee
53 Views

jimdempseyatthecove
Black Belt
53 Views

Did you include

USE OMP_LIB

Are you using IMPLICIT NONE?

If you are not using IMPLICIT NONE the compiler will not report that you may have forgotten to have USE OMP_LIB to declare the proper interface for OMP_set_num_threads (which are not necessarily what the default calling sequence is).

Jim Dempsey
Reply