From deef74289727f760e91921687ac5a5e63fa8ebfc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 2 Jun 2025 22:19:09 -0400 Subject: [PATCH] make attempt_swap valgrind clean. now fails in pair->compute(). --- src/MC/fix_neighbor_swap.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/MC/fix_neighbor_swap.cpp b/src/MC/fix_neighbor_swap.cpp index 267313cd35..0fedfc460e 100644 --- a/src/MC/fix_neighbor_swap.cpp +++ b/src/MC/fix_neighbor_swap.cpp @@ -413,10 +413,6 @@ int FixNeighborSwap::attempt_swap() // pick a random atom i int i = pick_i_swap_atom(); - if (i < 0) return 0; - - // get global id and position of atom i - // get_global_i(i); // build nearest-neighbor list based on atom i @@ -545,8 +541,9 @@ int FixNeighborSwap::pick_i_swap_atom() i = local_swap_iatom_list[iwhichlocal]; MPI_Allreduce(&id[i], &id_center, 1, MPI_INT, MPI_MAX, world); } else { - return -1; + id_center = -1; } + return i; } /* ----------------------------------------------------------------------