PPPM causes segmentation fault

Dear LAMMPS users,

I am running LAMMPS on multiple computers and trying to implement pppm under the kspace_style command. When I run this on one computer, it works fine. However, I run it on another and it causes segmentation fault. I know the easy way out is to just use ewald, which will cause my simulations to run longer. Is there an easy fix to something such as this - perhaps I did not include a certain package when making LAMMPS? The computer that it is not working on has the newest version of LAMMPS (downloaded today).

Any help would be appreciated.

Ben

Dear LAMMPS users,

I am running LAMMPS on multiple computers and trying to implement pppm under
the kspace_style command. When I run this on one computer, it works fine.
However, I run it on another and it causes segmentation fault. I know the
easy way out is to just use ewald, which will cause my simulations to run
longer. Is there an easy fix to something such as this - perhaps I did not

as i explained many times and very recently the last time,
segmentation faults are rather generic errors and can be caused by a
large number of reasons. this can be a bug in the LAMMPS code as well
as a bad input. technically, they should not happen with a well
written code and bad input, but some checks for bad input would
significantly interfere with performance, so LAMMPS does not do them.

include a certain package when making LAMMPS? The computer that it is not
working on has the newest version of LAMMPS (downloaded today).

since there have been some changes to various kspace styles, there is
a possibility that a bug has sneaked in (check out
LAMMPS Molecular Dynamics Simulator ). can you reproduce this segfault
with one of the example inputs using pppm that are shipped with
LAMMPS?

axel.

Axel,

Thank you for your prompt response. I do not think I have a bad input script - When I run the exact same input on my personal laptop (which has a version of LAMMPS that I downloaded ~3 months ago, it works fine). I am thinking it has something to do with the other computers that I am using or it could possibly be a LAMMPS bug. I will try looking at the page you emailed me to find a fix. The code and segmentation fault is below.

My input for this was simply:

units metal
atom_style charge
kspace_style pppm 1.0e-4

read_data SiO2.data

pair_style buck/coul/long 10.0 12.0
pair_coeff 1 1 1388.77 .3623188 175.0
pair_coeff 1 2 18003 .2052124 133.5381
pair_coeff 2 2 0 .1 0

#Minimize the potential
thermo 1
fix 1 all nve
fix 2 all box/relax iso 0.0 vmax 0.001
min_style cg
minimize 1.0e-12 1.0e-12 100000 1000000

write_restart data.restart1

run 1

The segmentation fault is:

Setting up minimization …
[ubuntu:05448] *** Process received signal ***
[ubuntu:05448] Signal: Segmentation fault (11)
[ubuntu:05448] Signal code: (128)
[ubuntu:05448] Failing at address: (nil)
[ubuntu:05448] [ 0] [0xb77a940c]
[ubuntu:05448] [ 1] /usr/lib/libfftw3.so.3(+0xe6dee) [0xb7721dee]
[ubuntu:05448] [ 2] /usr/lib/libfftw3.so.3(+0x18dfc) [0xb7653dfc]
[ubuntu:05448] [ 3] /usr/lib/libfftw3.so.3(fftw_execute_dft+0x34) [0xb76fc0f4]
[ubuntu:05448] [ 4] lammps-daily(fft_3d+0x5d) [0x82b9c5d]
[ubuntu:05448] [ 5] lammps-daily(_ZN9LAMMPS_NS4PPPM10poisson_ikEv+0x59) [0x897e2a9]
[ubuntu:05448] [ 6] lammps-daily(_ZN9LAMMPS_NS4PPPM7computeEii+0x19d) [0x898238d]
[ubuntu:05448] [ 7] lammps-daily(_ZN9LAMMPS_NS3Min5setupEv+0x3f0) [0x8418500]
[ubuntu:05448] [ 8] lammps-daily(_ZN9LAMMPS_NS8Minimize7commandEiPPc+0x194) [0x8420874]
[ubuntu:05448] [ 9] lammps-daily(_ZN9LAMMPS_NS5Input15command_creatorINS_8MinimizeEEEvPNS_6LAMMPSEiPPc+0x30) [0x84063d0]
[ubuntu:05448] [10] lammps-daily(_ZN9LAMMPS_NS5Input15execute_commandEv+0x7e9) [0x8404a19]
[ubuntu:05448] [11] lammps-daily(_ZN9LAMMPS_NS5Input4fileEv+0x287) [0x8405be7]
[ubuntu:05448] [12] lammps-daily(main+0x53) [0x814b793]
[ubuntu:05448] [13] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0xb72384d3]
[ubuntu:05448] [14] lammps-daily() [0x814f541]
[ubuntu:05448] *** End of error message ***
^ZSegmentation fault (core dumped)

In those cases, where the error seems to occur sporadically on
different systems I would try running a memory debug using valgrind.
It is quite possible that the code is encountering a bug which (due to
random memory layout differences) does not result in a segfault on
every machine.
Without the data file nobody can reproduce it, so that is up to you.
The backtrace points to FFTW, which is not really helpful, as the bug
could still be causes earlier in the LAMMPS code.

I cannot attach the data file, as it is too big. However, it was generated using VMDs inorganic builder, then written to lammps data format using topotools with atom_style charge. I changed the charges to be +2.4 for Si and -1.2 for O in accordance with BKS potential paper. I included a small sample below:

LAMMPS data file. CGCMM style. atom_style charge generated by VMD/TopoTools v1.2 on Wed Aug 21 21:57:50 MDT 2013
9000 atoms
0 bonds
0 angles
0 dihedrals
0 impropers
2 atom types
0 bond types
0 angle types
0 dihedral types
0 improper types
-25.159066 23.941066 xlo xhi
-24.943498 24.156500 ylo yhi
-27.614500 26.405500 zlo zhi

Pair Coeffs

I cannot attach the data file, as it is too big. However, it was generated

but you *can* verify, if the bundled example inputs still work or crash as well.
i can run multiple inputs that i have using pppm w/o a problem, so it
may well be that there is an issue with the executable or fftw library
that you are using.

axel.

Would simple downloading an older version of LAMMPS be a potential fix for something like this? The executable is the lammps-daily executable that I downloaded from the website.

Ben

Would simple downloading an older version of LAMMPS be a potential fix for
something like this? The executable is the lammps-daily executable that I
downloaded from the website.

you are not thinking straight here.

you *first* have to figure out whether the executable you have can run
on the bundled examples, since those examples are known to be correct.
this is the best way to determine whether there is something wrong
with the executable or something related to it.

only *after* you have determined this, you can think about how to move
forward. anything else is just avoiding the immediate issue but not
solving your problem.

also, please be precise and more careful in your descriptions. you say
that you "downloaded the LAMMPS executable from the website". now,
there are no linux executables on *the* LAMMPS website.

axel.

Axel, I was never able to resolve this issue. I tried doing what you said and tried running the bundled examples. The examples without pppm in them work fine. The others do not. I tried running the downloadable example protein that uses charmm and pppm and I get this output, as when I run my own simulation:

WARNING: OMP_NUM_THREADS environment is not set. (…/comm.cpp:100)
using 1 OpenMP thread(s) per MPI task
Scanning data file …
4 = max bonds/atom
8 = max angles/atom
18 = max dihedrals/atom
2 = max impropers/atom
Reading data file …
orthogonal box = (-27.5 -38.5 -36.3646) to (27.5 38.5 36.3615)
1 by 1 by 1 MPI processor grid
32000 atoms
32000 velocities
27723 bonds
40467 angles
56829 dihedrals
1034 impropers
Finding 1-2 1-3 1-4 neighbors …
4 = max # of 1-2 neighbors
12 = max # of 1-3 neighbors
24 = max # of 1-4 neighbors
26 = max # of special neighbors
Finding SHAKE clusters …
1617 = # of size 2 clusters
3633 = # of size 3 clusters
747 = # of size 4 clusters
4233 = # of frozen angles
PPPM initialization …
G vector (1/distance) = 0.248835
grid = 25 32 32
stencil order = 5
estimated absolute RMS force accuracy = 0.0355478
estimated relative force accuracy = 0.000107051
using double precision FFTs
3d grid and FFT values/proc = 41070 25600
Setting up run …
[benjaminc-virtual-machine:04796] *** Process received signal ***
[benjaminc-virtual-machine:04796] Signal: Segmentation fault (11)
[benjaminc-virtual-machine:04796] Signal code: (128)
[benjaminc-virtual-machine:04796] Failing at address: (nil)
[benjaminc-virtual-machine:04796] [ 0] [0xb778440c]
[benjaminc-virtual-machine:04796] [ 1] /usr/lib/i386-linux-gnu/libfftw3.so.3(+0xdfe0b) [0xb766be0b]
[benjaminc-virtual-machine:04796] [ 2] /usr/lib/i386-linux-gnu/libfftw3.so.3(+0x1dacc) [0xb75a9acc]
[benjaminc-virtual-machine:04796] [ 3] /usr/lib/i386-linux-gnu/libfftw3.so.3(fftw_execute_dft+0x34) [0xb764e2a4]
[benjaminc-virtual-machine:04796] [ 4] lammps-daily(fft_3d+0x61) [0x82bcfe1]
[benjaminc-virtual-machine:04796] [ 5] lammps-daily(_ZN9LAMMPS_NS4PPPM10poisson_ikEv+0x59) [0x8970d89]
[benjaminc-virtual-machine:04796] [ 6] lammps-daily(_ZN9LAMMPS_NS4PPPM7computeEii+0xd1) [0x89752c1]
[benjaminc-virtual-machine:04796] [ 7] lammps-daily(_ZN9LAMMPS_NS6Verlet5setupEv+0x294) [0x8a39844]
[benjaminc-virtual-machine:04796] [ 8] lammps-daily(_ZN9LAMMPS_NS3Run7commandEiPPc+0x326) [0x8a0df76]
[benjaminc-virtual-machine:04796] [ 9] lammps-daily(_ZN9LAMMPS_NS5Input15command_creatorINS_3RunEEEvPNS_6LAMMPSEiPPc+0x30) [0x84087f0]
[benjaminc-virtual-machine:04796] [10] lammps-daily(_ZN9LAMMPS_NS5Input15execute_commandEv+0x76c) [0x840732c]
[benjaminc-virtual-machine:04796] [11] lammps-daily(_ZN9LAMMPS_NS5Input4fileEv+0x2a7) [0x8408477]
[benjaminc-virtual-machine:04796] [12] lammps-daily(main+0x54) [0x814f634]
[benjaminc-virtual-machine:04796] [13] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0xb7163935]
[benjaminc-virtual-machine:04796] [14] lammps-daily() [0x81534a1]
[benjaminc-virtual-machine:04796] *** End of error message ***
Segmentation fault

Axel, I was never able to resolve this issue. I tried doing what you said
and tried running the bundled examples. The examples without pppm in them
work fine. The others do not. I tried running the downloadable example
protein that uses charmm and pppm and I get this output, as when I run my
own simulation:

which means, that you have a broken executable or something related to
that. you get a segmentation fault in the FFTW library.
that is very likely not a problem in LAMMPS, since other executables
elsewhere seem to work just fine.

axel.