Bug Report: OpenMP in 6.12.1
Posted: Tue Feb 14, 2012 5:44 am
Since it was reported in the previous equivalent thread that OpenMP is (possibly) much better in 6.12, thought I'd post some of the OpenMP bugs here to help clean it up. All these are reported as errors by gfortran-4.6.3 on the Intel x86_64 platform. Compilation used the flags "-O3 -march=native -funroll-loops -floop-block -flto -fopenmp" and whatever else the build system adds by itself (something like -m64 -g -ffree-line-length-none).
43_ffts/fourwf.F90 line 787: the !$OMP END PARALLEL DO statement has to actually end after a "end do"! Moving it up one line (before the end if) fixes.
56_mixing/dotprodm_vn.F90: there are repetitions of PRIVATE variables in the directives at lines 272-274, 312-313. Remove them.
56_xc/rhohxc.F90: derived types (blah%moreblah) can't be used in OpenMP directives! Remove dtset%ixc from the directive cluster at line 699. It's only a single integer so copying it across the different OpenMP threads will not destroy performance. In the future, assign dtset%ixc to a local variable and use the local variable name in the SHARED directive instead.
56_xc/xcden.F90 and xcpot.F90: there are PARALLEL DO loops here which don't start with a Fortran DO statement - need to move ifft = 0 assignment outside the loop (it will still be copied to all the individual threads as 0 in the first place).
65_nonlocal/mkffnl.F90: Line 466 is missing a trailing continuation & after the OMP directive. Line 467: Typo, variable "wf_ffnl1" in the SHARED directive should be wk_ffnl1.
65_nonlocal/mkkpg.F90: Line 105, what is variable kkpg doing in the OMP directive? It doesn't exist! Remove to get working. Line 93: two_pi isn't a variable, it's a parameter.
65_nonlocal/opernlb_ylm.F90: Lines 178 and 179 are missing & continuations. Why is the OpenMP styling so inconsistent across the files even within the same folder? Is there not a style guide for this project?
65_nonlocal/opernla_ylm.F90: Missing continuations in the block near line 166.
The biggest danger of these missing continuations is that they only come up (by default) as *warnings*, hence the parallelization is incomplete in the final build.
43_ffts/fourwf.F90 line 787: the !$OMP END PARALLEL DO statement has to actually end after a "end do"! Moving it up one line (before the end if) fixes.
56_mixing/dotprodm_vn.F90: there are repetitions of PRIVATE variables in the directives at lines 272-274, 312-313. Remove them.
56_xc/rhohxc.F90: derived types (blah%moreblah) can't be used in OpenMP directives! Remove dtset%ixc from the directive cluster at line 699. It's only a single integer so copying it across the different OpenMP threads will not destroy performance. In the future, assign dtset%ixc to a local variable and use the local variable name in the SHARED directive instead.
56_xc/xcden.F90 and xcpot.F90: there are PARALLEL DO loops here which don't start with a Fortran DO statement - need to move ifft = 0 assignment outside the loop (it will still be copied to all the individual threads as 0 in the first place).
65_nonlocal/mkffnl.F90: Line 466 is missing a trailing continuation & after the OMP directive. Line 467: Typo, variable "wf_ffnl1" in the SHARED directive should be wk_ffnl1.
65_nonlocal/mkkpg.F90: Line 105, what is variable kkpg doing in the OMP directive? It doesn't exist! Remove to get working. Line 93: two_pi isn't a variable, it's a parameter.
65_nonlocal/opernlb_ylm.F90: Lines 178 and 179 are missing & continuations. Why is the OpenMP styling so inconsistent across the files even within the same folder? Is there not a style guide for this project?
65_nonlocal/opernla_ylm.F90: Missing continuations in the block near line 166.
The biggest danger of these missing continuations is that they only come up (by default) as *warnings*, hence the parallelization is incomplete in the final build.