Use array in gmx_domdec_zones_t
authorejjordan <ejjordan@kth.se>
Thu, 18 Feb 2021 16:36:56 +0000 (17:36 +0100)
committerJoe Jordan <ejjordan12@gmail.com>
Thu, 18 Feb 2021 17:19:58 +0000 (17:19 +0000)
src/gromacs/domdec/domdec_struct.h
src/gromacs/domdec/partition.cpp

index db67680fb1465e67889d9f6ce471a3dba34668af..a946173bb7c3b67c3e7a8e30ff17a604b2cfb91d 100644 (file)
@@ -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<ivec, DD_MAXZONE> shift;
     /* The charge group boundaries for the zones */
-    int cg_range[DD_MAXZONE + 1] = {};
+    std::array<int, DD_MAXZONE + 1> cg_range;
     /* The pair interaction zone and atom ranges per each i-zone */
     std::vector<DDPairInteractionRanges> iZones;
     /* Boundaries of the zones */
-    gmx_domdec_zone_size_t size[DD_MAXZONE];
+    std::array<gmx_domdec_zone_size_t, DD_MAXZONE> size;
     /* The cg density of the home zone */
     real dens_zone0 = 0;
 };
index dca7464ba7813544b4d0aea99718e05943b74028..7bc033884e7914163806f288e7778698f76837cb 100644 (file)
@@ -491,7 +491,7 @@ static void dd_set_cginfo(gmx::ArrayRef<const int> 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<const int> 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_t> cginfo_mb = fr->cginfo_mb;
 
     zone_cg_range[0]   = 0;