[lammps-users] Error "Segmentation Fault (Core Dumped) " Help?

Hello All,

I have been working on developing a code for a Simple Eukarotic Cell within Lammps.
This paper ( Lennard-Jones type pair-potential method for coarse-grained lipid bilayer membrane simulations in LAMMPS - ScienceDirect) has been a major help but I am at somewhat of an impasse now.

When I run my simulation, it goes fine until i try to read the data file, once this happens I get the error message "Segmentation Fault (Core Dumped) " and the sim cancels out.

I have done some digging on this message and I haven’t seen anything directly on it, just some old posts that didn’t help too much.

Included are the input file I am trying to run, the first few lines of the data file, and a picture of the data file ( as the full file is wayyy to long)

Input File

# Cell Simulation

variable infile string cleaned-up-v1
variable datafile string RBC_V2

variable P_damp equal 1 # Sets the Pressure damping variable used in the following " fix npt" commands
variable P equal 0.05 # Sets the desired pressure of the system used in the following " fix npt" commands
variable scale1 equal ramp(2.7,2.52) # Sets the scale performed in the final fix on water scaling down sigma from 2.7- 2.5
variable ew equal 0.2 # Sets the energy well ( epsilon) variable used in the pair coefficient specifications
variable ini_T equal 0.02 # Sets the initial temperature used in the fix commands below
variable T equal 0.23 # Sets the final temperature used in the fix commands below
variable LD equal 1.0 # Sets the temperature damping parameter used in fix commands below
variable beta equal 0.0194*0.0

units lj

atom_style hybrid ellipsoid peri molecular

bond_style harmonic # Sets the bond style as harmonic spring defined by Hooke’s law

boundary p p p # Creates the periodic boundaries of the simulation box

read_data ${datafile}.data # Specifies which read data file will be used to read in initial coordinates of system

# spectrin bonds
bond_coeff 1 50 1.5 # Defines the bond coefficients and spring constant for the spectrin network bonds

# membrane-spectrin anchoring
bond_coeff 2*3 20 2.0 # Defines the bond coefficients and spring constant for the transmembrane protein to spectrin network bonds

mass * 1.0

set type 1*2 shape 1 1 1 # membrane particle are rigid body, it needs shape parameter to be set

group bilayer type 1 2 # Creates a group called bilayer which consists of type 1 and 2 particles,
#(Type 1 Bilayer, Type 2 Transmembrane proteins)

group network type 3 4 5 # Creates a group called network which consists of type 3 4 5 particles
group anchor_bonds type 2 3 5
group water_in type 6 # Creates a group called water_in consisting of type 6 particles ( Type 6 = Water inside Membrane)
group water_out type 7 # Creates a group called water_out consisting of type 7 particles ( Type 7 = Water Outside Membrane)
group water type 6 7 # Creates a group called water consisting of both type 6 and 7 particles ( Water inside + Out)

velocity bilayer create {T} 87287 loop geom # Creates Initial Velocity for bilayer particles ( Type 1 and 2)* *velocity network create {ini_T} 87287 loop geom # Creates Initial Velocity for network particles ( Type 3 and 4 and 5)
velocity water create ${T} 87287 loop geom # Creates Initial Velocity for water particles ( Type 6 and 7 )

pair_style hybrid lj/cut 3.6 # Sets the pair_style potentials used for the simulation,
#in the case both lennard-jones/cut and the fluidmembrane potential

pair_coeff 12 12 lj/cut {ew} 1.0 # Sets the pair coefficients and parameters between type 1 and 2 (bilayer) particles</i> <i>pair_coeff 1*2 3*5 lj/cut {ew} 1.0 # Sets the pair coefficients (Epsilon, Sigma) and parameters between type 1,2 (bilayer) and 3,4,5 ( Network Particles)
pair_coeff 12 67 lj/cut {ew} 1.0 # Sets the pair coefficients (Epsilon, Sigma) for interaction between type 1,2 (bilayer) and 6,7 (water) particles</i> <i>pair_coeff 3*5 3*5 lj/cut {ew} 1.0 # Sets the pair coefficients (Epsilon, Sigma) for interaction between type 3,4,5 (network)
# and type 3,4,5 (network) particles

pair_coeff 35 67 lj/cut ${ew} 1.0 # Sets the pair coefficients (Epsilon, Sigma) for interaction between type 3,4,5 (network)
# and type 6,7 (water) particles

pair_coeff 67 67 lj/cut ${ew} 2.7 # Sets the pair coefficients (Epsilon, Sigma) for interaction between type 6,7 (water)
# and type 6,7 (water) particles

neighbor 1.0 bin

thermo_style custom step temp press ebond # Printing thermodynamic data to the screen and log file

thermo 200 # Sets the number of timesteps to run before printing out thermodynamic data

timestep 0.005 # Sets the timestep of the simulation

### equilibrium

fix 1 water npt temp {T} {T} {LD} iso {P} {P} {LD}
dump 1 all atom 500 dump.equili.${infile)
run 10000

fix 2 network npt temp {ini_T} {T} {LD} iso {P} {P} {P_damp}
undump 1
dump 2 all atom 500 dump.run.${infile).#1
run 10000

fix 3 bilayer nvt/asphere temp {T} {T} {LD}* *undump 2* *dump 3 all atom 500 dump.run.{infile).#2
run 10000

### change RBC volume

fix 4 water adapt 1 pair lj/cut sigma 6 6 v_scale1
undump 3
dump 4 all atom 500 dump.run.${infile).#3
run 10000

unfix 4
undump 4
dump 5 all atom 500 dump.run.${infile).#4
run 10000

Data File

#RBC_V2.data

21702 atoms
3202 bonds
8346 ellipsoids

7 atom types
3 bond types

-35 35 xlo xhi
-35 35 ylo yhi
-35 35 zlo zhi

Atoms

1 2 0.004 0.005 25.002 1 0.239 0.524 0
2 2 0.000 0.002 -24.998 1 0.239 0.524 0
3 1 0.971 0.009 24.991 1 0.239 0.524 0
4 1 0.488 0.840 24.982 1 0.239 0.524 0
5 1 -0.476 0.840 24.989 1 0.239 0.524 0
6 1 -0.961 0.006 24.991 1 0.239 0.524 0
7 1 -0.484 -0.830 24.982 1 0.239 0.524 0
8 1 0.494 -0.832 24.987 1 0.239 0.524 0
9 1 1.947 0.007 24.935 1 0.239 0.524 0
10 1 1.724 0.904 24.933 1 0.239 0.524 0
11 1 1.106 1.601 24.930 1 0.239 0.524 0
12 1 0.243 1.927 24.933 1 0.239 0.524 0
13 1 -0.677 1.816 24.935 1 0.239 0.524 0
14 1 -1.444 1.294 24.928 1 0.239 0.524 0
15 1 -1.873 0.464 24.929 1 0.239 0.524 0
16 1 -1.879 -0.458 24.933 1 0.239 0.524 0
17 1 -1.445 -1.276 24.932 1 0.239 0.524 0
18 1 -0.681 -1.807 24.926 1 0.239 0.524 0
19 1 0.240 -1.919 24.926 1 0.239 0.524 0
20 1 1.101 -1.591 24.925 1

Picture of Data

Thanks so much for any help you can provide,

Jack

jack,

to be able to assess what a possible issue is, we need two pieces of information:

  • what is the exact LAMMPS version you are using, what platform was it compiled on and with what settings, and does it have any custom code or modifications included?
  • we need a stack trace to identify the location of the segmentation fault and whether this is likely due to some issue in the code or a possible problem with your data file.

thanks,
axel.

i forgot to add. please see https://docs.lammps.org/Errors_debug.html for a short tutorial on different ways of generating a stack trace.

Thanks! Will install the debugging tools ASAP, and run that

but here is the console in my Ubuntu from the sim

jquinn@DESKTOP-D7PCTBN:/mnt/c/users/puala/onedrive/desktop/new_surf/Work 12-15-2020/fluidcopy/try#1$ env OMP_NUM_THREADS=24 lmp_bulb_cuda -sf omp -in in.cleaned-up-v1
LAMMPS (9 Oct 2020)
using 24 OpenMP thread(s) per MPI task
using multi-threaded neighbor list subroutines
WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157)
WARNING: Peratom rmass is in multiple sub-styles - must be used consistently (src/atom_vec_hybrid.cpp:219)
Reading data file …
orthogonal box = (-35.000000 -35.000000 -35.000000) to (35.000000 35.000000 35.000000)
1 by 1 by 1 MPI processor grid
reading atoms …
Segmentation fault (core dumped)

so its seems the data file is the problem?

Also the data file I am using has 21,000 particles in a 35 on all sided units cube, is this too densely packed?

you should upgrade to the 29 October 2020 version.
it is premature to draw conclusions from such limited information.
when recompiling LAMMPS you should compile with MPI support for better parallelization.

axel.

Hey Axel,

Thanks for the Help! Sorry it took me a bit to get back to you with the debug stuff, the Holidays + Finals are always busy!

I have updated to latest stable source code ( Oct 29 2020) , I am running on Ubuntu 20.04 and here is my cmake command ( with MPI now; I downloaded MPICH as well),

$cmake -C …/cmake/presets/all_on.cmake -C …/cmake/presets/nolib.cmake -D PKG_MANYBODY=on -D LAMMPS_MACHINE=bulb-12-18 -D CMAKE_INSTALL_PREFIX=/usr/local/bin -D PKG_MOLECULE=on -D PKG_MC=on -D PKG_RIGID=on -D PKG_ASPHERE=on -D PKG_USER-MISC=on -D PKG_USER-REACTION=on -D PKG_USER-OMP=on -D PKG_DIPOLE=on -D BUILD_MPI=yes …/cmake

Tried to run this to see if it cleared the error but, no dice

Installed the Debug tools, I used GDB

Here is the LAMMPS Debugging build config, kept it as similar as possible to the executable I want to use for this sim

– <<< Build configuration >>>
Operating System: Linux
Build type: debug
Install path: /usr/local/bin
Generator: Unix Makefiles using /usr/bin/make
– Enabled packages: ASPHERE;BODY;CLASS2;COLLOID;CORESHELL;DIPOLE;GRANULAR;KSPACE;MANYBODY;MC;MESSAGE;MISC;MLIAP;MOLECULE;OPT;PERI;POEMS;QEQ;REPLICA;RIGID;SHOCK;SNAP;SPIN;SRD;USER-BOCS;USER-CGDNA;USER-CGSDK;USER-COLVARS;USER-DIFFRACTION;USER-DPD;USER-DRUDE;USER-EFF;USER-FEP;USER-INTEL;USER-MANIFOLD;USER-MEAMC;USER-MESODPD;USER-MGPT;USER-MISC;USER-MOFFF;USER-OMP;USER-PHONON;USER-PTM;USER-QTB;USER-REACTION;USER-REAXC;USER-SDPD;USER-SMTBQ;USER-SPH;USER-TALLY;USER-UEF;USER-YAFF
– <<< Compilers and Flags: >>>
– C++ Compiler: /usr/bin/c++
Type: GNU
Version: 9.3.0
C++ Flags: -g
Defines: LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_OMP_COMPAT=4;LAMMPS_JPEG;LAMMPS_GZIP;LAMMPS_FFMPEG;FFT_FFTW3;FFT_FFTW_THREADS;LMP_USER_OMP;LMP_USER_INTEL;LMP_INTEL_USELRT;LMP_INTEL_NO_TBB
– <<< Linker flags: >>>
– Executable name: lmp_-debug
– Static library flags:
– <<< MPI flags >>>
– MPI_defines:
– MPI includes: /usr/include/x86_64-linux-gnu/mpich
– MPI libraries: /usr/lib/x86_64-linux-gnu/libmpichcxx.so;/usr/lib/x86_64-linux-gnu/libmpich.so;
– <<< FFT settings >>>
– Primary FFT lib: FFTW3
– Using double precision FFTs
– Using threaded FFTs
– Configuring done
– Generating done
– Build files have been written to: /home/jquinn/lammps-12-18-2020/debug-build

And Re-ran the bugged script using GDB

(gdb) run <in.cleaned-up-v1
Starting program: /usr/local/bin/lmp_-debug <in.cleaned-up-v1
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
LAMMPS (29 Oct 2020)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94)
using 1 OpenMP thread(s) per MPI task
WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157)
WARNING: Peratom rmass is in multiple sub-styles - must be used consistently (src/atom_vec_hybrid.cpp:219)
Reading data file …
orthogonal box = (-35.000000 -35.000000 -35.000000) to (35.000000 35.000000 35.000000)
1 by 1 by 1 MPI processor grid
reading atoms …

Program received signal SIGSEGV, Segmentation fault.
LAMMPS_NS::AtomVecPeri::data_atom_post (this=0xa4905f0, ilocal=0) at /home/jquinn/lammps-12-18-2020/src/PERI/atom_vec_peri.cpp:108
108 x0[ilocal][0] = x[ilocal][0];

Results from the “where” command:

(gdb) where
#0 LAMMPS_NS::AtomVecPeri::data_atom_post (this=0xa4905f0, ilocal=0) at /home/jquinn/lammps-12-18-2020/src/PERI/atom_vec_peri.cpp:108
#1 0x00000000087a311c in LAMMPS_NS::AtomVecHybrid::data_atom_post (this=0xa48f3f0, ilocal=0)
at /home/jquinn/lammps-12-18-2020/src/atom_vec_hybrid.cpp:438
#2 0x00000000087934f6 in LAMMPS_NS::AtomVec::data_atom (this=0xa48f3f0, coord=0x7ffffffed720, imagetmp=537395712, values=0xa497670)
at /home/jquinn/lammps-12-18-2020/src/atom_vec.cpp:1804
#3 0x000000000877a565 in LAMMPS_NS::atom::data_atoms (this=0xa473e40, n=1024, buf=0x7ffffe310010 “1”, id_offset=0, mol_offset=0,
type_offset=0, shiftflag=0, shift=0x7ffffffedf58) at /home/jquinn/lammps-12-18-2020/src/atom.cpp:1155
#4 0x000000000827c05e in LAMMPS_NS::ReadData::atoms (this=0x7ffffffedd40) at /home/jquinn/lammps-12-18-2020/src/read_data.cpp:1224
#5 0x00000000082708ca in LAMMPS_NS::ReadData::command (this=0x7ffffffedd40, narg=1, arg=0xa48f3a0)
at /home/jquinn/lammps-12-18-2020/src/read_data.cpp:517
#6 0x000000000819d822 in LAMMPS_NS::Input::command_creator<LAMMPS_NS::ReadData> (lmp=0xa4415b0, narg=1, arg=0xa48f3a0)
at /home/jquinn/lammps-12-18-2020/src/input.cpp:791
#7 0x0000000008190826 in LAMMPS_NS::Input::execute_command (this=0xa4653d0) at /home/jquinn/lammps-12-18-2020/src/input.cpp:774
#8 0x000000000818d8d5 in LAMMPS_NS::Input::file (this=0xa4653d0) at /home/jquinn/lammps-12-18-2020/src/input.cpp:263
#9 0x000000000818b7f9 in main (argc=1, argv=0x7ffffffee248) at /home/jquinn/lammps-12-18-2020/src/main.cpp:64
(gdb)

So I am no expert, but it seems the problem may be stemming from those warnings LAMMPS is throwing about the mass?

Thanks for your time,

John

This looks like a genuine bug.

you are using a very unusual atom style (hybrid ellipsoid peri molecular) and it appears that there is nothing in your input that uses either the ellipsoid or the peridynamics properties (and i wonder how they would mesh together in the first place, and for reduced units to boot).

it is difficult to say whether this should have ever worked. do you need the ellipsoid and peri properties? if not, you should drop them and just use atom style molecular, update the data file and then things should work. the failure is apparently inside atom type peri, for which i would assume it has not tested for use with a hybrid atom style. points in peridynamics are very different from atoms, so i am hoping you can explain what that model is about.

to debug this properly, we need something much smaller. only a few 10s of atoms that is representative of the “full” model.
i have made up a minimal data file with just 2 atoms that have peri and ellipsoid properties and that already shows the segfault.

we will have to look closer to implement a general solution.

axel.

jack,
please try making the edit indicated in the diff below and let us know if that “cures” the segmentation fault(s).

axel.

$ git diff
diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp
index 4ea0fd4a23…51e3cbc717 100644
— a/src/PERI/atom_vec_peri.cpp
+++ b/src/PERI/atom_vec_peri.cpp
@@ -81,6 +81,7 @@ void AtomVecPeri::grow_pointers()
vfrac = atom->vfrac;
s0 = atom->s0;
x0 = atom->x0;

  • x = atom->x;
    }

/* ----------------------------------------------------------------------

FYI, we just released a 24 December 2020 patch version of LAMMPS that has this bugfix included (and a few more). Axel.