lammps segfaulting using lj/charmm/coul/charmm

LAMMPS is crashing at
pair_lj_charmm_coul_charmm.cpp:108

(The jlist[] array contains garbage.)

This occurs when run using lammps using "run.in.nvt" (input script)
and "system.data" (see attached. The system contains a single
hexadecane molecule.) In this example, I am using
lj/charmm/coul/charmm. The problem goes away when using pair_style
lj/cut. (Strangely everything also seems to run fine when using
lj/charmm/coul/charmm/inter, which was forked from
j/charmm/coul/charmm in mid 2012. Please email me if you want that
code.)

I wish I had time to dig into this further.
(I personally don't really need this pair-style fixed, but I am
curious why it failed.)
Hopefully this is helpful in some way.
Cheers

Andrew

run.in.nvt (1.92 KB)

system.data (5 KB)

hexadecane_LR.jpg

moltemplate_files.tar.bz2 (2.92 KB)

LAMMPS is crashing at
pair_lj_charmm_coul_charmm.cpp:108

(The jlist array contains garbage.)

This occurs when run using lammps using "run.in.nvt" (input script)
and "system.data" (see attached. The system contains a single
hexadecane molecule.) In this example, I am using
lj/charmm/coul/charmm. The problem goes away when using pair_style
lj/cut. (Strangely everything also seems to run fine when using
lj/charmm/coul/charmm/inter, which was forked from
j/charmm/coul/charmm in mid 2012. Please email me if you want that
code.)

I wish I had time to dig into this further.
(I personally don't really need this pair-style fixed, but I am
curious why it failed.)

this is trivial to fix. one must not use any value of jlist without
applying NEIGHMASK.

axel.

diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_
index 65993c6..390e21d 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
@@ -105,10 +105,10 @@ void PairLJCharmmCoulCharmm::compute(int eflag, int vflag)

     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
- jtype = type[j];
       factor_lj = special_lj[sbmask(j)];
       factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
+ jtype = type[j];

       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];

I can confirm that this fixes the bug. Thank you Axel!!

Andrew