Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29236 Discussions

Compiler not generateing/honoring C$OMP PARALLEL DO codes

nightcom26
Beginner
866 Views
I inherit a fortran code that has 2 openmp parallel do declarations. When I compile the code in Release mode, the compiler will tell me that both openmp defined loops are parallelized. However, when I compile the code in Debug mode, the compiler will only tell me that code is compile successfully. If I remove pieces of code in the parallel do region, I can sometime get 1 or both openmp region parallelize under Debug mode.

Under what condition will Fortran compiler not generating Openmp code?

I am using IVF 11.074 and VS2005 SP1.

Thanks you
0 Kudos
5 Replies
jimdempseyatthecove
Honored Contributor III
866 Views

Check the project properties for the Debug configuration to ensure it is enabling OpenMP.

0 Kudos
nightcom26
Beginner
866 Views

Check the project properties for the Debug configuration to ensure it is enabling OpenMP.



Both debug and release have OpenMP enabled.

the problem I have is that by removing pieces of code within inparallel region, I can sometimes get the compiler to compiler code with OpenMP statements.
0 Kudos
jimdempseyatthecove
Honored Contributor III
866 Views

Is the section of code in the parallel region such that optimizations can eliminate the code completely? (assuming optimizations are enabled and the entire region appears as "dead code").

Also, insert a diagnostic write(*,*) omp_get_thread_num()
0 Kudos
nightcom26
Beginner
866 Views
The openmp problem shows up in debug mode, not in release mode, so there shouldn't be any optimization done to the code. Essentially, in debug code, the code is compiled as if openmp statement does not exist.


Quoting - jimdempseyatthecove

Is the section of code in the parallel region such that optimizations can eliminate the code completely? (assuming optimizations are enabled and the entire region appears as "dead code").

Also, insert a diagnostic write(*,*) omp_get_thread_num()

0 Kudos
nightcom26
Beginner
866 Views

I solved the problem by trying the evaluation copy of the latest Intel Fortran compiler. I guess it was a compiler related problem. Time to upgrade.

0 Kudos
Reply