Segmentation fault on PDLAMMPS pair_style peri/eps

Dear all,

I am using Peridynamics Lammps to run the simulation for a nanoindentation; however, when I tried the pair style of eps, it tells me a segmentation fault in the code. This didn’t happen when I try the other pair styles like lps, pmb, and ves.

My input file is like this:

units si

dimension 3

boundary p s p

atom_style peri

atom_modify map array
neighbor 0.0010 bin
lattice sc 0.0005

Create desired sample

region sample cylinder y 0.0 0.0 0.020 -0.020 0.0 units box

Make 1 atom type

create_box 1 sample

Create the atoms in the simulation region

create_atoms 1 region sample
pair_style peri/eps

pair_coeff * * 1.4e11 4.8e10 0.0015001 0.0005 0.25 120

Set mass density

set group all density 2200

volume = lattice constant^3

set group all volume 1.25e-10

Dear all,

I am using Peridynamics Lammps to run the simulation for

a nanoindentation; however, when I tried the pair style of eps, it tells me
a segmentation fault in the code. This didn't happen when I try the other
pair styles like lps, pmb, and ves.

​[...]

*and I got a fault message like this:*
LAMMPS (4 Jun 2014)
Lattice spacing in x,y,z = 0.0005 0.0005 0.0005
Created orthogonal box = (-0.02 -0.02 -0.02) to (0.02 0 0.02)
  1 by 1 by 1 MPI processor grid
Created 205943 atoms
Setting atom values ...
  205943 settings made for density
Setting atom values ...
  205943 settings made for volume
25115 atoms in group lower
180828 atoms in group mobile
Setting atom values ...
  25115 settings made for type
5023 atoms in group upper
3280 atoms in group middle
Setting up run ...
Peridynamic bonds:
  total # of bonds = 23774850
  bonds/atom = 115.444
Memory usage per processor = 645.669 Mbytes
Step Temp E_pair E_mol TotEng Press Volume
       0 0.17560964 0 0 7.4897661e-19
1.5600559e-14 3.20064e-05
Segmentation fault (core dumped)

Is there a know bug in this EPS mode?

​no. just what i would call sloppy programming. if you run the code under a
debugger, you'll see that there is a large stack allocation been done which
will lead to a segfault on all setups that do have by default a limited
stack.

try using:

ulimit -s unlimited

at the shell prompt before running LAMMPS.

axel.

please find attached a patch that replaces the stack allocation with a
proper heap allocation.
this also optimizes the process of clearing and copying the temporary
array through calling memset()/memcpy().
which results in a significant speedup on my test machine (about 20%)

axel.

lammps-peri-no-stack-alloc.diff.gz (623 Bytes)

Dear Axel Kohlmeyer,

Thank you for your answer, I really appreciate it; however, I met a problem when I type the code you told me.

When I type

$ ulimit -s unlimited

it says:

-bash: ulimit: stack size: cannot modify limit: Invalid argument

Would you like to tell me how to fix this? Thank you very much!

Sincerely,
Max Hao Lu

Dear Axel Kohlmeyer,

Thank you for your answer, I really appreciate it; however, I met a problem when I type the code you told me.

When I type

$ ulimit -s unlimited

it says:

-bash: ulimit: stack size: cannot modify limit: Invalid argument

Would you like to tell me how to fix this? Thank you very much!

Talk to your sysadmin or use the patch I posted and recompile.