Split simulationWork.useGpuBufferOps into separate x and f flags
[alexxy/gromacs.git] / src / gromacs / mdtypes / mdrunoptions.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2019, 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 helper functionality for legacy option handling for mdrun
38  *
39  * It is likely that much of this content will move closer to the
40  * functionality that supports the respective features. For example,
41  * modules that change behaviour according to whether it is a rerun
42  * could register themselves with the rerun module and get notified at
43  * setup time to set their own boolean, rather than rely on a central
44  * glob of mdrun options being passed around.
45  *
46  * \ingroup module_mdtypes
47  * \inlibraryapi
48  */
49 #ifndef GMX_MDTYPES_MDRUNOPTIONS_H
50 #define GMX_MDTYPES_MDRUNOPTIONS_H
51
52 #include "gromacs/utility/basedefinitions.h"
53 #include "gromacs/utility/real.h"
54
55 namespace gmx
56 {
57
58 //! Enumeration for mdrun appending behavior
59 enum class AppendingBehavior
60 {
61     //! Append only if user command-line and file input is correct
62     Auto,
63     //! Must append
64     Appending,
65     //! Must not append
66     NoAppending
67 };
68
69 //! \internal \brief Options for writing checkpoint files
70 struct CheckpointOptions
71 {
72     //! True means keep all checkpoint file and add the step number to the name
73     gmx_bool keepAndNumberCheckpointFiles = FALSE;
74     //! The period in minutes for writing checkpoint files
75     real period = 15;
76 };
77
78 //! \internal \brief Options for timing (parts of) mdrun
79 struct TimingOptions
80 {
81     //! Reset timers at the start of this MD step, -1 means do not reset
82     int resetStep = -1;
83     //! If true, reset timers half-way the run
84     gmx_bool resetHalfway = FALSE;
85 };
86
87 //! \internal \brief Options for IMD
88 struct ImdOptions
89 {
90     //! IMD listening port
91     int port = 8888;
92     //! If true, pause the simulation while no IMD client is connected
93     gmx_bool wait = FALSE;
94     //! If true, allow termination of the simulation from IMD client
95     gmx_bool terminatable = FALSE;
96     //! If true, allow COM pulling in the simulation from IMD client
97     gmx_bool pull = FALSE;
98 };
99
100 //! \internal \brief Collection of all options of mdrun that are not processed separately
101 struct MdrunOptions
102 {
103     //! Re-compute energies, and possibly forces, for frames from an input tracjectory
104     gmx_bool rerun = FALSE;
105     //! Re-construct virual sites durin a rerun simulation
106     gmx_bool rerunConstructVsites = FALSE;
107     //! Try to make the simulation binary reproducible
108     gmx_bool reproducible = FALSE;
109     //! Write confout.gro at the end of the run
110     gmx_bool writeConfout = TRUE;
111     //! User option for appending.
112     AppendingBehavior appendingBehavior = AppendingBehavior::Auto;
113     //! Options for checkpointing th simulation
114     CheckpointOptions checkpointOptions;
115     //! Number of steps to run, -2 is use inputrec, -1 is infinite
116     int64_t numStepsCommandline = -2;
117     //! Maximum duration of this simulation in wall-clock hours, -1 is no limit
118     real maximumHoursToRun = -1;
119     //! Options for timing the run
120     TimingOptions timingOptions;
121     //! If true and supported, will tune the PP-PME load balance
122     gmx_bool tunePme = TRUE;
123     //! True if the user explicitly set the -ntomp command line option
124     gmx_bool ntompOptionIsSet = FALSE;
125     //! Options for IMD
126     ImdOptions imdOptions;
127     //! Increase the verbosity level in the logging and/or stdout/stderr
128     gmx_bool verbose = FALSE;
129     //! If verbose=true, print remaining runtime at this step interval
130     int verboseStepPrintInterval = 100;
131 };
132
133 } // end namespace gmx
134
135 #endif