我正在尝试编译一个代码,其中有一个嵌套循环,我在第一个循环中使用 OpenMp。该程序与本期中的程序非常相似,包括使用 FFTW。错误是:
DO indiceY=1+2*window,ny-2*window
^
internal compiler error: in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:481
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
指定问题的代码段:
call dfftw_init_threads(iret)
!nthreads = omp_get_num_thread()
call dfftw_plan_with_nthreads(nthreads)
!***********************************
CALL dfftw_plan_dft_3d(plan, filter_window, filter_window, filter_window, OUTPUT_FFTW, OUTPUT_FFTW, FFTW_FORWARD, FFTW_ESTIMATE)
!$OMP PARALLEL DO DEFAULT(SHARED) SHARED(matrix_in, window, filter_window, plan, nx, ny, nz) &
!$OMP PRIVATE(indiceX, indiceY, indiceZ, OUTPUT_FFTW, matrix_out)
DO indiceZ=1+2*window,nz-2*window
DO indiceY=1+2*window,ny-2*window
DO indiceX=1+2*window,nx-2*window
OUTPUT_FFTW = ABS(matrix_in(indiceX-2*window:indiceX, indiceY-window:indiceY+window,&
indiceZ-window:indiceZ+window) - &
matrix_in(indiceX:indiceX+2*window, indiceY-window:indiceY+window,&
indiceZ-window:indiceZ+window) )
CALL dfftw_execute_dft(plan, OUTPUT_FFTW, OUTPUT_FFTW)
matrix_outX(indiceX, indiceY, indiceZ) = SUM(ABS(OUTPUT_FFTW))
END DO
END DO
END DO
!$OMP END PARALLEL DO
CALL dfftw_destroy_plan(plan)
!***********************************
CALL dfftw_cleanup_threads()
首先,我怀疑这是内存(RAM)空间的问题,但我在计算中减小了 3D 矩阵的大小,问题仍然存在。我已经查看了这是否是一个报告的错误(确实是一个错误,但似乎不是)。
我还怀疑是 gfortran 版本的问题,所以我安装了gfortran-5
,但错误仍然存在(internal compiler error: in gfc_omp_clause_default_ctor, at fortran/trans-openmp.c:481
我使用的是 64 位 Ubuntu 14.04(3.13.0-119-generic)。