sharc-md / sharc

The SHARC molecular dynamics (MD) program suite is an ab initio MD software package developed to study the excited-state dynamics of molecules.
https://www.sharc-md.org
GNU General Public License v3.0
59 stars 31 forks source link

SEGFAULT in qm.F90 with a large system #97

Open MartinPeschel opened 5 months ago

MartinPeschel commented 5 months ago

Hi everyone!

I recently tried to run a QM/MM calculation with 1359 atoms and 4 singlet states, that crashed with a surprising segfault. After a (longer) investigation, the culprit seemed to be the variable declarations in subroutine NAC_processing(traj,ctrl), the stack usage of which exceeds the default stacksize on my machine.

The problem can be solved by setting ulimit -s unlimited in run.sh. It would be nice to document this somewhere (or allocate the large arrays in this subroutine on the heap).

Best wishes, Martin

maisebastian commented 1 month ago

Hi Martin, our collaborator in Minnesota has made some changes to the allocation of arrays, especially for the NAC processing. Especially some large arrays that scale as (3*natom)^2 are now only allocated if required (for NAC projection or angular momentum conservation). If the relevant options are off, this should dramatically reduce the memory needs of SHARC (especially in QM/MM). The changes are in the main branch.

Best, Sebastian