Not enough space in special (error not in Lammps manual)

Hello!

I am trying to setup SWM4NP water in a channel made of carbon walls. I have created my walls using the “create_atoms” command, which works without issues. Now, I want to give some atoms in that wall different atom types because I want to apply different charges to them later. For this, I defined the region and use the set command. However, this part fails when it gets to the "delete_bonds’ command.

I get this error: ERROR: Not enough space in special: extra/special/per/atom should be at least 1 (src/src/DRUDE/fix_drude.cpp:354). But the online manual does not have this error listed. So I don’t know what went wrong. Please help. Thank you.

Input and data files are attached.
in.wall-3-layers-tighter (2.8 KB)

EDIT: I have tried multiple times to upload the data file and even changed the file name multiple times, this editor would still not link to the file. Is there another way to deal with this?
data.water+methane-equil16-zero-img-flag (1.4 MB)

Sorry, but this is one of the “self-explanatory” errors. If you don’t know what to do, then you don’t properly understand crucial components of your force field. It tells you that your extra/special/per/atom is too small. What do you think one would need to do in such a case?

Special neighbors are atoms in the pairwise neighbor list that are either directly bonded to each other (1-2 neighbors) or bonded to a bonded atom (1-3 neighbors) or in a bond two bonds away (1-4 neighbors). These are also neighbors that would be part of bonded interactions (bonds, angles, dihedrals). In typical classical force fields, these atoms are excluded from the pair-wise neighbor list, to simplify the parameterization of bonds, angles, and dihedrals. LAMMPS maintains a list of these “special neighbors” for each atom, same as it stores bonds, angles, and dihedrals with atoms. The size of these per-atom arrays is fixed at the creation of the simulation cell, so that if the bond topology is changed later, it needs to be able to accommodate those changes. Especially, when bonds are added, the number of special neighbors (AKA exclusions) has to increase and typically by quite a bit. When all topology data is fixed, e.g. by reading a data file, LAMMPS will determine the optimum values. E.g. for the rhodo benchmark input you get:

  reading atoms ...
  32000 atoms
  reading velocities ...
  32000 velocities
  scanning bonds ...
  4 = max bonds/atom
  scanning angles ...
  8 = max angles/atom
  scanning dihedrals ...
  18 = max dihedrals/atom
  scanning impropers ...
  2 = max impropers/atom
  reading bonds ...
  27723 bonds
  reading angles ...
  40467 angles
  reading dihedrals ...
  56829 dihedrals
  reading impropers ...
  1034 impropers
  4 = max # of 1-2 neighbors
  12 = max # of 1-3 neighbors
  24 = max # of 1-4 neighbors
  26 = max # of special neighbors

The general approach when using extra/xxx/per/atom is to err on the side of being too large. While choosing too much extra property storage per atom, you increase the memory usage and communication may need to send too much data, but for the most part the impact of those are small.

Also, you can always write out a data file, when everything is assembled and its final configuration and then start from there, and it will choose the optimum values again upon reading that data file.

At any rate, how to deal with this error should be obvious now.

Probably your file is too large. Why upload such a large file in the first place. If you want people to help you, you should create small test cases, so simulations run small and debugging can be done quickly. In fact, I would content that you are making your own life harder than it needs to be when working with oversized systems while you are still trying to figure out how to set those up in the first place. Experienced people set up small tests to sort out all simulation details, before they switch to a more reasonable size for setting up a production simulation.

Thank you very much for your explanation, Axel. Before posting this yesterday, I had actually tried to increase the space for the extra/special/per/atom using the read_data command because that was my intuition. But LAMMPS throws a segmentation fault error when I do that and that rarely happens. So, I thought I was doing something wrong, hence, the post. See screenshots.


Also, I didn’t think 1.4 MB is too large. Because this system is actually a scaled down version of the original system I intend to work with. The channel dimension needs to be a minimum size for what I am working on and that’s why I settled for this. Thanks!

There are multiple dont’s in your post.

  • you use screenhots instead of quoting text directly
  • you don’t specify the exact LAMMPS version and platform that you are running on. If I squint, I can guess it from one of the screen shots and that indicates you are not using the latest version, which is what you need to do, if you want anybody else to check it out.

Test examples do not have to make sense for the research that you are doing, they just need to be able to reproduce the issue that you are seeing.

Please keep in mind that people here are volunteering their time, so if you don’t want to play along, you are not very likely to get help. We have put together some guidelines and made that post “sticky” and you are invited to have a closer look and follow these suggestions.

Thank you. I will check out the posting guidelines. I wasn’t aware of it and apologize.

Yes, this is the Aug 2023 version of LAMMPS. I am running on a university cluster and the information available on the cluster partition says it runs Cent OS 8.1 on AMD EPYC™ 7702.

In any case, I will attempt to replicate this on the latest version of LAMMPS and a much smaller system and give feedback. Thanks for your time and response.

EDIT: I have reposted the screenshot in text form as advised.

LAMMPS (2 Aug 2023)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/src/comm.cpp:98)
  using 1 OpenMP thread(s) per MPI task
Reading data file ...
  orthogonal box = (-52 -10.2 -35) to (52 10.2 35)
  8 by 1 by 4 MPI processor grid
  reading atoms ...
  18202 atoms
  reading velocities ...
  18202 velocities
  scanning bonds ...
  4 = max bonds/atom
  scanning angles ...
  6 = max angles/atom
  reading bonds ...
  13632 bonds
  reading angles ...
  3573 angles
Finding 1-2 1-3 1-4 neighbors ...
  special bond factors lj:    0        0        0.5
  special bond factors coul:  0        0        0.5
     4 = max # of 1-2 neighbors
     3 = max # of 1-3 neighbors
     3 = max # of 1-4 neighbors
     5 = max # of special neighbors
  special bonds CPU = 0.001 seconds
  read_data CPU = 0.173 seconds
Setting atom values ...
  183 settings made for type
Setting atom values ...
  190 settings made for type
13478 atoms in group ATOMS
3375 atoms in group CORES
3374 atoms in group DRUDES
165 atoms in group methane
1185 atoms in group wall
16852 atoms in group system
1350 atoms in group system2
System init for delete_bonds ...
PPPM initialization ...
  using 12-bit tables for long-range coulomb (src/src/kspace.cpp:342)
  G vector (1/distance) = 0.29774567
  grid = 135 45 225
  stencil order = 5
  estimated absolute RMS force accuracy = 0.00039555588
  estimated relative force accuracy = 1.1912048e-06
  using double precision FFTW3
  3d grid and FFT values/proc = 232200 129285
Generated 66 of 66 mixed pair_coeff terms from geometric mixing rule
Rebuild special list taking Drude particles into account
Old max number of 1-2 to 1-4 neighbors: 4
New max number of 1-2 to 1-4 neighbors: 5 (+1)
Neighbor list info ...
  update: every = 1 steps, delay = 5 steps, check = yes
  max neighbors/atom: 10000, page size: 100000
  master list distance cutoff = 14
  ghost atom cutoff = 14
  binsize = 7, bins = 15 3 10
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair lj/cut/coul/long, perpetual
      attributes: half, newton on
      pair build: half/bin/newton
      stencil: half/bin/3d
      bin: standard
Deleting bonds ...
  13632 total bonds, 3529 turned on, 10103 turned off
  3573 total angles, 215 turned on, 3358 turned off
  0 total dihedrals, 0 turned on, 0 turned off
  0 total impropers, 0 turned on, 0 turned off
  create bodies CPU = 0.000 seconds
  3375 rigid bodies with 13478 atoms
  0.95112586 = max distance from body owner to body atom
PPPM initialization ...
  using 12-bit tables for long-range coulomb (src/src/kspace.cpp:342)
  G vector (1/distance) = 0.29774567
  grid = 135 45 225
  stencil order = 5
  estimated absolute RMS force accuracy = 0.00039555588
  estimated relative force accuracy = 1.1912048e-06
  using double precision FFTW3
  3d grid and FFT values/proc = 232200 129285
Generated 66 of 66 mixed pair_coeff terms from geometric mixing rule
Setting up Verlet run ...
  Unit style    : real
  Current step  : 0
  Time step     : 0.01
Per MPI rank memory allocation (min/avg/max) = 23.8 | 29.48 | 39.9 Mbytes
   Step         TotEng         KinEng         PotEng          Pxx            Pyy            Pzz           Press          Volume          Temp        c_cTEMP[1]     c_cTEMP[2]     v_Density                                                    v_DensityOxygen       Lx             Ly             Lz
[login-20-26:54453:0:54453] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x20011)
==== backtrace (tid:  54453) ====
 0 0x0000000000055b73 ucs_debug_print_backtrace()  /build-result/src/hpcx-v2.7.0-gcc-MLNX_OFED_LINUX-5.0-1.0.0.0-redhat8.1-x86_64/ucx-v1.9.x/src/ucs/debug/debug.c:656
 1 0x0000000000012dc0 .annobin_sigaction.c()  sigaction.c:0
 2 0x000000000080c3f7 LAMMPS_NS::ComputeTempDrude::compute_vector()  /tmp/root/spack-stage/spack-stage-lammps-20230802-44xc2cqtqgleyfobenl2zfdwqdy22bzn/spack-src/src/DRUDE/compute_temp_drud                                                e.cpp:186
 3 0x000000000073a552 LAMMPS_NS::Thermo::compute()  /tmp/root/spack-stage/spack-stage-lammps-20230802-44xc2cqtqgleyfobenl2zfdwqdy22bzn/spack-src/src/thermo.cpp:396
 4 0x000000000067f290 LAMMPS_NS::Output::setup()  /tmp/root/spack-stage/spack-stage-lammps-20230802-44xc2cqtqgleyfobenl2zfdwqdy22bzn/spack-src/src/output.cpp:204
 5 0x000000000077e5f8 LAMMPS_NS::Verlet::setup()  /tmp/root/spack-stage/spack-stage-lammps-20230802-44xc2cqtqgleyfobenl2zfdwqdy22bzn/spack-src/src/verlet.cpp:160
 6 0x0000000000717629 LAMMPS_NS::Run::command()  /tmp/root/spack-stage/spack-stage-lammps-20230802-44xc2cqtqgleyfobenl2zfdwqdy22bzn/spack-src/src/run.cpp:171
 7 0x0000000000599d04 LAMMPS_NS::Input::execute_command()  /tmp/root/spack-stage/spack-stage-lammps-20230802-44xc2cqtqgleyfobenl2zfdwqdy22bzn/spack-src/src/input.cpp:853
 8 0x000000000059a065 LAMMPS_NS::Input::file()  /tmp/root/spack-stage/spack-stage-lammps-20230802-44xc2cqtqgleyfobenl2zfdwqdy22bzn/spack-src/src/input.cpp:302
 9 0x0000000000402eea main()  /tmp/root/spack-stage/spack-stage-lammps-20230802-44xc2cqtqgleyfobenl2zfdwqdy22bzn/spack-src/src/main.cpp:105
10 0x0000000000023873 __libc_start_main()  ???:0
11 0x0000000000402f6e _start()  ???:0
=================================
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun noticed that process rank 28 with PID 0 on node login-20-26 exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------

I have now ran the simulations with 19 Nov 2024 LAMMPS and the segmentation fault error is reproduced when I try to create space for the extra/special/per/atom. This is the result.

LAMMPS (19 Nov 2024)
Reading data file ...
  orthogonal box = (-50 -10.2 -35) to (50 10.2 35)
  8 by 1 by 4 MPI processor grid
  reading atoms ...
  17040 atoms
  scanning bonds ...
  4 = max bonds/atom
  scanning angles ...
  6 = max angles/atom
  orthogonal box = (-50 -10.2 -35) to (50 10.2 35)
  8 by 1 by 4 MPI processor grid
  reading bonds ...
  13632 bonds
  reading angles ...
  3573 angles
Finding 1-2 1-3 1-4 neighbors ...
  special bond factors lj:    0        0        0.5
  special bond factors coul:  0        0        0.5
     4 = max # of 1-2 neighbors
     3 = max # of 1-3 neighbors
     3 = max # of 1-4 neighbors
     5 = max # of special neighbors
  special bonds CPU = 0.001 seconds
  read_data CPU = 0.144 seconds
Lattice spacing in x,y,z = 4.8 4.8 4.8
Created 553 atoms
  using lattice units in orthogonal box = (-50 -10.2 -35) to (50 10.2 35)
  create_atoms CPU = 0.001 seconds
Created 553 atoms
  using lattice units in orthogonal box = (-50 -10.2 -35) to (50 10.2 35)
  create_atoms CPU = 0.001 seconds
Setting atom values ...
  197 settings made for type
Setting atom values ...
  190 settings made for type
13478 atoms in group ATOMS
3375 atoms in group CORES
3374 atoms in group DRUDES
165 atoms in group methane
1129 atoms in group wall
16852 atoms in group system
1294 atoms in group system2
System init for delete_bonds ...
PPPM initialization ...
  using 12-bit tables for long-range coulomb (../kspace.cpp:342)
  G vector (1/distance) = 0.29839223
  grid = 135 45 225
  stencil order = 5
  estimated absolute RMS force accuracy = 0.00038180028
  estimated relative force accuracy = 1.1497802e-06
  using double precision KISS FFT
  3d grid and FFT values/proc = 232200 129285
Generated 60 of 66 mixed pair_coeff terms from geometric mixing rule
Rebuild special list taking Drude particles into account
Old max number of 1-2 to 1-4 neighbors: 4
New max number of 1-2 to 1-4 neighbors: 5 (+1)
Neighbor list info ...
  update: every = 1 steps, delay = 5 steps, check = yes
  max neighbors/atom: 10000, page size: 100000
  master list distance cutoff = 14
  ghost atom cutoff = 14
  binsize = 7, bins = 15 3 10
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair lj/cut/coul/long, perpetual
      attributes: half, newton on
      pair build: half/bin/newton
      stencil: half/bin/3d
      bin: standard
Deleting bonds ...
  13632 total bonds, 3529 turned on, 10103 turned off
  3573 total angles, 215 turned on, 3358 turned off
  0 total dihedrals, 0 turned on, 0 turned off
  0 total impropers, 0 turned on, 0 turned off
  create bodies CPU = 0.001 seconds
  3375 rigid bodies with 13478 atoms
  0.95112586 = max distance from body owner to body atom
PPPM initialization ...
  using 12-bit tables for long-range coulomb (../kspace.cpp:342)
  G vector (1/distance) = 0.29839223
  grid = 135 45 225
  stencil order = 5
  estimated absolute RMS force accuracy = 0.00038180028
  estimated relative force accuracy = 1.1497802e-06
  using double precision KISS FFT
  3d grid and FFT values/proc = 232200 129285
Generated 60 of 66 mixed pair_coeff terms from geometric mixing rule
Setting up Verlet run ...
  Unit style    : real
  Current step  : 0
  Time step     : 0.01
Per MPI rank memory allocation (min/avg/max) = 24.47 | 29.68 | 39.84 Mbytes
   Step         TotEng         KinEng         PotEng          Pxx            Pyy            Pzz           Press          Volume          Temp        c_cTEMP[1]     c_cTEMP[2]     v_Density                                                    v_DensityOxygen       Lx             Ly             Lz
[login-20-26:60148:0:60148] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x20011)
==== backtrace (tid:  60148) ====
 0 0x0000000000055b73 ucs_debug_print_backtrace()  /build-result/src/hpcx-v2.7.0-gcc-MLNX_OFED_LINUX-5.0-1.0.0.0-redhat8.1-x86_64/ucx-v1.9.x/src/ucs/debug/debug.c:656
 1 0x0000000000012dc0 .annobin_sigaction.c()  sigaction.c:0
 2 0x00000000016a6df6 LAMMPS_NS::ComputeTempDrude::compute_vector()  /home/ksonibar/lammps-19Nov2024/lammps-19Nov2024/src/Obj_mpi/../compute_temp_drude.cpp:183
 3 0x000000000056cb72 LAMMPS_NS::Thermo::compute()  /home/ksonibar/lammps-19Nov2024/lammps-19Nov2024/src/Obj_mpi/../thermo.cpp:402
 4 0x000000000093bec2 LAMMPS_NS::Output::setup()  /home/ksonibar/lammps-19Nov2024/lammps-19Nov2024/src/Obj_mpi/../output.cpp:205
 5 0x0000000000690b14 LAMMPS_NS::Verlet::setup()  /home/ksonibar/lammps-19Nov2024/lammps-19Nov2024/src/Obj_mpi/../verlet.cpp:160
 6 0x0000000000c7cbae LAMMPS_NS::Run::command()  /home/ksonibar/lammps-19Nov2024/lammps-19Nov2024/src/Obj_mpi/../run.cpp:171
 7 0x00000000005d0e91 LAMMPS_NS::Input::execute_command()  /home/ksonibar/lammps-19Nov2024/lammps-19Nov2024/src/Obj_mpi/../input.cpp:868
 8 0x00000000005d17cc LAMMPS_NS::Input::file()  /home/ksonibar/lammps-19Nov2024/lammps-19Nov2024/src/Obj_mpi/../input.cpp:313
 9 0x00000000004bebf8 main()  /home/ksonibar/lammps-19Nov2024/lammps-19Nov2024/src/Obj_mpi/../main.cpp:78
10 0x0000000000023873 __libc_start_main()  ???:0
11 0x00000000004c09be _start()  ???:0
=================================
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun noticed that process rank 28 with PID 0 on node login-20-26 exited on signal 11 (Segmentation fault).

The input and data files for the test systems are attached for your viewing. Thank you very much for your help.

data.txt (1.4 MB)
in.wall (3.1 KB)

uh-oh. (Those two numbers should always be equal.)

1 Like

I can pinpoint the location of the segmentation fault and have put an error message into the code.

What I get now is:

ERROR on proc 0: Drude atom ID 0 for core atom ID 7741 is out of range

Which means that the drude oscillator atom cannot be found because the atom map returns -1. But the drude particle atom ID of 0 indicates that it was never set because the corresponding bond was missing during initialization of fix drude. This is consistent with the observation by @srtee that you don’t have a drude particle for every core atom.

Thank you so much @akohlmey and @srtee. That’s indeed the problem.

I had defined a region that’s supposed to contain only wall atoms and want to give some of these wall atoms new types and charges. But I didn’t know that a drude atom has coordinates in this region as well. So, I think the drude’s atom type got changed as a result and that’s why there’s one less drude in the group. And that led to the error.

Thank you both for your time and effort. This issue is solved now.

1 Like