Provide some additional explanations for the "boost neigh_modify one" error

This commit is contained in:
Axel Kohlmeyer
2025-04-09 17:22:38 -04:00
parent 8fd1bf23c9
commit e9695df0e8

View File

@ -982,3 +982,50 @@ order of preference there are:
- Send an email to ``developers@lammps.org``
- Send an email to an :doc:`individual LAMMPS developer <Intro_authors>`
that you know and trust
.. _err0036:
Neighbor list overflow, boost neigh_modify one
----------------------------------------------
The neighbor list code in LAMMPS uses a special memory allocation strategy
to speed up building and accessing neighbor lists.
Instead of making a memory allocation for each list of neighbors of the atoms
LAMMPS allocates "pages" that have room for several neighbor lists. This has
two main advantages:
#. It is not needed to first count how many neighbors there are for an
atom to determine the storage required. Since the pages are much
larger than individual lists, LAMMPS just "fills up" the page until
there is not enough space left and then allocates a new page.
#. There are fewer calls to the memory allocator functions (which can be
time consuming for long-running jobs and fragmented memory space) and
the resulting neighbor lists are close to each other physically which
improves cache efficiency.
This is controlled by the two parameters "one" and "page", respectively,
that can be set via the :doc:`neigh_modify command <neigh_modify>`. The
parameter "one" is the estimate for the number of entries in a single
neighbor list. The parameter "page" is the size of the page. The
default settings are suitable for most systems. They need to be changed
when simulating a system with a very high density or when setting a very
long cutoff (e.g. :math:`\gtrapprox 15 \AA` with :doc:`units real
<units>`). The value of "page" must be at least 10x the value of "one",
but 50x or 100x are recommended to avoid wasting memory. The neighbor
list storage is typically the largest amount of RAM required by a
LAMMPS calculation.
Even though the LAMMPS error message recommends to increase the "one"
parameter, this may not be the correct solution since the neighbor list
overflow can be a symptom of some other error that cannot be easily
detected. For example, a frequent reason for an (unexpected) high
density are incorrect box boundaries or coordinates provided as
fractional coordinates. In both cases, LAMMPS cannot easily know
whether the input geometry has such a high density (and thus requiring
more neighbor list storage) intentionally.
When boosting (= increasing) the "one" parameter, it is recommended to
also increase the value for the "page" parameter to maintain the ratio
between "one" and "page".