Revert "Eliminate mdlib/mdrun.h"
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 6 Mar 2019 13:00:36 +0000 (14:00 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 6 Mar 2019 13:00:36 +0000 (14:00 +0100)
This reverts commit f4c94df918063cf855ba4575e1aebefb232ace50.

Somehow gerrit permissions were able to be bypassed, and this change
fixes the change that did not go through review as expected. We'll
investigate gerrit settings also.

43 files changed:
src/api/cpp/context_impl.h
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec.h
src/gromacs/essentialdynamics/edsam.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gmxpreprocess/genion.cpp
src/gromacs/gmxpreprocess/readpull.cpp
src/gromacs/imd/imd.cpp
src/gromacs/imd/imd.h
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/broadcaststructs.h
src/gromacs/mdlib/checkpointhandler.h
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/energyoutput.cpp
src/gromacs/mdlib/force.cpp
src/gromacs/mdlib/lincs.cpp
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/md_support.h
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/mdoutf.h
src/gromacs/mdlib/mdrun.h [moved from src/gromacs/mdtypes/mdrunoptions.h with 82% similarity]
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/stat.cpp
src/gromacs/mdlib/trajectory_writing.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdrun/legacymdrunoptions.h
src/gromacs/mdrun/md.cpp
src/gromacs/mdrun/mimic.cpp
src/gromacs/mdrun/minimize.cpp
src/gromacs/mdrun/rerun.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/mdrun/runner.h
src/gromacs/mdrun/tpi.cpp
src/gromacs/pulling/output.cpp
src/gromacs/pulling/output.h
src/gromacs/pulling/pull.cpp
src/gromacs/pulling/pull.h
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/pulling/pull_rotation.h
src/gromacs/swap/swapcoords.cpp
src/gromacs/swap/swapcoords.h
src/programs/mdrun/mdrun.cpp

index cf80f0628a47a220bd4b1821b40b9876c2fbdd48..0d90d1587c1ec800899f1557b57092be6aaa8d93 100644 (file)
@@ -44,7 +44,7 @@
 #include <memory>
 #include <string>
 
-#include "gromacs/mdtypes/mdrunoptions.h"
+#include "gromacs/mdrun/legacymdrunoptions.h"
 
 #include "gmxapi/context.h"
 #include "gmxapi/session.h"
index 2090b4697ea4dd8358a460b5073a9eeec343c1e7..3a7a230a66a97179c5cf7271e92a06b1aa9d1b76 100644 (file)
 #include "gromacs/mdlib/calc_verletbuf.h"
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/constraintrange.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/updategroups.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/pbcutil/pbc.h"
@@ -1934,7 +1934,7 @@ static DlbState forceDlbOffOrBail(DlbState             cmdlineDlbState,
  */
 static DlbState determineInitialDlbState(const gmx::MDLogger &mdlog,
                                          DlbOption dlbOption, gmx_bool bRecordLoad,
-                                         const gmx::MdrunOptions &mdrunOptions,
+                                         const MdrunOptions &mdrunOptions,
                                          const t_inputrec *ir)
 {
     DlbState dlbState = DlbState::offCanTurnOn;
@@ -2137,7 +2137,7 @@ static void setupUpdateGroups(const gmx::MDLogger &mdlog,
 static void set_dd_limits_and_grid(const gmx::MDLogger &mdlog,
                                    t_commrec *cr, gmx_domdec_t *dd,
                                    const DomdecOptions &options,
-                                   const gmx::MdrunOptions &mdrunOptions,
+                                   const MdrunOptions &mdrunOptions,
                                    const gmx_mtop_t *mtop,
                                    const t_inputrec *ir,
                                    const matrix box,
@@ -2953,7 +2953,7 @@ static void set_dd_envvar_options(const gmx::MDLogger &mdlog,
 gmx_domdec_t *init_domain_decomposition(const gmx::MDLogger           &mdlog,
                                         t_commrec                     *cr,
                                         const DomdecOptions           &options,
-                                        const gmx::MdrunOptions       &mdrunOptions,
+                                        const MdrunOptions            &mdrunOptions,
                                         const gmx_mtop_t              *mtop,
                                         const t_inputrec              *ir,
                                         const matrix                   box,
index 5ea2ef1f8ee594338c2007438559e0131fa260b7..56208a19308fc65ce607a112c4053d0711066a08 100644 (file)
@@ -73,6 +73,7 @@ struct gmx_domdec_zones_t;
 struct gmx_localtop_t;
 struct gmx_mtop_t;
 struct gmx_vsite_t;
+struct MdrunOptions;
 struct t_block;
 struct t_blocka;
 struct t_commrec;
@@ -86,7 +87,6 @@ class t_state;
 namespace gmx
 {
 class MDLogger;
-struct MdrunOptions;
 class LocalAtomSetManager;
 } // namespace
 
@@ -203,7 +203,7 @@ gmx_domdec_t *
 init_domain_decomposition(const gmx::MDLogger            &mdlog,
                           t_commrec                      *cr,
                           const DomdecOptions            &options,
-                          const gmx::MdrunOptions        &mdrunOptions,
+                          const MdrunOptions             &mdrunOptions,
                           const gmx_mtop_t               *mtop,
                           const t_inputrec               *ir,
                           const matrix                    box,
index 4ae03b76b86409d7c7646ab797a781d3edeeee93..8ba72b64dca4462e1270c0a1eb50e8e56306fcc0 100644 (file)
@@ -59,6 +59,7 @@
 #include "gromacs/mdlib/broadcaststructs.h"
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdtypes/commrec.h"
index d4d2941a239f04642636e327e2d63249f32c525c..389188933c833e3e34f185ea1e8b9888eaac1416 100644 (file)
@@ -59,6 +59,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/mdatoms.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdtypes/fcdata.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
index feea7e573c1656eb17d7a3cbbabe334580b28021..297b2190e9606cb57a3db683f44d4b4e0b3f6c53 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/force.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/threefry.h"
 #include "gromacs/random/uniformintdistribution.h"
index d39aecc8534cfbd34dddf8ff60abd5286c372393..16f00271e791882196cf1426218ab7de66758227 100644 (file)
@@ -46,6 +46,7 @@
 #include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/mdatoms.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/pull_params.h"
index 3f59bcdc5223c2615d2155c972a452a33e9dee8f..ce4e7bc0cc6d2fa71a50d1f5e6cc69cb677bf6ea 100644 (file)
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/broadcaststructs.h"
 #include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdtypes/enerdata.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
@@ -979,11 +979,11 @@ static void imd_readcommand(t_gmx_IMD_setup *IMDsetup)
  *
  * Call on master only.
  */
-static FILE *open_imd_out(const char                     *fn,
-                          t_gmx_IMD_setup                *IMDsetup,
-                          int                             nat_total,
-                          const gmx_output_env_t         *oenv,
-                          const gmx::ContinuationOptions &continuationOptions)
+static FILE *open_imd_out(const char                *fn,
+                          t_gmx_IMD_setup           *IMDsetup,
+                          int                        nat_total,
+                          const gmx_output_env_t    *oenv,
+                          const ContinuationOptions &continuationOptions)
 {
     FILE       *fp;
 
@@ -1283,17 +1283,17 @@ static void imd_check_integrator_parallel(t_inputrec *ir, const t_commrec *cr)
     }
 }
 
-void init_IMD(t_inputrec              *ir,
-              const t_commrec         *cr,
-              const gmx_multisim_t    *ms,
-              const gmx_mtop_t        *top_global,
-              FILE                    *fplog,
-              int                      defnstimd,
-              const rvec               x[],
-              int                      nfile,
-              const t_filenm           fnm[],
-              const gmx_output_env_t  *oenv,
-              const gmx::MdrunOptions &mdrunOptions)
+void init_IMD(t_inputrec             *ir,
+              const t_commrec        *cr,
+              const gmx_multisim_t   *ms,
+              const gmx_mtop_t       *top_global,
+              FILE                   *fplog,
+              int                     defnstimd,
+              const rvec              x[],
+              int                     nfile,
+              const t_filenm          fnm[],
+              const gmx_output_env_t *oenv,
+              const MdrunOptions     &mdrunOptions)
 {
     int              i;
     int              nat_total;
@@ -1311,7 +1311,7 @@ void init_IMD(t_inputrec              *ir,
     // user asked for should be handled with a fatal error, not just a
     // warning.
 
-    const auto &options = mdrunOptions.imdOptions;
+    const ImdOptions &options = mdrunOptions.imdOptions;
 
     /* It seems we have a .tpr file that defines an IMD group and thus allows IMD sessions.
      * Check whether we can actually provide the IMD functionality for this setting: */
index e1543453713f4a4b3c27117fa88ba0f825ee1a72..70fc97f1a299eae827147c997cdf1f8d453f5d29 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -79,6 +79,7 @@ struct gmx_mtop_t;
 struct gmx_multisim_t;
 struct gmx_output_env_t;
 struct gmx_wallcycle;
+struct MdrunOptions;
 struct t_commrec;
 struct t_filenm;
 struct t_gmx_IMD;
@@ -86,11 +87,6 @@ struct t_IMD;
 struct t_inputrec;
 class t_state;
 
-namespace gmx
-{
-struct MdrunOptions;
-}
-
 static const char IMDstr[] = "IMD:";  /**< Tag output from the IMD module with this string. */
 
 /*! \brief Writes out the group of atoms selected for interactive manipulation.
@@ -148,7 +144,7 @@ void init_IMD(t_inputrec *ir, const t_commrec *cr,
               const gmx_mtop_t *top_global,
               FILE *fplog, int defnstimd, const rvec x[],
               int nfile, const t_filenm fnm[], const gmx_output_env_t *oenv,
-              const gmx::MdrunOptions &mdrunOptions);
+              const MdrunOptions &mdrunOptions);
 
 
 /*! \brief IMD required in this time step?
index 4feac1f229c9578e9f92e89ad6ca98e165cbc1f5..51fd02767e9d8253d18aacde08fa2da2a4bb3cbf 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/tgroup.h"
 #include "gromacs/mdtypes/awh_params.h"
 #include "gromacs/mdtypes/commrec.h"
index e4273078ba9fb85a04025084c8b8aaec5f65298e..d89d636d51d6bd456756768d7e8cccb998f17308 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/smalloc.h"
 
-struct gmx_mtop_t;
-struct t_commrec;
-struct t_inputrec;
-class t_state;
-
 //! Convenience wrapper for gmx_bcast of a single value.
 template <typename T>
 void block_bc(const t_commrec *cr, T &data)
@@ -102,14 +97,4 @@ void nblock_abc(const t_commrec *cr, int numElements, std::vector<T> *v)
     gmx_bcast(numElements*sizeof(T), v->data(), cr);
 }
 
-//! \brief Broadcasts the, non-dynamic, state from the master to all ranks in cr->mpi_comm_mygroup
-//
-// This is intended to be used with MPI parallelization without
-// domain decompostion (currently with NM and TPI).
-void broadcastStateWithoutDynamics(const t_commrec *cr, t_state *state);
-
-//! \brief Broadcast inputrec and mtop and allocate node-specific settings
-void init_parallel(t_commrec *cr, t_inputrec *inputrec,
-                   gmx_mtop_t *mtop);
-
 #endif
index bfd98a5c578fb84ef310a9e8928e9a8047751bbe..c9f9cfe5acb3d6a270f72ff8edb1945f99c97183 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -58,6 +58,7 @@
 #include <memory>
 
 #include "gromacs/compat/pointers.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/simulationsignal.h"
 
 struct gmx_walltime_accounting;
index a888364b74c1cacb82071ca0923b72f65635c278..e75f429e782970b325c02bd160075f5c89dcc2a7 100644 (file)
@@ -62,6 +62,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/lincs.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/settle.h"
 #include "gromacs/mdlib/shake.h"
 #include "gromacs/mdtypes/commrec.h"
@@ -71,7 +72,6 @@
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
-#include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/mtop_lookup.h"
index f90aabe1630fa82f45f46e729ae8187605d39da2..b2f55c715855f168ebe02618f92ba24044ebc497 100644 (file)
@@ -57,6 +57,7 @@
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/ebin.h"
 #include "gromacs/mdlib/mdebin_bar.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdtypes/energyhistory.h"
 #include "gromacs/mdtypes/fcdata.h"
 #include "gromacs/mdtypes/group.h"
index 3ca8b6de2925eee675f4824decc4a34bd1084543..ef7b727ce0916fe057b02f0cb02bc1912d4de6bc 100644 (file)
@@ -58,6 +58,7 @@
 #include "gromacs/math/vecdump.h"
 #include "gromacs/mdlib/force_flags.h"
 #include "gromacs/mdlib/forcerec_threading.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdlib/rf_util.h"
index 185d968f57da4926708bcb1716ec6f8a2ad1e6b4..ac37a7b54ecd837eb2295caf351e3712fb7914e9 100644 (file)
@@ -63,6 +63,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
index a7154d9afddf3e8d516781504d86696433160a22..b843bf32c186b41eb9c1d7aa438f22e056157a1e 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/dispersioncorrection.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/simulationsignal.h"
 #include "gromacs/mdlib/tgroup.h"
index e218d383c0162f526e8c60f36940c99e385e6c12..eb6c45d615ceeef5f7d98b885a33a65458b6a4fe 100644 (file)
@@ -48,7 +48,6 @@ struct gmx_signalling_t;
 struct t_extmass;
 struct t_forcerec;
 struct t_grpopts;
-struct t_inputrec;
 struct t_lambda;
 struct t_nrnb;
 class t_state;
@@ -108,9 +107,6 @@ bool multisim_int_all_are_equal(const gmx_multisim_t *ms,
 void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr,
                          gmx_bool *bLastStep);
 
-//! \brief Allocate and initialize node-local state entries
-void set_state_entries(t_state *state, const t_inputrec *ir);
-
 /* Set the lambda values in the global state from a frame read with rerun */
 void setCurrentLambdasRerun(int64_t step, const t_lambda *fepvals,
                             const t_trxframe *rerun_fr, const double *lam0,
index 93967223fae2d9557b411723811669af0ce9958d..225dbc1ed818be2db2d6551471d6602a38763e1b 100644 (file)
 #include "gromacs/fileio/xtcio.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/trajectory_writing.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/imdoutputprovider.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/topology.h"
@@ -83,7 +83,7 @@ struct gmx_mdoutf {
 
 
 gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
-                         const gmx::MdrunOptions &mdrunOptions,
+                         const MdrunOptions &mdrunOptions,
                          const t_commrec *cr,
                          gmx::IMDOutputProvider *outputProvider,
                          const t_inputrec *ir, gmx_mtop_t *top_global,
index f8c7a7754dddf10794965886bba4b13dd106b47d..115fa0bb33a6c47b6f601a6103776912bb6e36ff 100644 (file)
@@ -46,6 +46,7 @@
 class energyhistory_t;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
+struct MdrunOptions;
 struct ObservablesHistory;
 struct t_commrec;
 struct t_filenm;
@@ -54,7 +55,6 @@ struct t_inputrec;
 namespace gmx
 {
 class IMDOutputProvider;
-struct MdrunOptions;
 }
 
 typedef struct gmx_mdoutf *gmx_mdoutf_t;
@@ -64,16 +64,16 @@ typedef struct gmx_mdoutf *gmx_mdoutf_t;
  * Returns a pointer to a data structure with all output file pointers
  * and names required by mdrun.
  */
-gmx_mdoutf_t init_mdoutf(FILE                    *fplog,
-                         int                      nfile,
-                         const t_filenm           fnm[],
-                         const gmx::MdrunOptions &mdrunOptions,
-                         const t_commrec         *cr,
-                         gmx::IMDOutputProvider  *outputProvider,
-                         const t_inputrec        *ir,
-                         gmx_mtop_t              *mtop,
-                         const gmx_output_env_t  *oenv,
-                         gmx_wallcycle_t          wcycle);
+gmx_mdoutf_t init_mdoutf(FILE                   *fplog,
+                         int                     nfile,
+                         const t_filenm          fnm[],
+                         const MdrunOptions     &mdrunOptions,
+                         const t_commrec        *cr,
+                         gmx::IMDOutputProvider *outputProvider,
+                         const t_inputrec       *ir,
+                         gmx_mtop_t             *mtop,
+                         const gmx_output_env_t *oenv,
+                         gmx_wallcycle_t         wcycle);
 
 /*! \brief Getter for file pointer */
 ener_file_t mdoutf_get_fp_ene(gmx_mdoutf_t of);
similarity index 82%
rename from src/gromacs/mdtypes/mdrunoptions.h
rename to src/gromacs/mdlib/mdrun.h
index 8e7f626310950117209bafa8cdfbbdb7760091fe..b4f85cfeac94ac3b2125b470facbad48fac53512 100644 (file)
@@ -1,7 +1,9 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+
 /*! \libinternal \file
  *
- * \brief This file declares helper functionality for legacy option handling for mdrun
- *
- * It is likely that much of this content will move closer to the
- * functionality that supports the respective features. For example,
- * modules that change behaviour according to whether it is a rerun
- * could register themselves with the rerun module and get notified at
- * setup time to set their own boolean, rather than rely on a central
- * glob of mdrun options being passed around.
+ * \brief This file declares types and functions for initializing an MD run
  *
- * \ingroup module_mdtypes
+ * \author Berk Hess <hess@kth.se>
  * \inlibraryapi
  */
-#ifndef GMX_MDTYPES_MDRUNOPTIONS_H
-#define GMX_MDTYPES_MDRUNOPTIONS_H
 
-#include "gromacs/utility/basedefinitions.h"
+#ifndef GMX_MDLIB_MDRUN_H
+#define GMX_MDLIB_MDRUN_H
+
+#include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/real.h"
 
-namespace gmx
-{
+struct gmx_mtop_t;
+struct t_commrec;
+struct t_inputrec;
+class t_state;
 
 //! \internal \brief Options and settings for continuing from checkpoint
 struct ContinuationOptions
@@ -134,6 +133,17 @@ struct MdrunOptions
     int                 verboseStepPrintInterval = 100;
 };
 
-} // end namespace gmx
+//! \brief Allocate and initialize node-local state entries
+void set_state_entries(t_state *state, const t_inputrec *ir);
+
+//! \brief Broadcast inputrec and mtop and allocate node-specific settings
+void init_parallel(t_commrec *cr, t_inputrec *inputrec,
+                   gmx_mtop_t *mtop);
+
+//! \brief Broadcasts the, non-dynamic, state from the master to all ranks in cr->mpi_comm_mygroup
+//
+// This is intended to be used with MPI parallelization without
+// domain decompostion (currently with NM and TPI).
+void broadcastStateWithoutDynamics(const t_commrec *cr, t_state *state);
 
 #endif
index deee367081ceab38b59317da934239717592589f..ff3aa7a123b3862d6fb7c88012bf4b5aa34f3369 100644 (file)
@@ -58,6 +58,7 @@
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/force_flags.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/mdtypes/commrec.h"
index 0457c20f0c89f7105765d9c3aafb329b7d6254ef..055b5a8d91ff3fe0e8789edf8e8087c0767197ae 100644 (file)
@@ -78,6 +78,7 @@
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/forcerec.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/ppforceworkload.h"
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdlib/update.h"
index fdaa251c482a15baad56664f13e2d5f4559ef45d..b45431c9f04c78fa1e0f3f741a01ab0f1fdad6cc 100644 (file)
@@ -48,6 +48,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/md_support.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/rbin.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/tgroup.h"
index 6e075020b358114464bb04d0712b2a9dc8b8ac2b..75c9806d5e1e305ab6614ab54d85904263cc1548 100644 (file)
@@ -41,6 +41,7 @@
 #include "gromacs/fileio/tngio.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/mdoutf.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdtypes/commrec.h"
index 2cce59af024da1ab362dbbb45bf667dc30a739d4..c1f2c983a595be181b14069f3573bc68be2b4c85 100644 (file)
@@ -59,6 +59,7 @@
 #include "gromacs/mdlib/boxdeformation.h"
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/tgroup.h"
 #include "gromacs/mdtypes/commrec.h"
index 69602710e85733e56145047f4556a07e2bf8de53..d65b417c48be3c866f962a3fbc67fe755184f974 100644 (file)
@@ -53,8 +53,8 @@
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/hardware/hw_info.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdrun/logging.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 
 #include "replicaexchange.h"
 
index a1d389b70d6213428b44e14c81f9b65758556c21..d853a25d75bc5cc5ae310d64c41c9b5aa3aff97a 100644 (file)
@@ -84,6 +84,7 @@
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdoutf.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdtypes/interaction_const.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/mdatom.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/pullhistory.h"
 #include "gromacs/mdtypes/state.h"
index c12962ab130f4482fd55c433ced290e80ef3d4fd..eaefb86f225ff49dc5595bbd46fa26e63e1772d4 100644 (file)
@@ -83,6 +83,7 @@
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdoutf.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdtypes/interaction_const.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/mdatom.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/mimic/MimicCommunicator.h"
index 81e5971781a5e21da04d562672e057d8d3433eab..2f013cc59b072cac7798c910ab3c77082640a1b5 100644 (file)
@@ -78,6 +78,7 @@
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/shellfc.h"
@@ -90,7 +91,6 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
@@ -354,7 +354,7 @@ static void init_em(FILE *fplog,
                     const t_commrec *cr,
                     const gmx_multisim_t *ms,
                     t_inputrec *ir,
-                    const gmx::MdrunOptions &mdrunOptions,
+                    const MdrunOptions &mdrunOptions,
                     t_state *state_global, gmx_mtop_t *top_global,
                     em_state_t *ems, gmx_localtop_t *top,
                     t_nrnb *nrnb,
index fa2ad1253866cb600c0ddcf7bfb3cc4ce53dfeed..4340831023ec53e7972b4cced7f224b5fd22a94e 100644 (file)
@@ -84,6 +84,7 @@
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdoutf.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdtypes/interaction_const.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/mdatom.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/mimic/MimicUtils.h"
index d5f6614e6332e346bfce5679eef846a1c6451bd2..df8da62702851906590509c380fb0a288c0e24ee 100644 (file)
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/boxdeformation.h"
-#include "gromacs/mdlib/broadcaststructs.h"
 #include "gromacs/mdlib/calc_verletbuf.h"
 #include "gromacs/mdlib/forcerec.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/makeconstraints.h"
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/ppforceworkload.h"
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/stophandler.h"
+#include "gromacs/mdrun/legacymdrunoptions.h"
 #include "gromacs/mdrun/logging.h"
 #include "gromacs/mdrun/multisim.h"
 #include "gromacs/mdrun/simulationcontext.h"
 #include "gromacs/mdtypes/fcdata.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/nbnxm/gpu_data_mgmt.h"
index deb2fb1ca0e3aba811c96fa8e1fc17618328a3b9..465fdd27f159bed229f161b9222d320f8e300eb5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,7 +52,7 @@
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/hardware/hw_info.h"
 #include "gromacs/math/vec.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
index 227ce96fd7529f925874c7074f6bf5ba48d550c7..e6b77668abb9fcd4a72b9b2f238ae947fe624cbe 100644 (file)
@@ -71,6 +71,7 @@
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/force_flags.h"
 #include "gromacs/mdlib/mdatoms.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/tgroup.h"
@@ -82,7 +83,6 @@
 #include "gromacs/mdtypes/group.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/threefry.h"
index 55a140c4f6844058df566ae10aac05fb0af4f4e9..4f5c58ec9d8f516e5db0323f1e054ea0120009ed 100644 (file)
@@ -46,7 +46,6 @@
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/math/vec.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/pullhistory.h"
 #include "gromacs/pulling/pull.h"
@@ -386,7 +385,7 @@ static void set_legend_for_coord_components(const pull_coord_work_t *pcrd, int c
 static FILE *open_pull_out(const char *fn, struct pull_t *pull,
                            const gmx_output_env_t *oenv,
                            gmx_bool bCoord,
-                           const gmx::ContinuationOptions &continuationOptions)
+                           const ContinuationOptions &continuationOptions)
 {
     FILE  *fp;
     int    nsets, m;
@@ -499,11 +498,11 @@ static FILE *open_pull_out(const char *fn, struct pull_t *pull,
     return fp;
 }
 
-void init_pull_output_files(pull_t                         *pull,
-                            int                             nfile,
-                            const t_filenm                  fnm[],
-                            const gmx_output_env_t         *oenv,
-                            const gmx::ContinuationOptions &continuationOptions)
+void init_pull_output_files(pull_t                    *pull,
+                            int                        nfile,
+                            const t_filenm             fnm[],
+                            const gmx_output_env_t    *oenv,
+                            const ContinuationOptions &continuationOptions)
 {
     /* Check for px and pf filename collision, if we are writing
        both files */
index fccbb10eb27b3df8f08e7210c5006d9f01fb29f6..3da5993b9fc77524a09608a46de89c7d5ab86b2b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include "gromacs/utility/basedefinitions.h"
 
 struct pull_t;
+struct ContinuationOptions;
 struct gmx_output_env_t;
 struct ObservablesHistory;
 struct t_filenm;
 
-namespace gmx
-{
-struct ContinuationOptions;
-}
-
 /*! \brief Set up and open the pull output files, when requested.
  *
  * NOTE: This should only be called on the master rank and only when
@@ -71,11 +67,11 @@ struct ContinuationOptions;
  * \param oenv        Output options.
  * \param continuationOptions  Options for continuing from checkpoint file
  */
-void init_pull_output_files(pull_t                         *pull,
-                            int                             nfile,
-                            const t_filenm                  fnm[],
-                            const gmx_output_env_t         *oenv,
-                            const gmx::ContinuationOptions &continuationOptions);
+void init_pull_output_files(pull_t                    *pull,
+                            int                        nfile,
+                            const t_filenm             fnm[],
+                            const gmx_output_env_t    *oenv,
+                            const ContinuationOptions &continuationOptions);
 
 /*! \brief Print the pull output (x and/or f)
  *
index 54ba106a6296e8d250900af33a58dfcadd4daaa3..89eac4578ed5bc5e282179ad5da144ef9b29b100 100644 (file)
@@ -59,6 +59,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/forceoutput.h"
 #include "gromacs/mdtypes/inputrec.h"
index 887ca01838c202981b01922070caf615057ea4ec..9ae87394d065c828f7f4e28f3fd651926b1828e7 100644 (file)
@@ -53,6 +53,7 @@
 #include <cstdio>
 
 #include "gromacs/math/vectypes.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdtypes/pull_params.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/basedefinitions.h"
index 81a41009a0661b67ca5ffe1062f4515f2c162ddd..a2c3210fb55cd36338379dce9faa77bdaa1e82a4 100644 (file)
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/cyclecounter.h"
@@ -3594,7 +3594,7 @@ static int calc_mpi_bufsize(const gmx_enfrot *er)
 std::unique_ptr<gmx::EnforcedRotation>
 init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[],
          const t_commrec *cr, gmx::LocalAtomSetManager * atomSets, const t_state *globalState, gmx_mtop_t *mtop, const gmx_output_env_t *oenv,
-         const gmx::MdrunOptions &mdrunOptions)
+         const MdrunOptions &mdrunOptions)
 {
     int             nat_max = 0;       /* Size of biggest rotation group */
     rvec           *x_pbc   = nullptr; /* Space for the pbc-correct atom positions */
index 2b2c4dc04e0967589422914213c76060e2005622..fe313c39068b3cd95625618eeeb49a42a37a8c25 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -60,6 +60,7 @@ struct gmx_domdec_t;
 struct gmx_enfrot;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
+struct MdrunOptions;
 struct t_commrec;
 struct t_filenm;
 struct t_inputrec;
@@ -69,8 +70,6 @@ class t_state;
 namespace gmx
 {
 class LocalAtomSetManager;
-struct MdrunOptions;
-
 class EnforcedRotation
 {
     public:
@@ -112,7 +111,7 @@ class EnforcedRotation
 std::unique_ptr<gmx::EnforcedRotation>
 init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[],
          const t_commrec *cr, gmx::LocalAtomSetManager * atomSets, const t_state *globalState, gmx_mtop_t *mtop, const gmx_output_env_t *oenv,
-         const gmx::MdrunOptions &mdrunOptions);
+         const MdrunOptions &mdrunOptions);
 
 /*! \brief Calculates the enforced rotation potential(s).
  *
index 7673365bc8fa284335d4147052ab6d05445e2305..212ddd300ad8fab0a55c5c568e72cfa9d0a2e7ed 100644 (file)
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/mdrunoptions.h"
 #include "gromacs/mdtypes/observableshistory.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/mdtypes/swaphistory.h"
@@ -1462,7 +1462,7 @@ void init_swapcoords(
         t_commrec                *cr,
         gmx::LocalAtomSetManager *atomSets,
         const gmx_output_env_t   *oenv,
-        const gmx::MdrunOptions  &mdrunOptions)
+        const MdrunOptions       &mdrunOptions)
 {
     t_swapcoords          *sc;
     t_swap                *s;
index df3a9c614552c0baa8b2dc3210e2a1b707eece14..736b5f193f167ce38c7a930b45623bb9c0190b40 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -61,6 +61,7 @@ struct gmx_domdec_t;
 struct gmx_mtop_t;
 struct gmx_output_env_t;
 struct gmx_wallcycle;
+struct MdrunOptions;
 struct swaphistory_t;
 struct t_commrec;
 struct t_inputrec;
@@ -71,7 +72,6 @@ struct ObservablesHistory;
 namespace gmx
 {
 class LocalAtomSetManager;
-struct MdrunOptions;
 }
 
 /*! \brief Initialize ion / water position swapping ("Computational Electrophysiology").
@@ -101,7 +101,7 @@ void init_swapcoords(
         t_commrec                *cr,
         gmx::LocalAtomSetManager *atomSets,
         const gmx_output_env_t   *oenv,
-        const gmx::MdrunOptions  &mdrunOptions);
+        const MdrunOptions       &mdrunOptions);
 
 
 /*! \brief Finalizes ion / water position swapping.
index 32be1b5ef95d3d8bf438eadde377b20dd457cae3..5f06e0ad3cf2e447adb7b3a37d6b6064d26368c1 100644 (file)
@@ -59,6 +59,7 @@
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/gmxlib/network.h"
+#include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdrun/legacymdrunoptions.h"
 #include "gromacs/mdrun/logging.h"
 #include "gromacs/mdrun/runner.h"