Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / domdec / domdec_struct.h
index c2be7bc66ecbd1df384ac5cae63978f40beb06e1..55a6a3e9690b253df20089df981867b88cbb3808 100644 (file)
@@ -59,7 +59,7 @@
 #include "gromacs/utility/real.h"
 
 //! Max number of zones in domain decomposition
-#define DD_MAXZONE  8
+#define DD_MAXZONE 8
 //! Max number of izones in domain decomposition
 #define DD_MAXIZONE 4
 
@@ -74,10 +74,11 @@ struct t_inputrec;
 
 namespace gmx
 {
-template <typename T> class HashedMap;
+template<typename T>
+class HashedMap;
 class LocalAtomSetManager;
 class GpuHaloExchange;
-}
+} // namespace gmx
 
 /*! \internal
  * \brief Pair interaction zone and atom range for an i-zone
@@ -85,7 +86,7 @@ class GpuHaloExchange;
 struct DDPairInteractionRanges
 {
     //! The index of this i-zone in the i-zone list
-    int             iZoneIndex = -1;
+    int iZoneIndex = -1;
     //! The range of j-zones
     gmx::Range<int> jZoneRange;
     //! The i-atom range
@@ -93,38 +94,41 @@ struct DDPairInteractionRanges
     //! The j-atom range
     gmx::Range<int> jAtomRange;
     //! Minimum shifts to consider
-    ivec            shift0 = { };
+    ivec shift0 = {};
     //! Maximum shifts to consider
-    ivec            shift1 = { };
+    ivec shift1 = {};
 };
 
-typedef struct {
+typedef struct
+{
     /* Zone lower corner in triclinic coordinates         */
-    rvec x0 = { };
+    rvec x0 = {};
     /* Zone upper corner in triclinic coordinates         */
-    rvec x1 = { };
+    rvec x1 = {};
     /* Zone bounding box lower corner in Cartesian coords */
-    rvec bb_x0 = { };
+    rvec bb_x0 = {};
     /* Zone bounding box upper corner in Cartesian coords */
-    rvec bb_x1 = { };
+    rvec bb_x1 = {};
 } gmx_domdec_zone_size_t;
 
-struct gmx_domdec_zones_t {
+struct gmx_domdec_zones_t
+{
     /* The number of zones including the home zone */
-    int                                  n = 0;
+    int n = 0;
     /* The shift of the zones with respect to the home zone */
-    ivec                                 shift[DD_MAXZONE] = { };
+    ivec shift[DD_MAXZONE] = {};
     /* The charge group boundaries for the zones */
-    int                                  cg_range[DD_MAXZONE+1] = { };
+    int cg_range[DD_MAXZONE + 1] = {};
     /* 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];
+    gmx_domdec_zone_size_t size[DD_MAXZONE];
     /* The cg density of the home zone */
-    real                                 dens_zone0 = 0;
+    real dens_zone0 = 0;
 };
 
-struct gmx_ddbox_t {
+struct gmx_ddbox_t
+{
     int  npbcdim;
     int  nboundeddim;
     rvec box0;
@@ -142,90 +146,91 @@ struct gmx_ddbox_t {
 struct UnitCellInfo
 {
     //! Constructor
-    UnitCellInfo(const t_inputrec &ir);
+    UnitCellInfo(const t_inputrecir);
 
     //! We have PBC from dim 0 (X) up to npbcdim
-    int  npbcdim;
+    int npbcdim;
     //! The system is bounded from 0 (X) to numBoundedDimensions
-    int  numBoundedDimensions;
+    int numBoundedDimensions;
     //! Tells whether the box bounding the atoms is dynamic
     bool ddBoxIsDynamic;
     //! Screw PBC?
     bool haveScrewPBC;
 };
 
-struct gmx_domdec_t { //NOLINT(clang-analyzer-optin.performance.Padding)
+struct gmx_domdec_t
+{ //NOLINT(clang-analyzer-optin.performance.Padding)
     //! Constructor, only partial for now
-    gmx_domdec_t(const t_inputrec &ir);
+    gmx_domdec_t(const t_inputrecir);
 
     /* The DD particle-particle nodes only */
     /* The communication setup within the communicator all
      * defined in dd->comm in domdec.c
      */
-    int                    nnodes       = 0;
-    MPI_Comm               mpi_comm_all = MPI_COMM_NULL;
+    int      nnodes       = 0;
+    MPI_Comm mpi_comm_all = MPI_COMM_NULL;
     /* The local DD cell index and rank */
-    ivec                   ci         = { 0, 0, 0 };
-    int                    rank       = 0;
-    ivec                   master_ci  = { 0, 0, 0 };
-    int                    masterrank = 0;
+    ivec ci         = { 0, 0, 0 };
+    int  rank       = 0;
+    ivec master_ci  = { 0, 0, 0 };
+    int  masterrank = 0;
     /* Communication with the PME only nodes */
-    int                    pme_nodeid           = 0;
-    gmx_bool               pme_receive_vir_ener = false;
-    gmx_pme_comm_n_box_t  *cnb                  = nullptr;
-    int                    nreq_pme             = 0;
-    MPI_Request            req_pme[8];
+    int                   pme_nodeid           = 0;
+    gmx_bool              pme_receive_vir_ener = false;
+    gmx_pme_comm_n_box_tcnb                  = nullptr;
+    int                   nreq_pme             = 0;
+    MPI_Request           req_pme[8];
 
     /* Properties of the unit cell */
     UnitCellInfo unitCellInfo;
 
     /* The communication setup, identical for each cell, cartesian index */
-    ivec     nc   = { 0, 0, 0 };
-    int      ndim = 0;
-    ivec     dim  = { 0, 0, 0 }; /* indexed by 0 to ndim */
+    ivec nc   = { 0, 0, 0 };
+    int  ndim = 0;
+    ivec dim  = { 0, 0, 0 }; /* indexed by 0 to ndim */
 
     /* Forward and backward neighboring cells, indexed by 0 to ndim */
-    int  neighbor[DIM][2] = { { 0, 0 },  { 0, 0 },  { 0, 0 } };
+    int neighbor[DIM][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 } };
 
     /* Only available on the master node */
     std::unique_ptr<AtomDistribution> ma;
 
     /* Global atom number to interaction list */
-    gmx_reverse_top_t  *reverse_top    = nullptr;
-    int                 nbonded_global = 0;
-    int                 nbonded_local  = 0;
+    gmx_reverse_top_treverse_top    = nullptr;
+    int                nbonded_global = 0;
+    int                nbonded_local  = 0;
 
     /* Whether we have non-self exclusion */
     bool haveExclusions = false;
 
     /* Vsite stuff */
-    gmx::HashedMap<int>       *ga2la_vsite = nullptr;
-    gmx_domdec_specat_comm_t  *vsite_comm  = nullptr;
-    std::vector<int>           vsite_requestedGlobalAtomIndices;
+    gmx::HashedMap<int>*      ga2la_vsite = nullptr;
+    gmx_domdec_specat_comm_tvsite_comm  = nullptr;
+    std::vector<int>          vsite_requestedGlobalAtomIndices;
 
     /* Constraint stuff */
-    gmx_domdec_constraints_t *constraints     = nullptr;
-    gmx_domdec_specat_comm_t *constraint_comm = nullptr;
+    gmx_domdec_constraints_tconstraints     = nullptr;
+    gmx_domdec_specat_comm_tconstraint_comm = nullptr;
 
     /* The number of home atom groups */
-    int                           ncg_home = 0;
+    int ncg_home = 0;
     /* Global atom group indices for the home and all non-home groups */
-    std::vector<int>              globalAtomGroupIndices;
+    std::vector<int> globalAtomGroupIndices;
 
     /* Index from the local atoms to the global atoms, covers home and received zones */
     std::vector<int> globalAtomIndices;
 
     /* Global atom number to local atom number list */
-    gmx_ga2la_t  *ga2la = nullptr;
+    gmx_ga2la_tga2la = nullptr;
 
     /* Communication stuff */
-    gmx_domdec_comm_t *comm = nullptr;
+    gmx_domdec_comm_tcomm = nullptr;
 
     /* The partioning count, to keep track of the state */
     int64_t ddp_count = 0;
 
     /* The managed atom sets that are updated in domain decomposition */
-    gmx::LocalAtomSetManager * atomSets = nullptr;
+    gmx::LocalAtomSetManager* atomSets = nullptr;
 
     /* gmx_pme_recv_f buffer */
     std::vector<gmx::RVec> pmeForceReceiveBuffer;
@@ -235,13 +240,13 @@ struct gmx_domdec_t { //NOLINT(clang-analyzer-optin.performance.Padding)
 };
 
 //! Are we the master node for domain decomposition
-static inline bool DDMASTER(const gmx_domdec_t &dd)
+static inline bool DDMASTER(const gmx_domdec_tdd)
 {
     return dd.rank == dd.masterrank;
 };
 
 //! Are we the master node for domain decomposition, deprecated
-static inline bool DDMASTER(const gmx_domdec_t *dd)
+static inline bool DDMASTER(const gmx_domdec_tdd)
 {
     return dd->rank == dd->masterrank;
 };