Fix random typos
[alexxy/gromacs.git] / src / gromacs / domdec / options.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2018,2019,2021, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
8  *
9  * GROMACS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  *
14  * GROMACS is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with GROMACS; if not, see
21  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23  *
24  * If you want to redistribute modifications to GROMACS, please
25  * consider that scientific software is very special. Version
26  * control is crucial - bugs must be traceable. We will be happy to
27  * consider code for inclusion in the official distribution, but
28  * derived work must not be called official GROMACS. Details are found
29  * in the README & COPYING files - if they are missing, get the
30  * official version at http://www.gromacs.org.
31  *
32  * To help us fund GROMACS development, we humbly ask that you cite
33  * the research papers on the package. Check out http://www.gromacs.org.
34  */
35 /*! \libinternal \file
36  *
37  * \brief This file declares command-line options for mdrun related to
38  * domain decomposition.
39  *
40  * \author Berk Hess <hess@kth.se>
41  * \inlibraryapi
42  * \ingroup module_domdec
43  */
44
45 #ifndef GMX_DOMDEC_OPTIONS_H
46 #define GMX_DOMDEC_OPTIONS_H
47
48 #include <vector>
49
50 #include "gromacs/math/vectypes.h"
51 #include "gromacs/utility/real.h"
52
53 namespace gmx
54 {
55
56 /*! \brief The options for the domain decomposition MPI task ordering. */
57 enum class DdRankOrder
58 {
59     select,     //!< First value (needed to cope with command-line parsing)
60     interleave, //!< Interleave the PP and PME ranks
61     pp_pme,     //!< First all PP ranks, all PME rank at the end
62     cartesian,  //!< Use Cartesian communicators for PP, PME and PP-PME
63     Count       //!< The number of options
64 };
65
66 /*! \brief The options for the dynamic load balancing. */
67 enum class DlbOption
68 {
69     select,           //!< First value (needed to cope with command-line parsing)
70     turnOnWhenUseful, //!< Turn on DLB when we think it would improve performance
71     no,               //!< Never turn on DLB
72     yes,              //!< Turn on DLB from the start and keep it on
73     Count             //!< The number of options
74 };
75
76 /*! \brief Options for checking bonded interactions.
77  *
78  * These values must match the bool false and true used for mdrun -ddcheck */
79 enum class DDBondedChecking : bool
80 {
81     ExcludeZeroLimit = false, //!< Do not check bonded interactions that go to 0 for large distances
82     All              = true   //!< Check all bonded interactions
83 };
84
85 /*! \libinternal \brief Structure containing all (command line) options for the domain decomposition */
86 struct DomdecOptions
87 {
88     //! Style of bonded-interaction checking
89     DDBondedChecking ddBondedChecking = DDBondedChecking::All;
90     //! If true, don't communicate all atoms between the non-bonded cut-off and the larger bonded cut-off, but only those that have non-local bonded interactions. This significantly reduces the communication volume.
91     bool useBondedCommunication = true;
92     //! The domain decomposition grid cell count, 0 means let domdec choose based on the number of ranks.
93     ivec numCells = { 0 };
94     //! The number of separate PME ranks requested, -1 = auto.
95     int numPmeRanks = -1;
96     //! Ordering of the PP and PME ranks, values from enum above.
97     DdRankOrder rankOrder = DdRankOrder::interleave;
98     //! The minimum communication range, used for extended the communication range for bonded interactions (nm).
99     real minimumCommunicationRange = 0;
100     //! Communication range for atom involved in constraints (P-LINCS) (nm).
101     real constraintCommunicationRange = 0;
102     //! Dynamic load balancing option, values from enum above.
103     DlbOption dlbOption = DlbOption::turnOnWhenUseful;
104     /*! \brief Fraction in (0,1) by whose reciprocal the initial
105      * DD cell size will be increased in order to provide a margin
106      * in which dynamic load balancing can act, while preserving
107      * the minimum cell size. */
108     real dlbScaling = 0.8;
109     //! String containing a vector of the relative sizes in the x direction of the corresponding DD cells.
110     const char* cellSizeX = nullptr;
111     //! String containing a vector of the relative sizes in the y direction of the corresponding DD cells.
112     const char* cellSizeY = nullptr;
113     //! String containing a vector of the relative sizes in the z direction of the corresponding DD cells.
114     const char* cellSizeZ = nullptr;
115 };
116
117 } // namespace gmx
118
119 #endif