<div>Dear developers,</div><div><br></div><div>I compiled with Intel and debugging flags, and encountered a runtime error due to use of an unallocated variable. The value will not ultimately be used, but it seems like it could cause segmentation faults or memory corruption, and at any rate makes it harder to use these flags to find other bugs.</div>
<div><br></div><div>I ran example09, on 4 nodes, <a href="http://ch4.nm.in">ch4.nm.in</a></div><div>intel/11.1.072, mkl/11.1.072, fftw/3.2.2-intel,openmpi/1.4.2-intel</div><div>FFLAGS = -g -O0 -check all -traceback</div>
<div><br></div><div>In the output, I get:</div><div><br></div><div>Representation # 3 mode # 3</div><div><br></div><div><div>...</div><div><br></div><div>End of self-consistent calculation</div><div><br></div><div> Convergence has been achieved </div>
<div> </div></div><div> Number of q in the star = 1</div><div> List of q in the star:</div><div> 1 0.000000000 0.000000000 0.000000000</div><div>forrtl: severe (408): fort: (8): Attempt to fetch from allocatable variable RAMTNS when it is not allocated</div>
<div><br></div><div>Image PC Routine Line Source </div><div>ph.x 0000000001A7F16D Unknown Unknown Unknown</div><div>ph.x 0000000001A7DC75 Unknown Unknown Unknown</div>
<div>ph.x 0000000001A201A0 Unknown Unknown Unknown</div><div>ph.x 00000000019B853F Unknown Unknown Unknown</div><div>ph.x 00000000019B8942 Unknown Unknown Unknown</div>
<div>ph.x 000000000046EFAC dynmatrix_ 150 dynmatrix.f90</div><div>ph.x 0000000000443CAA MAIN__ 118 phonon.f90</div><div>ph.x 0000000000443A9C Unknown Unknown Unknown</div>
<div>libc.so.6 00002B76493A8994 Unknown Unknown Unknown</div><div>ph.x 00000000004439A9 Unknown Unknown Unknown</div><div><br></div><div><div>The offending lines in PH/dynmatrix.f90 are:</div>
<div><br></div><div> IF (lgamma.AND.done_epsil.AND.done_zeu) THEN</div><div> CALL write_dyn_mat_header( fildyn, ntyp, nat, ibrav, nspin_mag, &</div><div> celldm, at, bg, omega, symm_type, atm, pmass, tau, ityp, m_loc, &</div>
<div> nqq, epsilon, zstareu, lraman, ramtns*omega/fpi*convfact)</div></div><div><br></div><div>I added</div><div><br></div><div> if(.not. allocated(ramtns)) allocate ( ramtns (3, 3, 3, nat) )</div><div>
<br></div><div>before the call, which allowed the calculation to complete, but what really ought to be done is to avoid passing this thing at all when lraman == .false. since ramtns is an optional parameter to write_dyn_mat_header.</div>
<div><br></div><div>David Strubbe</div><div>UC Berkeley</div>