I used to pointer as a firstprivate variable in omp parallel do due to compatibility between intel system(IFORT) and IBM system(XLF).
However, intel system generates below errors.(IBM-xlf can run without error, but value is incorrect.)
*** glibc detected *** ./RGFM.x: double free or corruption (out): 0x00007fffe7ec27a0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f4bec8a0b96]
./R.x[0x482299]
./R.x[0x43d03b]
/opt/intel/composer_xe_2013.5.192/compiler/lib/intel64/libiomp5.so(__kmp_invoke_microtask+0x93)[0x7f4bed382293]
======= Memory map: ========
My code is
program
TYPE ATOM_DATA
sequence
INTEGER :: name
REAL :: coord(3)
END TYPE
TYPE (ATOM_DATA), POINTER :: atom_block(:,:)
integer,pointer :: block_natom(:)
integer:: nthreads,block_num,nsmp
nthreads = 4
block_num = 100
nsmp = 100
C$OMP PARALLEL do private(..... ,
C$OMP& ismp, atom_block) firstprivate(block_natom)
DO ismp = 1, nsmp
allocate(block_natom(0:block_num+1))
...
CALL setup_blockham(block_natom,atom_block) < - error from this subroutine
...
end
subroutine setup_blockham(block_natom,atom_block)
INTEGER :: block_natom(0:block_num+1)
TYPE (ATOM_DATA) :: atom_block(0:block_num+1,block_num)
real ,pointer :: Vp(:)
......
CALL onsite_ham(atom_block(block_num,:)) < - error from this subroutine
...
end
subroutine onsite_ham(block_num)
TYPE (ATOM_DATA) :: atom_block(max_block_natom)
DO ii=1,n/2
W = Vp(atom_block(ii)%name) < - I've checked error here due to trash value of garbage passing and stop
.....
ENDDO
My ifort is composer_xe_2013.5.192