Commit d81af7b8 authored by Gregor Michalicek's avatar Gregor Michalicek

Fix OpenMP troble in eigen/hsmt_ab.f90

The problem was a "double free or corruption" error. It was related to the
ylm array in eigen/hsmt_ab.f90 being allocated on the heap and not
being a stack array. It seems to be a requirement that OpenMP private
variables are stack variables. At least putting ylm on the stack
seems to have fixed the problem.
parent 38ee135e
...@@ -35,11 +35,12 @@ CONTAINS ...@@ -35,11 +35,12 @@ CONTAINS
INTEGER:: np,k,l,ll1,m,lmax,nkvec,lo,lm,invsfct INTEGER:: np,k,l,ll1,m,lmax,nkvec,lo,lm,invsfct
complex:: term complex:: term
real :: th,v(3),bmrot(3,3),vmult(3) real :: th,v(3),bmrot(3,3),vmult(3)
complex,allocatable:: c_ph(:,:),ylm(:) COMPLEX :: ylm((atoms%lmaxd+1)**2)
complex,allocatable:: c_ph(:,:)
real,allocatable :: gkrot(:,:) real,allocatable :: gkrot(:,:)
LOGICAL :: l_apw LOGICAL :: l_apw
ALLOCATE(c_ph(lapw%nv(1),MERGE(2,1,noco%l_ss)),ylm((atoms%lmaxd+1)**2)) ALLOCATE(c_ph(lapw%nv(1),MERGE(2,1,noco%l_ss)))
ALLOCATE(gkrot(3,lapw%nv(1))) ALLOCATE(gkrot(3,lapw%nv(1)))
lmax=MERGE(atoms%lnonsph(n),atoms%lmax(n),l_nonsph) lmax=MERGE(atoms%lnonsph(n),atoms%lmax(n),l_nonsph)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment