Dear forum,
Compiling and linking the following simple code with openmp options produces a crash:
Compiling and linking options: -L/opt/intel/composerxe-2013_update2.2.146/mkl/lib/intel64 -Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -openmp -lpthread
program hello
implicit none
integer, parameter :: n=2000
real (kind=8),dimension (n,n) :: a,b,c
integer :: i,j
call random_number(a)
call random_number(b)
j=n/4
!$omp PARALLEL DO
DO i=1,4
c(:,((i-1)*j+1):i*j)=MATMUL(a,b(:,((i-1)*j+1):i*j))
ENDDO
!$omp end PARALLEL DO
!c=matmul(a,b)
print *, 'Hello World!'
end program
You will never see a hello from the program; just segmentation fault. My laptop has 4 GiB of RAM and the stack size is set to unlimited. If n is set to 1000, then it would compile and run fine. If I omit the openmp options and just use plain matmul(a,b), then it will compile well again.
gfortran can compile and finish the same program with an n as large as 10000. Why cannot ifort finish the program?I don't think n=2000 is too many. The strange thing is that ifort can finish much larger and much complicated blocks of code, but cannot finish matmul.