Here is a short Fortran 90 program that I think shows a compiler problem:
integer, parameter :: MAX_SOUND=100000
integer, parameter :: MAX_CHANNEL=15
integer :: i
integer :: isound=1
real, dimension(MAX_CHANNEL) :: bd
real, dimension(MAX_CHANNEL,MAX_SOUND) :: tovs_bt_dev=0.0
! Compiling with the next line takes 1000 times longer than
! compiling with the line after next instead!
integer :: ncount(MAX_SOUND)= (/(0,i=1,MAX_SOUND)/)
! integer :: ncount(MAX_SOUND)=0
end subroutine stats_data
Initializing the ncount array with the data statement style, compile time is 290 seconds; initializing with the othre style, compile time is 0.27 seconds. The compile command was:
pgf90 -c stats_data.o -g stats_data.f90
Compiler version is: pgf90 6.1-1 64-bit target on x86-64 Linux
Resulting object files are almost the same size, and are very large, scaling linearly with MAX_SOUND. The compile time with the slow method, however, is quadratic in MAX_SOUND.
I tested the same program with the SGI f90 compiler and the IBM xlf90 compiler, and they do not exhibit the compile time slowdown with the first method. The SGI compiler also produces an object file that is proportional in size to MAX_SOUND, while the IBM compiler does not.
So, is this definitely the compiler, or could it be some issue related to the (new) Linux cluster that this compiler is on, such as stack/heap space, etc?
Naval Research Laboratory