From c2ed04052907fb8665e23a0dd0e9559405c44e24 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 3 Aug 2020 22:49:21 -0400 Subject: [PATCH] simplify --- src/comm_tiled.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/comm_tiled.cpp b/src/comm_tiled.cpp index 893d0f23d8..79a8f3ab7d 100644 --- a/src/comm_tiled.cpp +++ b/src/comm_tiled.cpp @@ -46,6 +46,11 @@ CommTiled::CommTiled(LAMMPS *lmp) : Comm(lmp) style = 1; layout = Comm::LAYOUT_UNIFORM; pbc_flag = NULL; + buf_send = NULL; + buf_recv = NULL; + overlap = NULL; + rcbinfo = NULL; + cutghostmulti = NULL; init_buffers(); } @@ -73,8 +78,7 @@ CommTiled::~CommTiled() memory->destroy(overlap); deallocate_swap(maxswap); memory->sfree(rcbinfo); - - if (mode == Comm::MULTI) memory->destroy(cutghostmulti); + memory->destroy(cutghostmulti); } /* ---------------------------------------------------------------------- @@ -105,9 +109,8 @@ void CommTiled::init() { Comm::init(); - if (mode == Comm::SINGLE && cutghostmulti) memory->destroy(cutghostmulti); - - if (mode == Comm::MULTI && !cutghostmulti) + memory->destroy(cutghostmulti); + if (mode == Comm::MULTI) memory->create(cutghostmulti,atom->ntypes+1,3,"comm:cutghostmulti"); int bufextra_old = bufextra;