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

Internal compiler error (C0000005)

jirina
New Contributor I
1,034 Views
Dear all,

I am using Intel Fortran Compiler 10.1.024 [IA-32] and I am getting internal compiler error (C0000005) for the following code (which is only a small, reduced part of the original code, but still giving the same error):

subroutine energy_frame_test ( iter, itg, iterg, cs, Energy_cycles,
+ u, v, w, t, t0, tbx, tby, tbz, h, h0, cp, lam, c, spm, type,
+ Source, dtau, rxh, rxw, rxsurf, tave,
+ iegy_xp, iegy_xm, iegy_yp, iegy_ym, iegy_zp, iegy_zm,
+ rEave, tgminlim, tgmaxlim,
+ sect_beg, sect_end, sect_num, jend )

include 'energy_frame_test.inc'
include 'openmp.inc'

integer*4 i, j, jend, k
integer*4 im1, ip1, jm1, jp1, km1, kp1, r
integer*4 ih, jh, kh, it, jt, kt, ihw, jhw, khw, itw, jtw, ktw
integer*4 its, jts, kts, iqs, jqs, kqs
integer*4 iegy_xp, iegy_xm, iegy_yp, iegy_ym, iegy_zp, iegy_zm
integer*4 mm, typeP, iter, itg, iterg, cs, Energy_cycles
integer*4 sect_beg(2), sect_end(2), sect_num, sc, ibeg, iend

real*4 u(nx,ny,nz), v(nx,ny,nz), w(nx,ny,nz)
real*4 t(nx,ny,nz), h(nx,ny,nz), c(nx,ny,nz)
real*4 h0(nx,ny,nz), t0(nx,ny,nz)
real*4 tbx(nx,ny,nz), tby(nx,ny,nz), tbz(nx,ny,nz)
real*4 cp(nx,ny,nz), lam(nx,ny,nz), Source(nx,ny,nz)
integer*4 spm(nx,ny,nz), type(nx,ny,nz)

real*8 tgminlim, tgmaxlim, hminlim, hmaxlim
real*8 hmax, hmin, rhmax, rhave, have, objemh
real*8 tmax, tmin, rtmax, rtave, tave, objemt
real*8 hwmax, hwmin, rhwmax, rhwave, hwave, objemhw
real*8 twmax, twmin, rtwmax, rtwave, twave, objemtw
real*8 tsmax, tsmin, rtsmax, rtsave, tsave, surft
real*8 qsmax, qsmin, rqsmax, rqsave, qsave, rEave

real*8 rxh, rxw, rxsurf, dtau

integer*4 i1, i2, istep, j1, j2, jstep, k1, k2, kstep
real*4 order

DO SC = 1, SECT_NUM

IBEG = SECT_BEG(SC)
IEND = SECT_END(SC)

DO r=1,max0(iegy_xp,iegy_xm)

*dec$ if defined (_OPENMP_)
*$omp parallel if ( enableOpenMP .AND. omp_energy .AND. omp_section ) num_threads ( threads ) default ( shared )
*$omp& firstprivate
*$omp& ( i, im1, ip1, istep, i1, i2, ibeg, iend,
*$omp& j, jm1, jp1, jstep, j1, j2,
*$omp& k, km1, kp1, kstep, k1, k2, order, typeP, mm )
*$omp& reduction
*$omp& ( +: have, rhave, objemh, tave, rtave, objemt,
*$omp& hwave, rhwave, objemhw, tsave, rtsave, surft,
*$omp& qsave, rqsave )

*$omp sections
*$omp section
*dec$ end if

if ( r.le.iegy_xp ) then

*dec$ if defined (_OPENMP_)
*$omp parallel if ( enableOpenMP .AND. omp_energy .AND. omp_do ) num_threads ( threads ) default ( shared )
*$omp& firstprivate
*$omp& ( i, im1, ip1, istep, i1, i2, ibeg, iend,
*$omp& j, jm1, jp1, jstep, j1, j2,
*$omp& k, km1, kp1, kstep, k1, k2, order, typeP, mm )
*$omp& reduction
*$omp& ( +: have, rhave, objemh, tave, rtave, objemt,
*$omp& hwave, rhwave, objemhw, tsave, rtsave, surft,
*$omp& qsave, rqsave )

*$omp do
*dec$ end if
DO i=ibeg,iend
im1 = i-1
ip1 = i+1

call random_dir ( 2, jend, 2, nz-1, j1, j2, jstep, k1, k2, kstep, order )

if ( order.ge.0.5 ) then

& nbsp; do k=k1,k2,kstep
km1 = k-1
kp1 = k+1
do j=j1,j2,jstep
jm1 = j-1
jp1 = j+1

typeP = type(i,j,k)
if ( typeP.le.-6 ) then
if ( use_glass_h ) then
call energy_enthalpy ( )
else
call energy_temperature ( )
endif
else if ( typeP.eq.-5 .OR. typeP.eq.-4 .OR. typeP.eq.-3 ) then
mm = spm(i,j,k)
call energy_material ( )
endif

end do
end do

else

do j=j1,j2,jstep
jm1 = j-1
jp1 = j+1
do k=k1,k2,kstep
km1 = k-1
kp1 = k+1

typeP = type(i,j,k)
if ( typeP.le.-6 ) then
if ( use_glass_h ) then
call energy_enthalpy ( )
else
call energy_temperature ( )
endif
else if ( typeP.eq.-5 .OR. typeP.eq.-4 .OR. typeP.eq.-3 ) then
mm = spm(i,j,k) call energy_material ( )
endif

end do
end do

endif

END DO
*dec$ if defined (_OPENMP_)
*$omp end do
*$omp end parallel
*dec$ end if

end if

*dec$ if defined (_OPENMP_)
*$omp end sections
*$omp end parallel
*dec$ end if

END DO

END DO

return
end


Included files contain following:

(openmp.inc)
logical*4 enableOpenMP
integer*4 maxCores, threads
logical*4 omp_do, omp_section, omp_energy
COMMON /OpenMP_common/ enableOpenMP, maxCores, threads
COMMON /OpenMP_features/ omp_energy, omp_do, omp_section


(energy_frame_test.inc)
integer*4 nx, ny, nz
logical*4 use_glass_h
COMMON /dimensions/ nx, ny, nz
COMMON /logical_data/ use_glass_h


I tried compiling the .for file with optimization disabled (/Od) and there was no compiler error. However, enabling optimization to "Maximize Speed" or "Maximize Speed plus Higher Level Optimizations (/O3)" results in the compiler error.

I also tried removing the "reduction" from OpenMP directives and there was no compiler error.

Even though the reduced code is not short at all, is there any chance to find the cause of the compiler error in it?

0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,034 Views
If we can reproduce it, we can fix it. Please tell me exactly which switches you used to show the problem.
0 Kudos
jirina
New Contributor I
1,034 Views
The project was created as a new one using Visual Studio 2008 Professional and Intel Fortran Compiler 10.1.024 [IA-32], I am using the "Release" solution configuration, the Command Line is

/nologo /O3 /D_OPENMP_ /fixed /extend_source:132 /Qopenmp /fpscomp:general /assume:byterecl /module:"Release" /object:"Release" /c

with the Additional Options

/align:all /heap-arrays

Thank you for your help.
0 Kudos
Steven_L_Intel1
Employee
1,034 Views
Thanks - I can reproduce the problem with 10.1.025 using just the options /O3 /D_OPENMP_ /extend_source /Qopenmp. I note that it does not reproduce with our next-version development version. I will report this to the developers. If I find a workaround, I will let you know.

0 Kudos
jirina
New Contributor I
1,034 Views
Thank you too for having a look at this problem.

In between, I rewrote the code not to use "omp_do" and "omp_section" logical variables (only one will be .TRUE. at a time). I am using compiler directives "*dec$ if defined" instead, although it is not exactly what I would like to have. If there is a chance for a workaround or an updated compiler version, I will be thankful.
0 Kudos
Steven_L_Intel1
Employee
1,034 Views
Try the 11.0 beta compiler. Your code compiles fine for me with that.
0 Kudos
jirina
New Contributor I
1,034 Views
It works OK, it's great. smiley [:-)] I am using Intel Fortran 11.0.039 [IA-32] now and there is no more internal compiler error when compiling my source code. Thank you very much for helping me to resolve the problem.

I tested the calculation speed of an application compiled with 11.0 and it is about 6.5 % faster than the same application compiled with 10.1, using the same project properties in both versions. That's really good news; you did a great job, guys.
0 Kudos
Reply