From 2ebe1f019fb370251e4c932dd1d06ba7c4d705a2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 26 Aug 2024 21:14:44 -0400 Subject: [PATCH] avoid uninitialized data access in case there are no atoms owned by a process --- src/REACTION/fix_bond_react.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/REACTION/fix_bond_react.cpp b/src/REACTION/fix_bond_react.cpp index b80231cf44..8ed21ce2ba 100644 --- a/src/REACTION/fix_bond_react.cpp +++ b/src/REACTION/fix_bond_react.cpp @@ -3714,7 +3714,7 @@ int FixBondReact::insert_atoms_setup(tagint **my_update_mega_glove, int iupdate) tagint *molecule = atom->molecule; int nlocal = atom->nlocal; - tagint maxmol_all; + tagint maxmol_all = 0;; for (int i = 0; i < nlocal; i++) maxmol_all = MAX(maxmol_all,molecule[i]); MPI_Allreduce(MPI_IN_PLACE,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world);