From ed4f29b147bba9bb0e8e14aab327a354f45040ec Mon Sep 17 00:00:00 2001 From: ejjordan Date: Thu, 18 Feb 2021 17:36:56 +0100 Subject: [PATCH] Use array in gmx_domdec_zones_t --- src/gromacs/domdec/domdec_struct.h | 8 ++++---- src/gromacs/domdec/partition.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gromacs/domdec/domdec_struct.h b/src/gromacs/domdec/domdec_struct.h index db67680fb1..a946173bb7 100644 --- a/src/gromacs/domdec/domdec_struct.h +++ b/src/gromacs/domdec/domdec_struct.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -116,13 +116,13 @@ struct gmx_domdec_zones_t /* The number of zones including the home zone */ int n = 0; /* The shift of the zones with respect to the home zone */ - ivec shift[DD_MAXZONE] = {}; + std::array shift; /* The charge group boundaries for the zones */ - int cg_range[DD_MAXZONE + 1] = {}; + std::array cg_range; /* The pair interaction zone and atom ranges per each i-zone */ std::vector iZones; /* Boundaries of the zones */ - gmx_domdec_zone_size_t size[DD_MAXZONE]; + std::array size; /* The cg density of the home zone */ real dens_zone0 = 0; }; diff --git a/src/gromacs/domdec/partition.cpp b/src/gromacs/domdec/partition.cpp index dca7464ba7..7bc033884e 100644 --- a/src/gromacs/domdec/partition.cpp +++ b/src/gromacs/domdec/partition.cpp @@ -491,7 +491,7 @@ static void dd_set_cginfo(gmx::ArrayRef index_gl, int cg0, int cg1, t static void make_dd_indices(gmx_domdec_t* dd, const int atomStart) { const int numZones = dd->comm->zones.n; - const int* zone2cg = dd->comm->zones.cg_range; + const int* zone2cg = dd->comm->zones.cg_range.data(); const int* zone_ncg1 = dd->comm->zone_ncg1; gmx::ArrayRef globalAtomGroupIndices = dd->globalAtomGroupIndices; @@ -1941,7 +1941,7 @@ static void setup_dd_communication(gmx_domdec_t* dd, matrix box, gmx_ddbox_t* dd v_1 = ddbox->v[dim1]; } - zone_cg_range = zones->cg_range; + zone_cg_range = zones->cg_range.data(); gmx::ArrayRef cginfo_mb = fr->cginfo_mb; zone_cg_range[0] = 0; -- 2.22.0