From 959f67962dcd1e3961afc0ece4236b3bc4292649 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 17 Dec 2020 22:59:12 -0500 Subject: [PATCH] allow to revert the pair/only setting --- src/GPU/fix_gpu.cpp | 5 +++++ src/KOKKOS/kokkos.cpp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 1f5ad59e09..8f88dfd61d 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -196,6 +196,11 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : if (pair_only_flag) { lmp->suffixp = lmp->suffix; lmp->suffix = nullptr; + } else { + if (lmp->suffixp) { + lmp->suffix = lmp->suffixp; + lmp->suffixp = nullptr; + } } // pass params to GPU library diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index d702fbc1be..85a1b9f4e8 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -467,6 +467,14 @@ void KokkosLMP::accelerator(int narg, char **arg) exchange_comm_classic = forward_comm_classic = reverse_comm_classic = 1; exchange_comm_on_host = forward_comm_on_host = reverse_comm_on_host = 0; + } else { + // restore settings to regular suffix use, if previously, pair/only was used. + if (lmp->suffixp) { + delete[] lmp->suffix; + lmp->suffix = lmp->suffixp; + lmp->suffixp = nullptr; + // TODO: restore communication settings + } } }