From b74096b2c4578979aed8ee37461031290d3d71d1 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Thu, 7 Nov 2024 09:35:49 -0800 Subject: [PATCH] Fix bug when a proc has no atoms/neighbors (existing issue) --- src/KOKKOS/pair_kokkos.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index c4bd603041..399142dfaf 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -923,6 +923,8 @@ int GetMaxNeighs(NeighStyle* list) maxneigh = MAX(maxneigh,num_neighs); }, Kokkos::Max(maxneigh)); + if (maxneigh < 0) maxneigh = 0; + return maxneigh; } @@ -958,6 +960,7 @@ EV_FLOAT pair_compute_neighlist (PairStyle* fpair, std::enable_if_t<(NEIGHFLAG&P if (!vectorsize || lastcall < fpair->lmp->neighbor->lastcall) { lastcall = fpair->lmp->update->ntimestep; vectorsize = GetMaxNeighs(list); + if (vectorsize == 0) vectorsize = 1; vectorsize = MathSpecial::powint(2,(int(log2(vectorsize) + 0.5))); // round to nearest power of 2 #if defined(KOKKOS_ENABLE_HIP)