Eliminate mdlib/mdrun.h
[gromacs.git] / src / gromacs / mdtypes / mdrunoptions.h
blob8e7f626310950117209bafa8cdfbbdb7760091fe
1 /*
2 * This file is part of the GROMACS molecular simulation package.
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.
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.
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.
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.
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.
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.
35 /*! \libinternal \file
37 * \brief This file declares helper functionality for legacy option handling for mdrun
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.
46 * \ingroup module_mdtypes
47 * \inlibraryapi
49 #ifndef GMX_MDTYPES_MDRUNOPTIONS_H
50 #define GMX_MDTYPES_MDRUNOPTIONS_H
52 #include "gromacs/utility/basedefinitions.h"
53 #include "gromacs/utility/real.h"
55 namespace gmx
58 //! \internal \brief Options and settings for continuing from checkpoint
59 struct ContinuationOptions
61 //! True if we are continuing from a checkpoint and should append output files
62 bool appendFiles = false;
63 //! True if the -append option was explicitly set by the user (either to true of false
64 bool appendFilesOptionSet = false;
65 //! True if we started from a checkpoint file
66 bool startedFromCheckpoint = false;
67 //! True if we read the kinetic energy from checkpoint file
68 bool haveReadEkin = false;
71 //! \internal \brief Options for writing checkpoint files
72 struct CheckpointOptions
74 //! True means keep all checkpoint file and add the step number to the name
75 gmx_bool keepAndNumberCheckpointFiles = FALSE;
76 //! The period in minutes for writing checkpoint files
77 real period = 15;
80 //! \internal \brief Options for timing (parts of) mdrun
81 struct TimingOptions
83 //! Reset timers at the start of this MD step, -1 means do not reset
84 int resetStep = -1;
85 //! If true, reset timers half-way the run
86 gmx_bool resetHalfway = FALSE;
89 //! \internal \brief Options for IMD
90 struct ImdOptions
92 //! IMD listening port
93 int port = 8888;
94 //! If true, pause the simulation while no IMD client is connected
95 gmx_bool wait = FALSE;
96 //! If true, allow termination of the simulation from IMD client
97 gmx_bool terminatable = FALSE;
98 //! If true, allow COM pulling in the simulation from IMD client
99 gmx_bool pull = FALSE;
102 //! \internal \brief Collection of all options of mdrun that are not processed separately
103 struct MdrunOptions
105 //! Re-compute energies, and possibly forces, for frames from an input tracjectory
106 gmx_bool rerun = FALSE;
107 //! Re-construct virual sites durin a rerun simulation
108 gmx_bool rerunConstructVsites = FALSE;
109 //! Request to do global communication at this interval in steps, -1 is determine from inputrec (deprecated).
110 int globalCommunicationInterval = -1;
111 //! Try to make the simulation binary reproducible
112 gmx_bool reproducible = FALSE;
113 //! Write confout.gro at the end of the run
114 gmx_bool writeConfout = TRUE;
115 //! Options for continuing a simulation from a checkpoint file
116 ContinuationOptions continuationOptions;
117 //! Options for checkpointing th simulation
118 CheckpointOptions checkpointOptions;
119 //! Number of steps to run, -2 is use inputrec, -1 is infinite
120 int64_t numStepsCommandline = -2;
121 //! Maximum duration of this simulation in wall-clock hours, -1 is no limit
122 real maximumHoursToRun = -1;
123 //! Options for timing the run
124 TimingOptions timingOptions;
125 //! If true and supported, will tune the PP-PME load balance
126 gmx_bool tunePme = TRUE;
127 //! True if the user explicitly set the -ntomp command line option
128 gmx_bool ntompOptionIsSet = FALSE;
129 //! Options for IMD
130 ImdOptions imdOptions;
131 //! Increase the verbosity level in the logging and/or stdout/stderr
132 gmx_bool verbose = FALSE;
133 //! If verbose=true, print remaining runtime at this step interval
134 int verboseStepPrintInterval = 100;
137 } // end namespace gmx
139 #endif