Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

OpenMP Issue

rza101
Beginner
321 Views
Hi,

I have a code with multiple modules and I am trying to parallelize it using -Qopenmp option with Intel Fortran V10.1.014 Compiler Integration for Microsoft Visual Studio 2005. For testing purposes, I have inserted the following section:

Module xxxx

Use Module a
Use Module b
.
.

Contains

Subroutine xxx

Lots of variable Declarations


nTHREAD = 2 ! set the number of threads
CALL OMP_SET_NUM_THREADS(nTHREAD) ! Call OMP func to set number of threads
!
print*,OMP_GET_MAX_THREADS(),OMP_GET_NUM_THREADS()
!$OMP PARALLEL DEFAULT(SHARED)
!$OMP DO
DO j = 1, 10
WRITE(*,*) 'Thread', OMP_GET_THREAD_NUM(), ' index is ', j
END DO
!$OMP END DO
!$OMP END PARALLEL

Lots of Do and Do while nested loops and lots of code......

End Subroutine xx


Other Subroutines.........

End Module xxxx

I have set following compiler options:

/nologo /Zi /Od /GB /Qpar_threshold:0 /reentrancy /gen-interfaces /Qopenmp /Qopenmp_report:2 /Qpar_report:3 /Qvec_report:5 /Qdiag-enable:sv3 /Qdiag-file:"Debug2_2 with intel.diag" /warn:all /iface:cvf /module:"Debug" /object:"Debug" /traceback /check:bounds /check:uninit /libs:static /threads /dbglibs /c

I get following build error and I do not get any parallelization:
remark: An internal threshold was exceeded: loops may not be vectorized or parallelized. Try to reduce routine size
remark: OpenMP DEFINED REGION WAS PARALLELIZED.

Why I am getting this error? I am not trying to parallelize all of the loops but only 1 loop. I am compiling this code on single processor machine. I noticed that the above error is not due to presence of do while loop but only when I put a specific variable calculations in it. For example:

The following does not give the above error:
lots of code..
.
.
Do while (i.le.n)

i=i+1
End Do while
..
lots of code

But this does:
lots of code..
.
.
Do while (i.le.n)

var1(i,j)=var2(i,j)

i=i+1
End Do while
..
lots of code


Thank you for your help.

Ragini


0 Kudos
1 Reply
TimP
Honored Contributor III
321 Views

If you are interested in cleaning up the diagnostics, don't use par_threshold and par_report options when you want only OpenMP threading. If those options do anything without /Qparallel, their result is likely to be bogus, and I have doubts about their use with /Od as well. You wouldn't need to specify reentrancy or threadsin addition to /Qopenmp or /Qparallel. I don't have a clue what you mean by /GB. What you have quoted are only warnings, and there is an indication that your OpenMP parallel compilation has been accomplished as directed. Your warnings may be produced by the combination of invoking parallel diagnostics with your do while loop structures. OpenMP and Qparallel work better with plain old counted DO loops.

0 Kudos
Reply