2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
38 /*! \libinternal \file
40 * \brief This file declares types and functions for initializing an MD run
42 * \author Berk Hess <hess@kth.se>
46 #ifndef GMX_MDLIB_MDRUN_H
47 #define GMX_MDLIB_MDRUN_H
49 #include "gromacs/timing/wallcycle.h"
56 //! \internal \brief Options and settings for continuing from checkpoint
57 struct ContinuationOptions
59 //! \brief Constructor
60 ContinuationOptions() :
62 appendFilesOptionSet(false),
63 startedFromCheckpoint(false),
68 //! True if we are continuing from a checkpoint and should append output files
70 //! True if the -append option was explicitly set by the user (either to true of false
71 bool appendFilesOptionSet;
72 //! True if we started from a checkpoint file
73 bool startedFromCheckpoint;
74 //! True if we read the kinetic energy from checkpoint file
78 //! \internal \brief Options for writing checkpoint files
79 struct CheckpointOptions
81 //! \brief Constructor
83 keepAndNumberCheckpointFiles(FALSE),
88 //! True means keep all checkpoint file and add the step number to the name
89 gmx_bool keepAndNumberCheckpointFiles;
90 //! The period in minutes for writing checkpoint files
94 //! \internal \brief Options for timing (parts of) mdrun
97 //! \brief Constructor
104 //! Reset timers at the start of this MD step, -1 means do not reset
106 //! If true, reset timers half-way the run
107 gmx_bool resetHalfway;
110 //! \internal \brief Options for IMD
122 //! IMD listening port
124 //! If true, pause the simulation while no IMD client is connected
126 //! If true, allow termination of the simulation from IMD client
127 gmx_bool terminatable;
128 //! If true, allow COM pulling in the simulation from IMD client
132 //! \internal \brief Collection of all options of mdrun that are not processed separately
135 //! \brief Constructor
138 rerunConstructVsites(FALSE),
139 globalCommunicationInterval(-1),
142 continuationOptions(),
144 numStepsCommandline(-2),
145 maximumHoursToRun(-1),
148 ntompOptionIsSet(FALSE),
151 verboseStepPrintInterval(100)
155 //! Re-compute energies, and possibly forces, for frames from an input tracjectory
157 //! Re-construct virual sites durin a rerun simulation
158 gmx_bool rerunConstructVsites;
159 //! Request to do global communication at this interval in steps, -1 is determine from inputrec
160 int globalCommunicationInterval;
161 //! Try to make the simulation binary reproducible
162 gmx_bool reproducible;
163 //! Write confout.gro at the end of the run
164 gmx_bool writeConfout;
165 //! Options for continuing a simulation from a checkpoint file
166 ContinuationOptions continuationOptions;
167 //! Options for checkpointing th simulation
168 CheckpointOptions checkpointOptions;
169 //! Number of steps to run, -2 is use inputrec, -1 is infinite
170 gmx_int64_t numStepsCommandline;
171 //! Maximum duration of this simulation in wall-clock hours, -1 is no limit
172 real maximumHoursToRun;
173 //! Options for timing the run
174 TimingOptions timingOptions;
175 //! If true and supported, will tune the PP-PME load balance
177 //! True if the user explicitly set the -ntomp command line option
178 gmx_bool ntompOptionIsSet;
180 ImdOptions imdOptions;
181 //! Increase the verbosity level in the logging and/or stdout/stderr
183 //! If verbose=true, print remaining runtime at this step interval
184 int verboseStepPrintInterval;
187 //! \brief Allocate and initialize node-local state entries
188 void set_state_entries(t_state *state, const t_inputrec *ir);
190 //! \brief Broadcast inputrec and mtop and allocate node-specific settings
191 void init_parallel(t_commrec *cr, t_inputrec *inputrec,
194 //! \brief Broadcasts the, non-dynamic, state from the master to all ranks in cr->mpi_comm_mygroup
196 // This is intended to be used with MPI parallelization without
197 // domain decompostion (currently with NM and TPI).
198 void broadcastStateWithoutDynamics(const t_commrec *cr, t_state *state);