Fix some mdrun header dependencies
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 7 Jan 2016 17:21:59 +0000 (18:21 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 7 Jan 2016 17:36:11 +0000 (18:36 +0100)
md_support.h, sim_util.h and update.h should not depend on each other
since any symbols they declare can be forward-declared by the others.

Updated some names for types - in particular, gmx_update_t is now a
struct, rather than an opaque pointer to a struct.

Also removed two orphaned function declarations used by the
now-removed SD2 integrator.

Change-Id: I84c0f8d7b90b5f68bbf940e5854834bb9d000c9f

src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/md_support.h
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/sim_util.h
src/gromacs/mdlib/trajectory_writing.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/update.h
src/programs/mdrun/md.cpp
src/programs/mdrun/runner.cpp

index e36aa9d3494242e34397864fdb9ad72cbc192b55..cc5a1505fe29a2186d4557e1ab19ff0387c9c559 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -75,6 +75,7 @@
 #include "gromacs/mdlib/nbnxn_util.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/qmmm.h"
+#include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/fcdata.h"
 #include "gromacs/mdtypes/group.h"
index 3e81e90e6a1b7eb7dd74f0ab67431bee251ac817..4d6e3217acc96d88262b2f3397d4cf2c264ad954 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -50,7 +50,9 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/mdrun_signalling.h"
+#include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/tgroup.h"
+#include "gromacs/mdlib/update.h"
 #include "gromacs/mdlib/vcm.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/df_history.h"
@@ -272,7 +274,7 @@ real compute_conserved_from_auxiliary(t_inputrec *ir, t_state *state, t_extmass
 
 /* TODO Specialize this routine into init-time and loop-time versions?
    e.g. bReadEkin is only true when restoring from checkpoint */
-void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr, t_inputrec *ir,
+void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_inputrec *ir,
                      t_forcerec *fr, gmx_ekindata_t *ekind,
                      t_state *state, t_mdatoms *mdatoms,
                      t_nrnb *nrnb, t_vcm *vcm, gmx_wallcycle_t wcycle,
index cc17e79f465e4904396d3beb7f47f0791d551475..752a25a4d1e68cce71ee89947c17dd5e7dc85628 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
 #ifndef GMX_MDLIB_MD_SUPPORT_H
 #define GMX_MDLIB_MD_SUPPORT_H
 
-#include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/vcm.h"
 #include "gromacs/timing/wallcycle.h"
 
 struct gmx_constr;
+struct gmx_ekindata_t;
+struct gmx_enerdata_t;
+struct gmx_global_stat;
 struct gmx_multisim_t;
 struct gmx_signalling_t;
+struct t_extmass;
+struct t_forcerec;
+struct t_grpopts;
+struct t_lambda;
+struct t_nrnb;
+struct t_state;
 struct t_trxframe;
 
 /* Define a number of flags to better control the information
@@ -111,7 +119,7 @@ void copy_coupling_state(t_state *statea, t_state *stateb,
                          gmx_ekindata_t *ekinda, gmx_ekindata_t *ekindb, t_grpopts* opts);
 /* Copy stuff from state A to state B */
 
-void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr, t_inputrec *ir,
+void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_inputrec *ir,
                      t_forcerec *fr, gmx_ekindata_t *ekind,
                      t_state *state, t_mdatoms *mdatoms,
                      t_nrnb *nrnb, t_vcm *vcm, gmx_wallcycle_t wcycle,
index 73cdb9cfdea7bd84d0d3e8c18f424b857b8d9d03..17d1c2c69a1a7279b453cea836e7d23380e253eb 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -2682,7 +2682,7 @@ void init_md(FILE *fplog,
              double *t, double *t0,
              real *lambda, int *fep_state, double *lam0,
              t_nrnb *nrnb, gmx_mtop_t *mtop,
-             gmx_update_t *upd,
+             gmx_update_t **upd,
              int nfile, const t_filenm fnm[],
              gmx_mdoutf_t *outf, t_mdebin **mdebin,
              tensor force_vir, tensor shake_vir, rvec mu_tot,
index 241642db5cfa2d65721acd78b17350cbf08a773d..930bf2c692f16935a3266c472d8c4171d67283c2 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -40,7 +40,6 @@
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/mdlib/mdebin.h"
 #include "gromacs/mdlib/mdoutf.h"
-#include "gromacs/mdlib/update.h"
 #include "gromacs/mdlib/vcm.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
@@ -48,6 +47,7 @@
 struct gmx_constr;
 struct gmx_localtop_t;
 struct gmx_output_env_t;
+struct gmx_update_t;
 struct nonbonded_verlet_t;
 struct t_graph;
 struct t_mdatoms;
@@ -142,7 +142,7 @@ void init_md(FILE *fplog,
              double *t, double *t0,
              real *lambda, int *fep_state, double *lam0,
              t_nrnb *nrnb, gmx_mtop_t *mtop,
-             gmx_update_t *upd,
+             gmx_update_t **upd,
              int nfile, const t_filenm fnm[],
              gmx_mdoutf_t *outf, t_mdebin **mdebin,
              tensor force_vir, tensor shake_vir,
index 766f63914e4db2aa6e92e8ac92cce80ae6a43182..d210d731c5f4e02c7bb2bc88bc9bbb8e6b5573a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -42,6 +42,7 @@
 #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"
 #include "gromacs/mdtypes/energyhistory.h"
 #include "gromacs/mdtypes/inputrec.h"
index e452817d3f29ecd8803e35783aeefdf0799e9fae..20ecbfa30883ab78cfd6a9d231193287032982ed 100644 (file)
@@ -99,7 +99,7 @@ typedef struct {
     real           *boltzfac;
 } gmx_stochd_t;
 
-typedef struct gmx_update
+struct gmx_update_t
 {
     gmx_stochd_t *sd;
     /* xprime for constraint algorithms */
@@ -109,7 +109,7 @@ typedef struct gmx_update
     /* Variables for the deform algorithm */
     gmx_int64_t     deformref_step;
     matrix          deformref_box;
-} t_gmx_update;
+};
 
 
 static void do_update_md(int start, int nrend, double dt,
@@ -521,9 +521,9 @@ static gmx_stochd_t *init_stochd(t_inputrec *ir)
     return sd;
 }
 
-gmx_update_t init_update(t_inputrec *ir)
+gmx_update_t *init_update(t_inputrec *ir)
 {
-    t_gmx_update *upd;
+    gmx_update_t *upd;
 
     snew(upd, 1);
 
@@ -1072,13 +1072,13 @@ void restore_ekinstate_from_state(t_commrec *cr,
     }
 }
 
-void set_deform_reference_box(gmx_update_t upd, gmx_int64_t step, matrix box)
+void set_deform_reference_box(gmx_update_t *upd, gmx_int64_t step, matrix box)
 {
     upd->deformref_step = step;
     copy_mat(box, upd->deformref_box);
 }
 
-static void deform(gmx_update_t upd,
+static void deform(gmx_update_t *upd,
                    int start, int homenr, rvec x[], matrix box,
                    const t_inputrec *ir, gmx_int64_t step)
 {
@@ -1256,7 +1256,7 @@ void update_pcouple(FILE             *fplog,
     }
 }
 
-static rvec *get_xprime(const t_state *state, gmx_update_t upd)
+static rvec *get_xprime(const t_state *state, gmx_update_t *upd)
 {
     if (state->nalloc > upd->xp_nalloc)
     {
@@ -1284,7 +1284,7 @@ void update_constraints(FILE             *fplog,
                         t_commrec        *cr,
                         t_nrnb           *nrnb,
                         gmx_wallcycle_t   wcycle,
-                        gmx_update_t      upd,
+                        gmx_update_t     *upd,
                         gmx_constr_t      constr,
                         gmx_bool          bFirstHalf,
                         gmx_bool          bCalcVir)
@@ -1477,7 +1477,7 @@ void update_box(FILE             *fplog,
                 rvec              force[],   /* forces on home particles */
                 matrix            pcoupl_mu,
                 t_nrnb           *nrnb,
-                gmx_update_t      upd)
+                gmx_update_t     *upd)
 {
     double               dt;
     int                  start, homenr, i, n, m;
@@ -1573,7 +1573,7 @@ void update_coords(FILE             *fplog,
                    t_fcdata         *fcd,
                    gmx_ekindata_t   *ekind,
                    matrix            M,
-                   gmx_update_t      upd,
+                   gmx_update_t     *upd,
                    int               UpdatePart,
                    t_commrec        *cr, /* these shouldn't be here -- need to think about it */
                    gmx_constr_t      constr)
@@ -1775,7 +1775,7 @@ void correct_ekin(FILE *log, int start, int end, rvec v[], rvec vcm, real mass[]
 }
 
 extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, const t_commrec *cr,
-                                            t_mdatoms *md, t_state *state, gmx_update_t upd, gmx_constr_t constr)
+                                            t_mdatoms *md, t_state *state, gmx_update_t *upd, gmx_constr_t constr)
 {
 
     real rate = (ir->delta_t)/ir->opts.tau_t[0];
index 65e932db80a06e0521b275af0653151a98792bda..1f3a427646a2191969db7ff92d597e4f7a9e4c56 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -56,22 +56,16 @@ struct t_mdatoms;
 struct t_nrnb;
 struct t_state;
 
-/* Abstract type for stochastic dynamics */
-typedef struct gmx_update *gmx_update_t;
+/* Abstract type for update */
+struct gmx_update_t;
 
 /* Initialize the stochastic dynamics struct */
-gmx_update_t init_update(t_inputrec *ir);
-
-/* Store the random state from sd in state */
-void get_stochd_state(gmx_update_t sd, t_state *state);
-
-/* Set the random in sd from state */
-void set_stochd_state(gmx_update_t sd, t_state *state);
+gmx_update_t *init_update(t_inputrec *ir);
 
 /* Store the box at step step
  * as a reference state for simulations with box deformation.
  */
-void set_deform_reference_box(gmx_update_t upd,
+void set_deform_reference_box(gmx_update_t *upd,
                               gmx_int64_t step, matrix box);
 
 void update_tcouple(gmx_int64_t       step,
@@ -99,14 +93,14 @@ void update_coords(FILE              *fplog,
                    t_fcdata          *fcd,
                    gmx_ekindata_t    *ekind,
                    matrix             M,
-                   gmx_update_t       upd,
+                   gmx_update_t      *upd,
                    int                bUpdatePart,
                    t_commrec         *cr, /* these shouldn't be here -- need to think about it */
                    gmx_constr        *constr);
 
 /* Return TRUE if OK, FALSE in case of Shake Error */
 
-extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, const t_commrec *cr, t_mdatoms *md, t_state *state, gmx_update_t upd, gmx_constr *constr);
+extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, const t_commrec *cr, t_mdatoms *md, t_state *state, gmx_update_t *upd, gmx_constr *constr);
 
 void update_constraints(FILE              *fplog,
                         gmx_int64_t        step,
@@ -122,7 +116,7 @@ void update_constraints(FILE              *fplog,
                         t_commrec         *cr,
                         t_nrnb            *nrnb,
                         gmx_wallcycle_t    wcycle,
-                        gmx_update_t       upd,
+                        gmx_update_t      *upd,
                         gmx_constr        *constr,
                         gmx_bool           bFirstHalf,
                         gmx_bool           bCalcVir);
@@ -137,7 +131,7 @@ void update_box(FILE             *fplog,
                 rvec              force[], /* forces on home particles */
                 matrix            pcoupl_mu,
                 t_nrnb           *nrnb,
-                gmx_update_t      upd);
+                gmx_update_t     *upd);
 /* Return TRUE if OK, FALSE in case of Shake Error */
 
 void calc_ke_part(t_state *state, t_grpopts *opts, t_mdatoms *md,
index cc832cf2b31dd01782984c15a42cb08c5034599c..8c29837781fb7686b3ef3f85a919f2b2117c050b 100644 (file)
@@ -247,7 +247,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     gmx_enerdata_t   *enerd;
     rvec             *f = NULL;
     gmx_global_stat_t gstat;
-    gmx_update_t      upd   = NULL;
+    gmx_update_t     *upd   = NULL;
     t_graph          *graph = NULL;
     gmx_signalling_t  gs;
     gmx_groups_t     *groups;
index 7f4d2b7721015b78a802581d9f382e7d4f10a64b..4b8dc8fa2df565baad444733ebfdf963aad58249 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) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016, 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.
@@ -86,6 +86,7 @@
 #include "gromacs/mdlib/nbnxn_search.h"
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdlib/sighandler.h"
+#include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/tpi.h"
 #include "gromacs/mdrunutility/threadaffinity.h"
 #include "gromacs/mdtypes/inputrec.h"