about OMP_set_num_threads()

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?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Retired 12/31/2016

Did you include


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

Leave a Comment

Please sign in to add a comment. Not a member? Join today