I just discovered that a significant fraction of molecules built with
moltemplate examples (which use the new OPLSAA feature) will cause
LAMMPS to core-dump. I have attached an example. To test it, run
LAMMPS this way
lmp_linux -i run.in
This happens because LAMMPS does not check to see whether "allocate()"
has been invoked before calling "DihedralHybrid::compute()". (The
same is true for angles, bonds, impropers, etc...)
I confess this also happens because moltemplate likes to define
excessive hybrid interactions, even when none are needed. (I'm about
to post another moltemplate patch [version1.23] to fix this particular
issue. Please update to the version 1.23 or later!)
In any case, it would be nice to fix the current LAMMPS behavior as well.
One way to get rid of these seg-faults/core-dumps is to add "if (!
allocated) return;" to the beginning of every hybrid "compute()"
function. You also have to insert "if (! allocated) return 0.0;" at
the beginning of every "memory_usage()" function. (I made this change
to the various "*hybrid.cpp" files from lammps-13May14 and attached
them. These new versions solve the issue.) Alternately, if you want
to just print an error message and quit, that's fine too.
Anyway, the bug in question occurs when (the current version) of
moltemplate is used to build any molecular system lacking improper
interactions (and using OPLSAA). I ran into this issue while building
a system of alkane chains in water. So it's pretty widespread,
although the new moltemplate patch may solve it.
Sorry for all the OPLSAA-related bugs and patches.
run.in (1.18 KB)
system.data (562 Bytes)
angle_hybrid.cpp (10.7 KB)
bond_hybrid.cpp (10.2 KB)
dihedral_hybrid.cpp (10.3 KB)
improper_hybrid.cpp (9.92 KB)
pair_hybrid.cpp (24.7 KB)