Hi community,
the code below fail with a seg fault when b is 2,000,000 instead of 200,000.
Module ModOne Type :: ClassOne contains Procedure, Pass :: One => SubOne End type ClassOne Private :: SubOne contains Subroutine SubOne(this) Implicit None Class(ClassOne), Intent(InOut) :: this Integer(kind=8) :: c1,c2,c3,a,b Real(kind=8), Allocatable :: tmp(:) a=4 b=2000000 Allocate(tmp(b)) !$OMP PARALLEL private(tmp) num_threads(2) !$OMP DO Do c1=1,a Do c2=1,a Do c3=1,b tmp(c3)=c3 End Do End Do End Do !$OMP END DO !$OMP END PARALLEL end Subroutine SubOne end Module ModOne Program Test use ModOne Implicit None Type(ClassOne) :: a call a%One() End Program Test
This does not happen with num_threads(1), and not when using gfortran.
I used the commerical ifort15.0 and the academic 16.0, both produce the same result.
Compiler commands where
ifort -heap-arrays -mkl -warn nounused -warn declarations -static -O3 -qopenmp
with mkl flags
MKL= -L$(MKLPATH) -I$(MKLINCLUDE) -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -Wl,--start-group $(MKLPATH)/libmkl_intel_lp64.a $(MKLPATH)/libmkl_intel_thread.a $(MKLPATH)/libmkl_core.a -Wl,--end-group -liomp5 -lpthread
I cannot see anything wrong with the example.
Any help???
Thanks a lot and Cheers
Karl