How does fix bond/react handle multiple possible reaction partners for the same atom?

When using fix bond/react in LAMMPS, consider a simple two-body reaction template. Suppose atom 1 simultaneously satisfies the reaction template with two different atoms (e.g., atom 2 and atom 3). How does the algorithm handle this situation?

For example, if both pairs (1,2) and (1,3) match the reaction template at the same timestep, does the code first attempt the reaction between atoms 1 and 2, and if that reaction is successful, skip any further checks involving atom 1 (such as the pair 1–3)? Or are multiple candidate reactions involving the same atom evaluated in some other way?

I encountered a segmentation fault while running my simulation and I am unsure whether it might be related to this situation, where one atom simultaneously matches multiple possible reaction partners.

[m4cl0802:11407:0:11407] Caught signal 11 (Segmentation fault: address not mapped to object at address 0xb8)
[m4cl0802:11408:0:11408] Caught signal 11 (Segmentation fault: address not mapped to object at address 0xb8)
==== backtrace (tid: 11407) ====
0 0x0000000000012d20 __funlockfile() :0
1 0x0000000000d0d4c4 LAMMPS_NS::LabelMap::infer_bondtype() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../label_map.cpp:386
2 0x0000000000eaf0bd LAMMPS_NS::FixBondReact::update_everything() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../fix_bond_react.cpp:3378
3 0x0000000000ebe132 LAMMPS_NS::FixBondReact::superimpose_algorithm() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../fix_bond_react.cpp:1507
4 0x0000000000ebe132 ???() /publicfs01/fs1-share/soft/share-soft/gcc/install-14.2.0/include/c++/14.2.0/bits/stl_vector.h:368
5 0x0000000000ebe132 ???() /publicfs01/fs1-share/soft/share-soft/gcc/install-14.2.0/include/c++/14.2.0/bits/stl_vector.h:738
6 0x0000000000ebe132 LAMMPS_NS::FixBondReact::superimpose_algorithm() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../fix_bond_react.cpp:1508
7 0x0000000000ebfba9 LAMMPS_NS::FixBondReact::post_integrate() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../fix_bond_react.cpp:1027
8 0x000000000079071f LAMMPS_NS::Modify::post_integrate() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../modify.cpp:413
9 0x0000000000615c64 LAMMPS_NS::Verlet::run() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../verlet.cpp:259
10 0x00000000008f20e0 LAMMPS_NS::Run::command() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../run.cpp:176
11 0x00000000005b8742 LAMMPS_NS::Input::execute_command() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../input.cpp:877
12 0x00000000005b940c LAMMPS_NS::Input::file() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../input.cpp:315
13 0x00000000004cd5bc main() /publicfs01/fs1-m8/home/m8s000154/software-m8s000154/lammps-11Feb2026/src/Obj_mpi/../main.cpp:66
14 0x000000000003a7e5 __libc_start_main() ???:0
15 0x00000000004cf83e _start() ???:0

the error solved but my question still exists

Here is the full explanation from the docs:

“The following criteria are used if multiple candidate initiator atom pairs are identified within the cutoff distance:

  1. If the initiator atoms in the pre-reaction template are not 1–2 neighbors (i.e., not directly bonded) the closest potential partner is chosen.

  2. Otherwise, if the initiator atoms in the pre-reaction template are 1–2 neighbors (i.e. directly bonded) the farthest potential partner is chosen.

  3. Then, if both an atom i and atom j have each other as initiator partners, these two atoms are identified as the initiator atom pair of the reaction site.”

In other words, an atom will will only be identified as an eligible initiator atom for one reaction site (for a given reaction on a given time step). This is the same logic as ‘fix bond/create’, so the explanation given on that page may also help:

“If several atoms are close to an atom, it may have multiple possible bond partners. Every atom checks its list of possible bond partners and labels the closest such partner as its “sole” bond partner. After this is done, if atom i has atom j as its sole partner and atom j has atom i as its sole partner, then the i,j bond is “eligible” to be formed.

Note that these rules mean that an atom will only be part of at most one created bond on a given time step. It also means that if atom i chooses atom j as its sole partner, but atom j chooses atom k as its sole partner (because R_{jk}<R_{ij}), then atom i will not form a bond on this time step, even if it has other possible bond partners.”

This logic is likely to only briefly delay a reaction in most cases, but it can be helpful to select unique atom types for the initiator atoms.