# Help! Segmentation fault

I am learning lammps and I am doing some examples with some changes like the
potential style in order to know how lammps works, I've had success in some
exercises but a have a segmentation fault problem, i have tried to find the
problem, however I could not solve the problem. This is may input scrip and my
log file, can anybody help me with some suggestions?

Thanks, Mara.

units metal
dimension 3
boundary p p p
atom_style atomic
variable latparam equal 5.430
lattice diamond \{latparam\} region box block 0 3 0 3 0 3 units lattice create\_box 1 box lattice diamond {latparam} orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
create_atoms 1 box
mass 1 28.086
pair_style edip
pair_coeff * * Si.edip Si
newton on
compute csym all centro/atom 4
compute peratom all pe/atom
# equilibration
reset_timestep 0
timestep 0.001
velocity all create 300 12345 mom yes rot no
fix 1 all npt temp 300 300 1 iso 0 0 1 drag 1
thermo 1000
thermo_style custom step lx ly lz press pxx pyy pzz pe temp
run 20000
unfix 1
# Store final cell length for strain calculations
variable tmp equal "lx"
variable L0 equal \{tmp\} print &quot;Initial Length, L0: {L0}"
# DEFORMATION
reset_timestep 0
fix 1 all npt temp 300 300 1 y 0 0 1 z 0 0 1 drag 1
variable srate equal 1.0e10
variable srate1 equal "v_srate / 1.0e12"
fix 2 all deform 1 x erate \{srate1\} units box remap x \# p2, p3, p4 are in GPa variable strain equal &quot;\(lx \- v\_L0\)/v\_L0&quot; variable p1 equal &quot;v\_strain&quot; variable p2 equal &quot;\-pxx/10000&quot; variable p3 equal &quot;\-pyy/10000&quot; variable p4 equal &quot;\-pzz/10000&quot; fix def1 all print 100 &quot;{p1} \{p2\} {p3} \${p4}" file Si_SC_100.def1.txt screen no
dump 1 all cfg 250 dump.tensile_*.cfg id type xs ys zs c_csym c_peratom fx fy fz
dump_modify 1 element Si
thermo 1000
thermo_style custom step v_strain temp v_p2 v_p3 v_p4 ke pe press
run 20000

I am learning lammps and I am doing some examples with some changes like the
potential style in order to know how lammps works, I've had success in some
exercises but a have a segmentation fault problem, i have tried to find the
problem, however I could not solve the problem. This is may input scrip and my
log file, can anybody help me with some suggestions?

a segmentation fault is an unspecific error and thus it is often
difficult to identify the cause. in principle, a program should be
written to prevent such errors and LAMMPS does that most of the time,
but in cases, where it would interfere with the performance, such
checks are skipped. so you have to look for clues and try to eliminate
commonly known causes for problems.

the first thing you need to test is whether the segmentation fault is
random or reproducible.

since your input seems to be working in general, it would have to be
something that develops over time and may cause your system to be come
unstable. this is usually best tracked down by printing output more
frequently around the location of the segmentation fault. if it is
reproducible you can keep running normal until you get close and then
change dump and thermo frequency. from looking at your log output, it
appears that your kinetic energy is increasing significantly right
before the segfault. that is not a good sign and another hint that
your system may become unstable, i.e. your time step may be too large
for the dynamics or your manipulations of the system may be too fast
or too unphysical.

this is best determined with some additional test runs using modified
parameters and more frequent output as indicated above.

axel.

If itâ€™s segfaulting, it should produce a core. You can run gdb with the executable+core file to pinpoint the exact segfauling line.

gdb path_to_executable path_to_corefile

You may have to set your ulimit to unlimited to get the corefile.

ulimit -c unlimited

Josh

As Axel said, the last output before the seg-fault shows the
temperature starting to climb. This is not too surprising, given that
you have stretched the crystal in x by 18%, and are presumably
shrinking it in y and z as it tries to keep the lateral stresses
small. A likely scenario is that shortly prior to failure the barostat
time integration became numerically unstable, generating large
unphysical oscillations in ly and lz. This could result in a very
large increase in the number of neighbors. This might expose a
problem in a piece of code that normally works just fine, but has not
been sufficiently stress-tested. PairEDIP would fall in this category,
since it is in USER-MISC. You could try remove different parts of the
script to see which features are associated with the crash.

On the other hand, do you really need to go beyond 18% strain?

Aidan