[lammps-users] Too many 1-4 neighbors in Bond potential leads to computer out of memory. How to fix it?

Dear All,

I write a program to test the bond potential.

I set bond potential to each pair of 90 atoms. After I run it, it gave out such Error:

LAMMPS (22 Jan 2008)
Scanning data file …
89 = max bonds/atom
Reading data file …
orthogonal box = (0 0 -0.1) to (35.8569 35.8569 0.1)
1 by 1 by 1 processor grid
1200 atoms
4005 bonds
Finding 1-2 1-3 1-4 neighbors …
89 = max # of 1-2 neighbors
7832 = max # of 1-3 neighbors
697048 = max # of 1-4 neighbors
ERROR on proc 0: Failed to allocate -949136896 bytes for array special:onefour

It seems that there are too many 1-4 neighbors leading to the computer out of memory.

I don’t want to reduce the numbers of atoms. And I also cannot change to a more powerful computer. Then what can I do to fix the problem?


So you are defining bonds between all pairs of atoms in
a system with 90 atoms, i.e. 90^2 bonds? This model
doesn't make sense to me. If all your special_bonds settings
are not 0, then LAMMPS will attempt to walk the bonds
and find all 1-4 interactions. It allocates space for the maximum
it thinks it could find, which will be something like 90^4 for each
atom. So you might run out of memory, even though LAMMPS
would eventually avoid double counting any 1-4 neighbors.

But, again this doesn't seem like an MD model. If all you want
is bonds between a bunch of atoms, you don't need special_bonds
exclusions. So turn off special_bonds completely or don't use
a pair potential.