Add more const to uses of t_commrec and t_inputrec
authorMark Abraham <mark.j.abraham@gmail.com>
Mon, 26 Feb 2018 16:47:02 +0000 (17:47 +0100)
committerAleksei Iupinov <a.yupinov@gmail.com>
Tue, 13 Mar 2018 16:35:25 +0000 (17:35 +0100)
Also removed some pointless struct keywords.

Refs #2423

Change-Id: Iacc008fb11a31646e798364e253de322c16ccaee

57 files changed:
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec.h
src/gromacs/domdec/domdec_box.cpp
src/gromacs/essentialdynamics/edsam.cpp
src/gromacs/essentialdynamics/edsam.h
src/gromacs/ewald/ewald.cpp
src/gromacs/ewald/ewald.h
src/gromacs/ewald/long-range-correction.cpp
src/gromacs/ewald/long-range-correction.h
src/gromacs/ewald/pme-internal.h
src/gromacs/ewald/pme-only.cpp
src/gromacs/ewald/pme-pp.cpp
src/gromacs/ewald/pme-redistribute.cpp
src/gromacs/ewald/pme-redistribute.h
src/gromacs/ewald/pme.cpp
src/gromacs/ewald/pme.h
src/gromacs/fileio/checkpoint.cpp
src/gromacs/fileio/checkpoint.h
src/gromacs/imd/imd.cpp
src/gromacs/imd/imd.h
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/constr.h
src/gromacs/mdlib/force.cpp
src/gromacs/mdlib/force.h
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/groupcoord.cpp
src/gromacs/mdlib/groupcoord.h
src/gromacs/mdlib/lincs.cpp
src/gromacs/mdlib/lincs.h
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/mdoutf.h
src/gromacs/mdlib/mdsetup.cpp
src/gromacs/mdlib/mdsetup.h
src/gromacs/mdlib/minimize.cpp
src/gromacs/mdlib/ns.cpp
src/gromacs/mdlib/ns.h
src/gromacs/mdlib/qmmm.cpp
src/gromacs/mdlib/qmmm.h
src/gromacs/mdlib/rbin.cpp
src/gromacs/mdlib/rbin.h
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/shellfc.h
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/sim_util.h
src/gromacs/mdlib/stat.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/update.h
src/gromacs/mdlib/vsite.cpp
src/gromacs/mdlib/vsite.h
src/gromacs/mdlib/wnblist.cpp
src/gromacs/pulling/pull.cpp
src/gromacs/pulling/pull.h
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/pulling/pull_rotation.h
src/gromacs/pulling/pullutil.cpp
src/gromacs/timing/wallcycle.cpp
src/gromacs/timing/wallcyclereporting.h

index b8d59749530a15928c52148787313ef2ac44f362..83873afb1e4b9513687b927c3093311b05296a2b 100644 (file)
@@ -1727,7 +1727,7 @@ static void write_dd_grid_pdb(const char *fn, gmx_int64_t step,
 }
 
 void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title,
-                  const gmx_mtop_t *mtop, t_commrec *cr,
+                  const gmx_mtop_t *mtop, const t_commrec *cr,
                   int natoms, rvec x[], matrix box)
 {
     char          fname[STRLEN], buf[22];
@@ -1877,7 +1877,7 @@ static int *dd_interleaved_pme_ranks(const gmx_domdec_t *dd)
     return pme_rank;
 }
 
-static int gmx_ddcoord2pmeindex(t_commrec *cr, int x, int y, int z)
+static int gmx_ddcoord2pmeindex(const t_commrec *cr, int x, int y, int z)
 {
     gmx_domdec_t *dd;
     ivec          coords;
@@ -1905,7 +1905,7 @@ static int gmx_ddcoord2pmeindex(t_commrec *cr, int x, int y, int z)
     return slab;
 }
 
-static int ddcoord2simnodeid(t_commrec *cr, int x, int y, int z)
+static int ddcoord2simnodeid(const t_commrec *cr, int x, int y, int z)
 {
     gmx_domdec_comm_t *comm;
     ivec               coords;
@@ -2019,7 +2019,7 @@ void get_pme_nnodes(const gmx_domdec_t *dd,
     }
 }
 
-std::vector<int> get_pme_ddranks(t_commrec *cr, int pmenodeid)
+std::vector<int> get_pme_ddranks(const t_commrec *cr, int pmenodeid)
 {
     gmx_domdec_t *dd;
     int           x, y, z;
@@ -6109,7 +6109,7 @@ static int dd_getenv(FILE *fplog, const char *env_var, int def)
     return nst;
 }
 
-static void dd_warning(t_commrec *cr, FILE *fplog, const char *warn_string)
+static void dd_warning(const t_commrec *cr, FILE *fplog, const char *warn_string)
 {
     if (MASTER(cr))
     {
@@ -6743,7 +6743,7 @@ static void set_dlb_limits(gmx_domdec_t *dd)
 }
 
 
-static void turn_on_dlb(FILE *fplog, t_commrec *cr, gmx_int64_t step)
+static void turn_on_dlb(FILE *fplog, const t_commrec *cr, gmx_int64_t step)
 {
     gmx_domdec_t      *dd;
     gmx_domdec_comm_t *comm;
@@ -6809,7 +6809,7 @@ static void turn_on_dlb(FILE *fplog, t_commrec *cr, gmx_int64_t step)
     }
 }
 
-static void turn_off_dlb(FILE *fplog, t_commrec *cr, gmx_int64_t step)
+static void turn_off_dlb(FILE *fplog, const t_commrec *cr, gmx_int64_t step)
 {
     gmx_domdec_t *dd = cr->dd;
 
@@ -6821,7 +6821,7 @@ static void turn_off_dlb(FILE *fplog, t_commrec *cr, gmx_int64_t step)
     dd->comm->ddPartioningCountFirstDlbOff = dd->ddp_count;
 }
 
-static void turn_off_dlb_forever(FILE *fplog, t_commrec *cr, gmx_int64_t step)
+static void turn_off_dlb_forever(FILE *fplog, const t_commrec *cr, gmx_int64_t step)
 {
     GMX_RELEASE_ASSERT(cr->dd->comm->dlbState == edlbsOffCanTurnOn, "Can only turn off DLB forever when it was in the can-turn-on state");
     char buf[STRLEN];
@@ -9132,7 +9132,7 @@ void reset_dd_statistics_counters(gmx_domdec_t *dd)
     comm->load_pme = 0;
 }
 
-void print_dd_statistics(t_commrec *cr, const t_inputrec *ir, FILE *fplog)
+void print_dd_statistics(const t_commrec *cr, const t_inputrec *ir, FILE *fplog)
 {
     gmx_domdec_comm_t *comm;
     int                ddnat;
@@ -9190,7 +9190,7 @@ void print_dd_statistics(t_commrec *cr, const t_inputrec *ir, FILE *fplog)
 
 void dd_partition_system(FILE                *fplog,
                          gmx_int64_t          step,
-                         t_commrec           *cr,
+                         const t_commrec     *cr,
                          gmx_bool             bMasterState,
                          int                  nstglobalcomm,
                          t_state             *state_global,
index d058c2f78a366f02b8a5cf60f0425e5cadaac046..92b49b38d6ef232b13b78d591a801d702772ddd1 100644 (file)
@@ -128,7 +128,7 @@ void get_pme_nnodes(const struct gmx_domdec_t *dd,
                     int *npmenodes_x, int *npmenodes_y);
 
 /*! \brief Returns the set of DD ranks that communicate with pme node cr->nodeid */
-std::vector<int> get_pme_ddranks(t_commrec *cr, int pmenodeid);
+std::vector<int> get_pme_ddranks(const t_commrec *cr, int pmenodeid);
 
 /*! \brief Returns the maximum shift for coordinate communication in PME, dim x */
 int dd_pme_maxshift_x(const gmx_domdec_t *dd);
@@ -312,7 +312,7 @@ void dd_atom_sum_real(struct gmx_domdec_t *dd, real v[]);
  */
 void dd_partition_system(FILE                *fplog,
                          gmx_int64_t          step,
-                         t_commrec           *cr,
+                         const t_commrec     *cr,
                          gmx_bool             bMasterState,
                          int                  nstglobalcomm,
                          t_state             *state_global,
@@ -333,7 +333,7 @@ void dd_partition_system(FILE                *fplog,
 void reset_dd_statistics_counters(struct gmx_domdec_t *dd);
 
 /*! \brief Print statistics for domain decomposition communication */
-void print_dd_statistics(struct t_commrec *cr, const t_inputrec *ir, FILE *fplog);
+void print_dd_statistics(const t_commrec *cr, const t_inputrec *ir, FILE *fplog);
 
 /* In domdec_con.c */
 
@@ -413,7 +413,7 @@ void dd_bonded_cg_distance(FILE *fplog, const gmx_mtop_t *mtop,
  */
 void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title,
                   const gmx_mtop_t *mtop,
-                  t_commrec *cr,
+                  const t_commrec *cr,
                   int natoms, rvec x[], matrix box);
 
 
@@ -441,13 +441,13 @@ real dd_choose_grid(FILE *fplog,
 /* In domdec_box.c */
 
 /*! \brief Set the box and PBC data in \p ddbox */
-void set_ddbox(gmx_domdec_t *dd, gmx_bool bMasterState, t_commrec *cr_sum,
+void set_ddbox(gmx_domdec_t *dd, gmx_bool bMasterState, const t_commrec *cr_sum,
                const t_inputrec *ir, const matrix box,
                gmx_bool bCalcUnboundedSize, const t_block *cgs, const rvec *x,
                gmx_ddbox_t *ddbox);
 
 /*! \brief Set the box and PBC data in \p ddbox */
-void set_ddbox_cr(t_commrec *cr, const ivec *dd_nc,
+void set_ddbox_cr(const t_commrec *cr, const ivec *dd_nc,
                   const t_inputrec *ir, const matrix box,
                   const t_block *cgs, const rvec *x,
                   gmx_ddbox_t *ddbox);
index c5c3018c6a7d1c18a93db15f1133abfa5e75e724..5f931538c5181d7719442ad9289d4832f0aca742 100644 (file)
@@ -60,7 +60,7 @@
 /*! \brief Calculates the average and standard deviation in 3D of n charge groups */
 static void calc_cgcm_av_stddev(const t_block *cgs, int n, const rvec *x,
                                 rvec av, rvec stddev,
-                                t_commrec *cr_sum)
+                                const t_commrec *cr_sum)
 {
     int   *cgindex;
     dvec   s1, s2;
@@ -240,7 +240,7 @@ static void set_tric_dir(const ivec *dd_nc, gmx_ddbox_t *ddbox, const matrix box
 /*! \brief This function calculates bounding box and pbc info and populates ddbox */
 static void low_set_ddbox(const t_inputrec *ir, const ivec *dd_nc, const matrix box,
                           gmx_bool bCalcUnboundedSize, int ncg, const t_block *cgs, const rvec *x,
-                          t_commrec *cr_sum,
+                          const t_commrec *cr_sum,
                           gmx_ddbox_t *ddbox)
 {
     rvec av, stddev;
@@ -281,7 +281,7 @@ static void low_set_ddbox(const t_inputrec *ir, const ivec *dd_nc, const matrix
     set_tric_dir(dd_nc, ddbox, box);
 }
 
-void set_ddbox(gmx_domdec_t *dd, gmx_bool bMasterState, t_commrec *cr_sum,
+void set_ddbox(gmx_domdec_t *dd, gmx_bool bMasterState, const t_commrec *cr_sum,
                const t_inputrec *ir, const matrix box,
                gmx_bool bCalcUnboundedSize, const t_block *cgs, const rvec *x,
                gmx_ddbox_t *ddbox)
@@ -300,7 +300,7 @@ void set_ddbox(gmx_domdec_t *dd, gmx_bool bMasterState, t_commrec *cr_sum,
     }
 }
 
-void set_ddbox_cr(t_commrec *cr, const ivec *dd_nc,
+void set_ddbox_cr(const t_commrec *cr, const ivec *dd_nc,
                   const t_inputrec *ir, const matrix box,
                   const t_block *cgs, const rvec *x,
                   gmx_ddbox_t *ddbox)
index 891491b19eb80e9f0d49b12f0271f3e0d13d46bd..9111534a1056f6a4b76f6d50219630df283ffbee 100644 (file)
@@ -390,7 +390,7 @@ static real calc_radius(t_eigvec *vec)
 
 /* Debug helper */
 #ifdef DEBUGHELPERS
-static void dump_xcoll(t_edpar *edi, struct t_do_edsam *buf, t_commrec *cr,
+static void dump_xcoll(t_edpar *edi, struct t_do_edsam *buf, const t_commrec *cr,
                        int step)
 {
     int   i;
@@ -476,7 +476,7 @@ static void dump_edi_eigenvecs(FILE *out, t_eigvec *ev,
 
 
 /* Debug helper */
-static void dump_edi(t_edpar *edpars, t_commrec *cr, int nr_edi)
+static void dump_edi(t_edpar *edpars, const t_commrec *cr, int nr_edi)
 {
     FILE  *out;
     char   fn[STRLEN];
@@ -962,14 +962,14 @@ static void update_adaption(t_edpar *edi)
 
 
 static void do_single_flood(
-        FILE           *edo,
-        rvec            x[],
-        rvec            force[],
-        t_edpar        *edi,
-        gmx_int64_t     step,
-        matrix          box,
-        t_commrec      *cr,
-        gmx_bool        bNS) /* Are we in a neighbor searching step? */
+        FILE            *edo,
+        rvec             x[],
+        rvec             force[],
+        t_edpar         *edi,
+        gmx_int64_t      step,
+        matrix           box,
+        const t_commrec *cr,
+        gmx_bool         bNS) /* Are we in a neighbor searching step? */
 {
     int                i;
     matrix             rotmat;   /* rotation matrix */
@@ -1066,7 +1066,7 @@ static void do_single_flood(
 
 
 /* Main flooding routine, called from do_force */
-extern void do_flood(t_commrec        *cr,
+extern void do_flood(const t_commrec  *cr,
                      const t_inputrec *ir,
                      rvec              x[],
                      rvec              force[],
@@ -1196,7 +1196,7 @@ static gmx_edsam_t ed_open(
         const char             *edoFileName,
         gmx_bool                bAppend,
         const gmx_output_env_t *oenv,
-        t_commrec              *cr)
+        const t_commrec        *cr)
 {
     gmx_edsam_t ed;
     int         nED;
@@ -1253,7 +1253,7 @@ static gmx_edsam_t ed_open(
 
 
 /* Broadcasts the structure data */
-static void bc_ed_positions(t_commrec *cr, struct gmx_edx *s, int stype)
+static void bc_ed_positions(const t_commrec *cr, struct gmx_edx *s, int stype)
 {
     snew_bc(cr, s->anrs, s->nr   );    /* Index numbers     */
     snew_bc(cr, s->x, s->nr   );       /* Positions         */
@@ -1292,7 +1292,7 @@ static void bc_ed_positions(t_commrec *cr, struct gmx_edx *s, int stype)
 
 
 /* Broadcasts the eigenvector data */
-static void bc_ed_vecs(t_commrec *cr, t_eigvec *ev, int length, gmx_bool bHarmonic)
+static void bc_ed_vecs(const t_commrec *cr, t_eigvec *ev, int length, gmx_bool bHarmonic)
 {
     int i;
 
@@ -1328,7 +1328,7 @@ static void bc_ed_vecs(t_commrec *cr, t_eigvec *ev, int length, gmx_bool bHarmon
 
 /* Broadcasts the ED / flooding data to other nodes
  * and allocates memory where needed */
-static void broadcast_ed_data(t_commrec *cr, gmx_edsam_t ed, int numedis)
+static void broadcast_ed_data(const t_commrec *cr, gmx_edsam_t ed, int numedis)
 {
     int      nr;
     t_edpar *edi;
@@ -2664,7 +2664,7 @@ gmx_edsam_t init_edsam(
         const char             *edoFileName,
         const gmx_mtop_t       *mtop,
         const t_inputrec       *ir,
-        t_commrec              *cr,
+        const t_commrec        *cr,
         gmx_constr             *constr,
         const t_state          *globalState,
         ObservablesHistory     *oh,
@@ -3025,7 +3025,7 @@ gmx_edsam_t init_edsam(
 
 void do_edsam(const t_inputrec *ir,
               gmx_int64_t       step,
-              t_commrec        *cr,
+              const t_commrec  *cr,
               rvec              xs[],
               rvec              v[],
               matrix            box,
index 0980caaa4f5936518745ed66efe43d33ef4da60f..7cb0ae5a294b6a4cb7c6fdcaf2791e39878c4fbd 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, 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.
@@ -78,7 +78,7 @@ class t_state;
  * \param ed                The essential dynamics data.
  */
 void do_edsam(const t_inputrec *ir, gmx_int64_t step,
-              t_commrec *cr, rvec xs[], rvec v[], matrix box, gmx_edsam_t ed);
+              const t_commrec *cr, rvec xs[], rvec v[], matrix box, gmx_edsam_t ed);
 
 
 /*! \brief Initializes the essential dynamics and flooding module.
@@ -101,7 +101,7 @@ gmx_edsam_t init_edsam(
         const char             *edoFileName,
         const gmx_mtop_t       *mtop,
         const t_inputrec       *ir,
-        t_commrec              *cr,
+        const t_commrec        *cr,
         struct gmx_constr      *constr,
         const t_state          *globalState,
         ObservablesHistory     *oh,
@@ -129,7 +129,7 @@ void dd_make_local_ed_indices(gmx_domdec_t *dd, gmx_edsam_t ed);
  * \param step              Number of the time step.
  * \param bNS               Are we in a neighbor searching step?
  */
-void do_flood(t_commrec *cr, const t_inputrec *ir, rvec x[], rvec force[], gmx_edsam_t ed,
+void do_flood(const t_commrec *cr, const t_inputrec *ir, rvec x[], rvec force[], gmx_edsam_t ed,
               matrix box, gmx_int64_t step, gmx_bool bNS);
 
 /*! \brief Clean up
index f295328ef1d77fb23594808967a1f9e1de404e2b..f33e68d5ad4c19dd6343ab31ec13077b119759c0 100644 (file)
@@ -140,7 +140,7 @@ real do_ewald(t_inputrec *ir,
               rvec x[],        rvec f[],
               real chargeA[],  real chargeB[],
               matrix box,
-              t_commrec *cr,   int natoms,
+              const t_commrec *cr, int natoms,
               matrix lrvir,    real ewaldcoeff,
               real lambda,     real *dvdlambda,
               struct gmx_ewald_tab_t *et)
@@ -315,7 +315,7 @@ real do_ewald(t_inputrec *ir,
     return energy;
 }
 
-real ewald_charge_correction(t_commrec *cr, t_forcerec *fr, real lambda,
+real ewald_charge_correction(const t_commrec *cr, t_forcerec *fr, real lambda,
                              matrix box,
                              real *dvdlambda, tensor vir)
 
index 2361e67995da37221cd44e1b1ac316993344a1f0..e54780b57fcd383abad42c1a6367702cdce52f02 100644 (file)
@@ -88,7 +88,7 @@ do_ewald(t_inputrec *ir,
          rvec x[],        rvec f[],
          real chargeA[],  real chargeB[],
          matrix box,
-         t_commrec *cr,  int natoms,
+         const t_commrec *cr, int natoms,
          matrix lrvir,   real ewaldcoeff,
          real lambda,    real *dvdlambda,
          struct gmx_ewald_tab_t *et);
@@ -98,7 +98,7 @@ do_ewald(t_inputrec *ir,
  *
  * Should only be called on one thread. */
 real
-ewald_charge_correction(t_commrec *cr, t_forcerec *fr, real lambda, matrix box,
+ewald_charge_correction(const t_commrec *cr, t_forcerec *fr, real lambda, matrix box,
                         real *dvdlambda, tensor vir);
 
 #endif
index 9e06a50e4b9bfaf6218d8219b55827a6a3d3793d..b1ba5dbd5493e42c697536d668a02c55c71cab9b 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, 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.
@@ -65,7 +65,7 @@
  * undefined when LJ-PME is not active. This works because
  * bHaveChargeOrTypePerturbed handles the control flow. */
 void ewald_LRcorrection(int numAtomsLocal,
-                        t_commrec *cr,
+                        const t_commrec *cr,
                         int numThreads, int thread,
                         t_forcerec *fr,
                         const t_inputrec *ir,
index 1a87917b89d5015d0ed07b1c6b91fe718522c70a..3508ab5f664b6ed8faaac77918956b0a12de2c52 100644 (file)
@@ -69,7 +69,7 @@ struct t_inputrec;
  * calculates correction for surface dipole terms. */
 void
 ewald_LRcorrection(int numAtomsLocal,
-                   t_commrec *cr,
+                   const t_commrec *cr,
                    int numThreads, int thread,
                    t_forcerec *fr,
                    const t_inputrec *ir,
index b8c6900d58a6a35f4cacbb03ced2cb886249d8cc..61d967ff40be71c76bf7e8de2351c6c162ba0b30 100644 (file)
@@ -100,7 +100,7 @@ static const real lb_scale_factor_symm[] = { 2.0/64, 12.0/64, 30.0/64, 20.0/64 }
  * This is only called when the PME cut-off/grid size changes.
  */
 void gmx_pme_reinit(struct gmx_pme_t **pmedata,
-                    t_commrec *        cr,
+                    const t_commrec   *cr,
                     struct gmx_pme_t * pme_src,
                     const t_inputrec * ir,
                     const ivec         grid_size,
@@ -363,9 +363,9 @@ inline bool pme_gpu_active(const gmx_pme_t *pme)
 }
 
 /*! \brief Tell our PME-only node to switch to a new grid size */
-void gmx_pme_send_switchgrid(t_commrec *cr,
-                             ivec       grid_size,
-                             real       ewaldcoeff_q,
-                             real       ewaldcoeff_lj);
+void gmx_pme_send_switchgrid(const t_commrec *cr,
+                             ivec             grid_size,
+                             real             ewaldcoeff_q,
+                             real             ewaldcoeff_lj);
 
 #endif
index 34d81fafe900dcae70cc4e5457fd7f61d107c4f9..fc25c547b15dc43dd8a80a04cff1cd34f46dd599 100644 (file)
@@ -129,7 +129,7 @@ struct gmx_pme_pp {
 };
 
 /*! \brief Initialize the PME-only side of the PME <-> PP communication */
-static std::unique_ptr<gmx_pme_pp> gmx_pme_pp_init(t_commrec *cr)
+static std::unique_ptr<gmx_pme_pp> gmx_pme_pp_init(const t_commrec *cr)
 {
     auto pme_pp = gmx::compat::make_unique<gmx_pme_pp>();
 
@@ -183,7 +183,7 @@ static void reset_pmeonly_counters(gmx_wallcycle_t wcycle,
 static gmx_pme_t *gmx_pmeonly_switch(std::vector<gmx_pme_t *> *pmedata,
                                      const ivec grid_size,
                                      real ewaldcoeff_q, real ewaldcoeff_lj,
-                                     t_commrec *cr, const t_inputrec *ir)
+                                     const t_commrec *cr, const t_inputrec *ir)
 {
     GMX_ASSERT(pmedata, "Bad PME tuning list pointer");
     for (auto &pme : *pmedata)
@@ -533,7 +533,7 @@ static void gmx_pme_send_force_vir_ener(gmx_pme_pp *pme_pp,
 }
 
 int gmx_pmeonly(struct gmx_pme_t *pme,
-                t_commrec *cr,    t_nrnb *mynrnb,
+                const t_commrec *cr, t_nrnb *mynrnb,
                 gmx_wallcycle  *wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
                 t_inputrec *ir, PmeRunMode runMode)
index 67ee1d773d4af02a39931c3e14e0c669e433b16e..6bb425e77208828e67d0ebc6ade7fc6626f4e529 100644 (file)
@@ -88,7 +88,7 @@ static void gmx_pme_send_coeffs_coords_wait(gmx_domdec_t *dd)
 }
 
 /*! \brief Send data to PME ranks */
-static void gmx_pme_send_coeffs_coords(t_commrec *cr, unsigned int flags,
+static void gmx_pme_send_coeffs_coords(const t_commrec *cr, unsigned int flags,
                                        real gmx_unused *chargeA, real gmx_unused *chargeB,
                                        real gmx_unused *c6A, real gmx_unused *c6B,
                                        real gmx_unused *sigmaA, real gmx_unused *sigmaB,
@@ -213,7 +213,7 @@ static void gmx_pme_send_coeffs_coords(t_commrec *cr, unsigned int flags,
     }
 }
 
-void gmx_pme_send_parameters(t_commrec *cr,
+void gmx_pme_send_parameters(const t_commrec *cr,
                              const interaction_const_t *ic,
                              gmx_bool bFreeEnergy_q, gmx_bool bFreeEnergy_lj,
                              real *chargeA, real *chargeB,
@@ -244,7 +244,7 @@ void gmx_pme_send_parameters(t_commrec *cr,
                                nullptr, nullptr, 0, 0, maxshift_x, maxshift_y, -1);
 }
 
-void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x,
+void gmx_pme_send_coordinates(const t_commrec *cr, matrix box, rvec *x,
                               real lambda_q, real lambda_lj,
                               gmx_bool bEnerVir,
                               gmx_int64_t step, gmx_wallcycle *wcycle)
@@ -262,17 +262,17 @@ void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x,
     wallcycle_stop(wcycle, ewcPP_PMESENDX);
 }
 
-void gmx_pme_send_finish(t_commrec *cr)
+void gmx_pme_send_finish(const t_commrec *cr)
 {
     unsigned int flags = PP_PME_FINISH;
 
     gmx_pme_send_coeffs_coords(cr, flags, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0, 0, -1);
 }
 
-void gmx_pme_send_switchgrid(t_commrec gmx_unused *cr,
-                             ivec gmx_unused       grid_size,
-                             real gmx_unused       ewaldcoeff_q,
-                             real gmx_unused       ewaldcoeff_lj)
+void gmx_pme_send_switchgrid(const t_commrec *cr,
+                             ivec             grid_size,
+                             real             ewaldcoeff_q,
+                             real             ewaldcoeff_lj)
 {
 #if GMX_MPI
     gmx_pme_comm_n_box_t cnb;
@@ -289,10 +289,15 @@ void gmx_pme_send_switchgrid(t_commrec gmx_unused *cr,
         MPI_Send(&cnb, sizeof(cnb), MPI_BYTE,
                  cr->dd->pme_nodeid, eCommType_CNB, cr->mpi_comm_mysim);
     }
+#else
+    GMX_UNUSED_VALUE(cr);
+    GMX_UNUSED_VALUE(grid_size);
+    GMX_UNUSED_VALUE(ewaldcoeff_q);
+    GMX_UNUSED_VALUE(ewaldcoeff_lj);
 #endif
 }
 
-void gmx_pme_send_resetcounters(t_commrec gmx_unused *cr, gmx_int64_t gmx_unused step)
+void gmx_pme_send_resetcounters(const t_commrec gmx_unused *cr, gmx_int64_t gmx_unused step)
 {
 #if GMX_MPI
     gmx_pme_comm_n_box_t cnb;
@@ -311,7 +316,7 @@ void gmx_pme_send_resetcounters(t_commrec gmx_unused *cr, gmx_int64_t gmx_unused
 }
 
 /*! \brief Receive virial and energy from PME rank */
-static void receive_virial_energy(t_commrec *cr,
+static void receive_virial_energy(const t_commrec *cr,
                                   gmx::ForceWithVirial *forceWithVirial,
                                   real *energy_q, real *energy_lj,
                                   real *dvdlambda_q, real *dvdlambda_lj,
@@ -355,7 +360,7 @@ static void receive_virial_energy(t_commrec *cr,
     }
 }
 
-void gmx_pme_receive_f(t_commrec *cr,
+void gmx_pme_receive_f(const t_commrec *cr,
                        gmx::ForceWithVirial *forceWithVirial,
                        real *energy_q, real *energy_lj,
                        real *dvdlambda_q, real *dvdlambda_lj,
index 00c29f5ba567301c2c28317d588d297b4605c891..d8a0729968e6dab97e6176152cc0fddc398ba80b 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,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.
@@ -433,7 +433,7 @@ void dd_pmeredist_f(struct gmx_pme_t *pme, pme_atomcomm_t *atc,
 }
 
 void
-do_redist_pos_coeffs(struct gmx_pme_t *pme, t_commrec *cr, int start, int homenr,
+do_redist_pos_coeffs(struct gmx_pme_t *pme, const t_commrec *cr, int start, int homenr,
                      gmx_bool bFirst, rvec x[], real *data)
 {
     int             d;
index 385828fcbff0608bf82e8a445109dd275509275d..2508611039225168fad5e31e4de8548e86ef3ee3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,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.
@@ -46,7 +46,7 @@ dd_pmeredist_f(struct gmx_pme_t *pme, pme_atomcomm_t *atc,
                gmx_bool bAddF);
 
 void
-do_redist_pos_coeffs(struct gmx_pme_t *pme, t_commrec *cr, int start, int homenr,
+do_redist_pos_coeffs(struct gmx_pme_t *pme, const t_commrec *cr, int start, int homenr,
                      gmx_bool bFirst, rvec x[], real *data);
 
 #endif
index 6aea2480314e84a981f9999ce8c95f8f75eb64f6..0171fe8f4ebf52d15a72c9d8e30c27114757695c 100644 (file)
@@ -841,7 +841,7 @@ gmx_pme_t *gmx_pme_init(const t_commrec     *cr,
 }
 
 void gmx_pme_reinit(struct gmx_pme_t **pmedata,
-                    t_commrec *        cr,
+                    const t_commrec   *cr,
                     struct gmx_pme_t * pme_src,
                     const t_inputrec * ir,
                     const ivec         grid_size,
@@ -963,7 +963,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                real chargeA[],  real chargeB[],
                real c6A[],      real c6B[],
                real sigmaA[],   real sigmaB[],
-               matrix box,      t_commrec *cr,
+               matrix box,      const t_commrec *cr,
                int  maxshift_x, int maxshift_y,
                t_nrnb *nrnb,    gmx_wallcycle *wcycle,
                matrix vir_q,    matrix vir_lj,
index 4b9972cfbc6cec44582b7bb359ef05f97fcaa9af..6533eebb970e149b713c174c3940b70ffaab468c 100644 (file)
@@ -165,7 +165,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                real chargeA[],  real chargeB[],
                real c6A[],      real c6B[],
                real sigmaA[],   real sigmaB[],
-               matrix box,      t_commrec *cr,
+               matrix box,      const t_commrec *cr,
                int  maxshift_x, int maxshift_y,
                t_nrnb *nrnb,    gmx_wallcycle *wcycle,
                matrix vir_q,    matrix vir_lj,
@@ -176,7 +176,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 
 /*! \brief Called on the nodes that do PME exclusively (as slaves) */
 int gmx_pmeonly(struct gmx_pme_t *pme,
-                struct t_commrec *cr,     t_nrnb *mynrnb,
+                const t_commrec *cr,     t_nrnb *mynrnb,
                 gmx_wallcycle  *wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
                 t_inputrec *ir, PmeRunMode runMode);
@@ -192,7 +192,7 @@ int gmx_pmeonly(struct gmx_pme_t *pme,
 void gmx_pme_calc_energy(struct gmx_pme_t *pme, int n, rvec *x, real *q, real *V);
 
 /*! \brief Send the charges and maxshift to out PME-only node. */
-void gmx_pme_send_parameters(struct t_commrec *cr,
+void gmx_pme_send_parameters(const t_commrec *cr,
                              const interaction_const_t *ic,
                              gmx_bool bFreeEnergy_q, gmx_bool bFreeEnergy_lj,
                              real *chargeA, real *chargeB,
@@ -201,19 +201,19 @@ void gmx_pme_send_parameters(struct t_commrec *cr,
                              int maxshift_x, int maxshift_y);
 
 /*! \brief Send the coordinates to our PME-only node and request a PME calculation */
-void gmx_pme_send_coordinates(struct t_commrec *cr, matrix box, rvec *x,
+void gmx_pme_send_coordinates(const t_commrec *cr, matrix box, rvec *x,
                               real lambda_q, real lambda_lj,
                               gmx_bool bEnerVir,
                               gmx_int64_t step, gmx_wallcycle *wcycle);
 
 /*! \brief Tell our PME-only node to finish */
-void gmx_pme_send_finish(struct t_commrec *cr);
+void gmx_pme_send_finish(const t_commrec *cr);
 
 /*! \brief Tell our PME-only node to reset all cycle and flop counters */
-void gmx_pme_send_resetcounters(struct t_commrec *cr, gmx_int64_t step);
+void gmx_pme_send_resetcounters(const t_commrec *cr, gmx_int64_t step);
 
 /*! \brief PP nodes receive the long range forces from the PME nodes */
-void gmx_pme_receive_f(struct t_commrec *cr,
+void gmx_pme_receive_f(const t_commrec *cr,
                        gmx::ForceWithVirial *forceWithVirial,
                        real *energy_q, real *energy_lj,
                        real *dvdlambda_q, real *dvdlambda_lj,
index 2034fb596663eddf4f0d00e89f8818dc60c915fc..9db7e551445dad36feb1b8e19af4bfd42e5e1e26 100644 (file)
@@ -1777,7 +1777,7 @@ static int do_cpt_files(XDR *xd, gmx_bool bRead,
 
 
 void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
-                      FILE *fplog, t_commrec *cr,
+                      FILE *fplog, const t_commrec *cr,
                       ivec domdecCells, int nppnodes,
                       int eIntegrator, int simulation_part,
                       gmx_bool bExpanded, int elamstats,
index be07ba515fd40772ec081a67ce639350f0edbbb0..3d3e73686c94592287a2cc3ad5dddb06609e7bda 100644 (file)
@@ -62,7 +62,7 @@ struct t_trxframe;
  * otherwise moves the previous <fn>.cpt to <fn>_prev.cpt
  */
 void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
-                      FILE *fplog, t_commrec *cr,
+                      FILE *fplog, const t_commrec *cr,
                       ivec domdecCells, int nppnodes,
                       int eIntegrator, int simulation_part,
                       gmx_bool bExpanded, int elamstats,
index 2a5c4e73ca491a5b43f442b2aae82ec94eccfb86..02666d3c80834e3d13bda48656c80bef08054bee 100644 (file)
@@ -808,7 +808,7 @@ static void output_imd_forces(t_inputrec *ir, double time)
 
 
 /*! \brief Synchronize the nodes. */
-static void imd_sync_nodes(t_inputrec *ir, t_commrec *cr, double t)
+static void imd_sync_nodes(t_inputrec *ir, const t_commrec *cr, double t)
 {
     int              new_nforces = 0;
     t_gmx_IMD_setup *IMDsetup;
@@ -1227,7 +1227,7 @@ static void imd_remove_molshifts(t_gmx_IMD_setup *IMDsetup, matrix box)
 
 
 /*! \brief Initialize arrays used to assemble the positions from the other nodes. */
-static void init_imd_prepare_for_x_assembly(t_commrec *cr, rvec x[], t_gmx_IMD_setup *IMDsetup)
+static void init_imd_prepare_for_x_assembly(const t_commrec *cr, rvec x[], t_gmx_IMD_setup *IMDsetup)
 {
     int i, ii;
 
@@ -1273,7 +1273,7 @@ static void init_imd_prepare_for_x_assembly(t_commrec *cr, rvec x[], t_gmx_IMD_s
 
 
 /*! \brief Check for non-working integrator / parallel options. */
-static void imd_check_integrator_parallel(t_inputrec *ir, t_commrec *cr)
+static void imd_check_integrator_parallel(t_inputrec *ir, const t_commrec *cr)
 {
     if (PAR(cr))
     {
@@ -1286,7 +1286,7 @@ static void imd_check_integrator_parallel(t_inputrec *ir, t_commrec *cr)
 }
 
 void init_IMD(t_inputrec             *ir,
-              t_commrec              *cr,
+              const t_commrec        *cr,
               const gmx_multisim_t   *ms,
               gmx_mtop_t             *top_global,
               FILE                   *fplog,
@@ -1477,15 +1477,15 @@ void init_IMD(t_inputrec             *ir,
 }
 
 
-gmx_bool do_IMD(gmx_bool        bIMD,
-                gmx_int64_t     step,
-                t_commrec      *cr,
-                gmx_bool        bNS,
-                matrix          box,
-                rvec            x[],
-                t_inputrec     *ir,
-                double          t,
-                gmx_wallcycle  *wcycle)
+gmx_bool do_IMD(gmx_bool         bIMD,
+                gmx_int64_t      step,
+                const t_commrec *cr,
+                gmx_bool         bNS,
+                matrix           box,
+                rvec             x[],
+                t_inputrec      *ir,
+                double           t,
+                gmx_wallcycle   *wcycle)
 {
     gmx_bool         imdstep = FALSE;
     t_gmx_IMD_setup *IMDsetup;
@@ -1662,7 +1662,7 @@ int IMD_get_step(t_gmx_IMD *IMDsetup)
 }
 
 
-void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd, t_commrec *cr, rvec *f,
+void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd, const t_commrec *cr, rvec *f,
                       gmx_wallcycle *wcycle)
 {
     int              i, j;
index 30e29eb16d551f4c7f794d9f23db2b486e53baf3..f34dd4585d8538b4745ddf95848ee1c5013bbddd 100644 (file)
@@ -140,7 +140,7 @@ void dd_make_local_IMD_atoms(gmx_bool bIMD, gmx_domdec_t *dd, t_IMD *imd);
  * \param oenv         Output options.
  * \param mdrunOptions Options for mdrun.
  */
-void init_IMD(t_inputrec *ir, t_commrec *cr,
+void init_IMD(t_inputrec *ir, const t_commrec *cr,
               const gmx_multisim_t *ms,
               gmx_mtop_t *top_global,
               FILE *fplog, int defnstimd, rvec x[],
@@ -164,7 +164,7 @@ void init_IMD(t_inputrec *ir, t_commrec *cr,
  *
  * \returns            Whether or not we have to do IMD communication at this step.
  */
-gmx_bool do_IMD(gmx_bool bIMD, gmx_int64_t step, t_commrec *cr,
+gmx_bool do_IMD(gmx_bool bIMD, gmx_int64_t step, const t_commrec *cr,
                 gmx_bool bNS,
                 matrix box, rvec x[], t_inputrec *ir, double t,
                 gmx_wallcycle *wcycle);
@@ -188,7 +188,7 @@ int IMD_get_step(t_gmx_IMD *IMDsetup);
  * \param wcycle       Count wallcycles of IMD routines for diagnostic output.
  */
 void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd,
-                      t_commrec *cr, rvec *f,
+                      const t_commrec *cr, rvec *f,
                       gmx_wallcycle *wcycle);
 
 
index cbab5eacc5e3e1ebc3a2ea5a580b9fce974b2efd..ab98e6613c708adca583869a5c146e6f87512a32 100644 (file)
@@ -142,7 +142,7 @@ void too_many_constraint_warnings(int eConstrAlg, int warncount)
 
 static void write_constr_pdb(const char *fn, const char *title,
                              const gmx_mtop_t *mtop,
-                             int start, int homenr, t_commrec *cr,
+                             int start, int homenr, const t_commrec *cr,
                              rvec x[], matrix box)
 {
     char          fname[STRLEN];
@@ -198,7 +198,7 @@ static void write_constr_pdb(const char *fn, const char *title,
 }
 
 static void dump_confs(FILE *fplog, gmx_int64_t step, const gmx_mtop_t *mtop,
-                       int start, int homenr, t_commrec *cr,
+                       int start, int homenr, const t_commrec *cr,
                        rvec x[], rvec xprime[], matrix box)
 {
     char  buf[STRLEN], buf2[22];
@@ -224,8 +224,8 @@ static void dump_confs(FILE *fplog, gmx_int64_t step, const gmx_mtop_t *mtop,
 
 gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                    struct gmx_constr *constr,
-                   t_idef *idef, t_inputrec *ir,
-                   t_commrec *cr,
+                   t_idef *idef, const t_inputrec *ir,
+                   const t_commrec *cr,
                    const gmx_multisim_t *ms,
                    gmx_int64_t step, int delta_step,
                    real step_scaling,
@@ -702,7 +702,7 @@ static int *make_at2settle(int natoms, const t_ilist *ilist)
 
 void set_constraints(struct gmx_constr *constr,
                      gmx_localtop_t *top, const t_inputrec *ir,
-                     const t_mdatoms *md, t_commrec *cr)
+                     const t_mdatoms *md, const t_commrec *cr)
 {
     t_idef *idef = &top->idef;
 
@@ -746,7 +746,7 @@ void set_constraints(struct gmx_constr *constr,
 gmx_constr_t init_constraints(FILE *fplog,
                               const gmx_mtop_t *mtop, const t_inputrec *ir,
                               bool doEssentialDynamics,
-                              t_commrec *cr)
+                              const t_commrec *cr)
 {
     int nconstraints =
         gmx_mtop_ftype_count(mtop, F_CONSTR) +
index 8ab95efe30fe7fbdf17cd046270bbbf8047b33d8..15eec40bcf580b132272769a63a72eab6111ed70 100644 (file)
@@ -84,8 +84,8 @@ void too_many_constraint_warnings(int eConstrAlg, int warncount);
 gmx_bool constrain(FILE *log, gmx_bool bLog, gmx_bool bEner,
                    gmx_constr_t constr,
                    t_idef *idef,
-                   t_inputrec *ir,
-                   t_commrec *cr,
+                   const t_inputrec *ir,
+                   const t_commrec *cr,
                    const gmx_multisim_t *ms,
                    gmx_int64_t step, int delta_step,
                    real step_scaling,
@@ -129,7 +129,7 @@ gmx_bool constrain(FILE *log, gmx_bool bLog, gmx_bool bEner,
 gmx_constr_t init_constraints(FILE *log,
                               const gmx_mtop_t *mtop, const t_inputrec *ir,
                               bool doEssentialDynamics,
-                              t_commrec *cr);
+                              const t_commrec *cr);
 /* Initialize constraints stuff */
 
 void saveEdsamPointer(gmx_constr_t      constr,
@@ -140,7 +140,7 @@ void set_constraints(gmx_constr_t             constr,
                      gmx_localtop_t          *top,
                      const t_inputrec        *ir,
                      const t_mdatoms         *md,
-                     t_commrec               *cr);
+                     const t_commrec         *cr);
 /* Set up all the local constraints for the node */
 
 /* The at2con t_blocka struct returned by the routines below
index 15221b313de3c4c201ed0ba883ca1ef74a8f877b..51456989b787f8b83dca2d0d39e05e84d31fc16f 100644 (file)
@@ -79,7 +79,7 @@ void ns(FILE              *fp,
         gmx_groups_t      *groups,
         gmx_localtop_t    *top,
         t_mdatoms         *md,
-        t_commrec         *cr,
+        const t_commrec   *cr,
         t_nrnb            *nrnb,
         gmx_bool           bFillGrid)
 {
@@ -135,7 +135,7 @@ static void reduceEwaldThreadOuput(int nthreads, ewald_corr_thread_t *ewc_t)
 }
 
 void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
-                       t_idef     *idef,    t_commrec  *cr,
+                       t_idef     *idef,    const t_commrec *cr,
                        const gmx_multisim_t *ms,
                        t_nrnb     *nrnb,    gmx_wallcycle_t wcycle,
                        t_mdatoms  *md,
index 86dcc2af4854239a5802d15f2067cc4017be61b6..93c1d10f452a3ed827d7d03be947da82becdc45c 100644 (file)
@@ -109,7 +109,7 @@ real do_walls(t_inputrec *ir, t_forcerec *fr, matrix box, t_mdatoms *md,
               rvec x[], rvec f[], real lambda, real Vlj[], t_nrnb *nrnb);
 
 gmx_bool can_use_allvsall(const t_inputrec *ir,
-                          gmx_bool bPrintNote, t_commrec *cr, FILE *fp);
+                          gmx_bool bPrintNote, const t_commrec *cr, FILE *fp);
 /* Returns if we can use all-vs-all loops.
  * If bPrintNote==TRUE, prints a note, if necessary, to stderr
  * and fp (if !=NULL) on the master node.
@@ -151,7 +151,7 @@ void sum_dhdl(gmx_enerdata_t *enerd, gmx::ArrayRef<const real> lambda, t_lambda
 void set_avcsixtwelve(FILE *fplog, t_forcerec *fr,
                       const gmx_mtop_t *mtop);
 
-void do_force(FILE *log, t_commrec *cr,
+void do_force(FILE *log, const t_commrec *cr,
               const gmx_multisim_t *ms,
               t_inputrec *inputrec,
               gmx_int64_t step, struct t_nrnb *nrnb, gmx_wallcycle_t wcycle,
@@ -185,7 +185,7 @@ void ns(FILE              *fplog,
         gmx_groups_t      *groups,
         gmx_localtop_t    *top,
         t_mdatoms         *md,
-        t_commrec         *cr,
+        const t_commrec   *cr,
         t_nrnb            *nrnb,
         gmx_bool           bFillGrid);
 /* Call the neighborsearcher */
@@ -193,7 +193,7 @@ void ns(FILE              *fplog,
 void do_force_lowlevel(t_forcerec   *fr,
                        t_inputrec   *ir,
                        t_idef       *idef,
-                       t_commrec    *cr,
+                       const t_commrec *cr,
                        const gmx_multisim_t *ms,
                        t_nrnb       *nrnb,
                        gmx_wallcycle_t wcycle,
index 1e0ed5af12cf73e22095d03a6f0e7ecca148a1fa..0a98e7ada40e614f0aa5bff7f4cf6a80c09a293b 100644 (file)
@@ -1531,7 +1531,7 @@ static real cutoff_inf(real cutoff)
     return cutoff;
 }
 
-gmx_bool can_use_allvsall(const t_inputrec *ir, gmx_bool bPrintNote, t_commrec *cr, FILE *fp)
+gmx_bool can_use_allvsall(const t_inputrec *ir, gmx_bool bPrintNote, const t_commrec *cr, FILE *fp)
 {
     gmx_bool bAllvsAll;
 
index 3d84a7fa82043468882bea428c13b7af5dc3ecdc..7444e6855fbcebe003b2d569983466a8dfd9a39e 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) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
@@ -194,19 +194,19 @@ static void shift_positions_group(
  * The atom indices are retrieved from anrs_loc[0..nr_loc]
  * Note that coll_ind[i] = i is needed in the serial case */
 extern void communicate_group_positions(
-        t_commrec     *cr,           /* Pointer to MPI communication data */
-        rvec          *xcoll,        /* Collective array of positions */
-        ivec          *shifts,       /* Collective array of shifts for xcoll (can be NULL) */
-        ivec          *extra_shifts, /* (optional) Extra shifts since last time step */
-        const gmx_bool bNS,          /* (optional) NS step, the shifts have changed */
-        rvec          *x_loc,        /* Local positions on this node */
-        const int      nr,           /* Total number of atoms in the group */
-        const int      nr_loc,       /* Local number of atoms in the group */
-        int           *anrs_loc,     /* Local atom numbers */
-        int           *coll_ind,     /* Collective index */
-        rvec          *xcoll_old,    /* (optional) Positions from the last time step,
-                                        used to make group whole */
-        matrix         box)          /* (optional) The box */
+        const t_commrec *cr,           /* Pointer to MPI communication data */
+        rvec            *xcoll,        /* Collective array of positions */
+        ivec            *shifts,       /* Collective array of shifts for xcoll (can be NULL) */
+        ivec            *extra_shifts, /* (optional) Extra shifts since last time step */
+        const gmx_bool   bNS,          /* (optional) NS step, the shifts have changed */
+        rvec            *x_loc,        /* Local positions on this node */
+        const int        nr,           /* Total number of atoms in the group */
+        const int        nr_loc,       /* Local number of atoms in the group */
+        int             *anrs_loc,     /* Local atom numbers */
+        int             *coll_ind,     /* Collective index */
+        rvec            *xcoll_old,    /* (optional) Positions from the last time step,
+                                          used to make group whole */
+        matrix           box)          /* (optional) The box */
 {
     int i;
 
@@ -333,12 +333,12 @@ extern void get_center(rvec x[], real weight[], const int nr, rvec rcenter)
 /* Get the center from local positions that already have the correct
  * PBC representation */
 extern void get_center_comm(
-        t_commrec *cr,
-        rvec       x_loc[],      /* Local positions */
-        real       weight_loc[], /* Local masses or other weights */
-        int        nr_loc,       /* Local number of atoms */
-        int        nr_group,     /* Total number of atoms of the group */
-        rvec       center)       /* Weighted center */
+        const t_commrec *cr,
+        rvec             x_loc[],      /* Local positions */
+        real             weight_loc[], /* Local masses or other weights */
+        int              nr_loc,       /* Local number of atoms */
+        int              nr_group,     /* Total number of atoms of the group */
+        rvec             center)       /* Weighted center */
 {
     double weight_sum, denom;
     dvec   dsumvec;
index a398ac8e33e002000ebc75117bda29f35eef67b7..51c13b9334f540b5c75f15326ee197fa00684cfc 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) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,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.
@@ -127,7 +127,7 @@ extern void dd_make_local_group_indices(gmx_ga2la_t *ga2la,
  * \param[in]     box          Simulation box matrix, needed to shift xcoll such that
  *                             the group becomes whole (optional).
  */
-extern void communicate_group_positions(t_commrec *cr, rvec *xcoll, ivec *shifts,
+extern void communicate_group_positions(const t_commrec *cr, rvec *xcoll, ivec *shifts,
                                         ivec *extra_shifts, const gmx_bool bNS,
                                         rvec *x_loc, const int nr, const int nr_loc,
                                         int *anrs_loc, int *coll_ind, rvec *xcoll_old,
@@ -182,7 +182,7 @@ extern double get_sum_of_positions(rvec x[], real weight[], const int nr, dvec d
  * \param[out]  center       The (weighted) center of all x_loc from all the
  *                           nodes.
  */
-extern void get_center_comm(t_commrec *cr, rvec x_loc[], real weight_loc[],
+extern void get_center_comm(const t_commrec *cr, rvec x_loc[], real weight_loc[],
                             int nr_loc, int nr_group, rvec center);
 
 
index 5868a62d00e91fa44c69b4978be37305b258ac84..5adaf1bd2dca0126c87b1d1cefb27241cd56f0b3 100644 (file)
@@ -890,7 +890,7 @@ calc_dist_iter_simd(int                       b0,
 static void do_lincs(rvec *x, rvec *xp, matrix box, t_pbc *pbc,
                      gmx_lincsdata *lincsd, int th,
                      const real *invmass,
-                     t_commrec *cr,
+                     const t_commrec *cr,
                      gmx_bool bCalcDHDL,
                      real wangle, gmx_bool *bWarn,
                      real invdt, rvec * gmx_restrict v,
@@ -1896,7 +1896,7 @@ static void set_matrix_indices(gmx_lincsdata        *li,
 void set_lincs(const t_idef         *idef,
                const t_mdatoms      *md,
                gmx_bool              bDynamics,
-               t_commrec            *cr,
+               const t_commrec      *cr,
                gmx_lincsdata        *li)
 {
     int          natoms, nflexcon;
@@ -2326,10 +2326,10 @@ static void cconerr(const gmx_lincsdata *lincsd,
 }
 
 gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
-                         t_inputrec *ir,
+                         const t_inputrec *ir,
                          gmx_int64_t step,
                          gmx_lincsdata *lincsd, t_mdatoms *md,
-                         t_commrec *cr,
+                         const t_commrec *cr,
                          const gmx_multisim_t *ms,
                          rvec *x, rvec *xprime, rvec *min_proj,
                          matrix box, t_pbc *pbc,
index 8001c37ce39064f4e36ae1686a4d7c2e70cda048..c51d3b6a630b24a7a5f8be6ce6deabc4cb7c734e 100644 (file)
@@ -67,16 +67,16 @@ gmx_lincsdata_t init_lincs(FILE *fplog, const gmx_mtop_t *mtop,
 /* Initializes and returns the lincs data struct */
 
 void set_lincs(const t_idef *idef, const t_mdatoms *md,
-               gmx_bool bDynamics, t_commrec *cr,
+               gmx_bool bDynamics, const t_commrec *cr,
                gmx_lincsdata_t li);
 /* Initialize lincs stuff */
 
 gmx_bool
 constrain_lincs(FILE *log, gmx_bool bLog, gmx_bool bEner,
-                t_inputrec *ir,
+                const t_inputrec *ir,
                 gmx_int64_t step,
                 gmx_lincsdata_t lincsd, t_mdatoms *md,
-                t_commrec *cr,
+                const t_commrec *cr,
                 const gmx_multisim_t *ms,
                 rvec *x, rvec *xprime, rvec *min_proj,
                 matrix box, t_pbc *pbc,
index f82d63f54b991febbc15831d66eec85bbe15e0c5..be25b1b826c87385ed9c84e6d069f5f186cad32e 100644 (file)
@@ -245,7 +245,7 @@ gmx_wallcycle_t mdoutf_get_wcycle(gmx_mdoutf_t of)
     return of->wcycle;
 }
 
-void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
+void mdoutf_write_to_trajectory_files(FILE *fplog, const t_commrec *cr,
                                       gmx_mdoutf_t of,
                                       int mdof_flags,
                                       gmx_mtop_t *top_global,
index ec68f27fd0a4604708108c505fb293f3b8fea9e0..4e55c325367e7f86fb05336ece7605f9183b5950 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016,2017, 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.
@@ -102,7 +102,7 @@ void done_mdoutf(gmx_mdoutf_t of);
  * the master node only when necessary. Without domain decomposition
  * only data from state_local is used and state_global is ignored.
  */
-void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
+void mdoutf_write_to_trajectory_files(FILE *fplog, const t_commrec *cr,
                                       gmx_mdoutf_t of,
                                       int mdof_flags,
                                       gmx_mtop_t *top_global,
index 7ab1cb8c5eca634a75342c0b469221f2ddf37586..08c325abfa6629edd77ab11c047db076a247fa11 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -59,7 +59,7 @@
  * for initialization and atom-data setup.
  */
 
-void mdAlgorithmsSetupAtomData(t_commrec         *cr,
+void mdAlgorithmsSetupAtomData(const t_commrec   *cr,
                                const t_inputrec  *ir,
                                const gmx_mtop_t  *top_global,
                                gmx_localtop_t    *top,
index b4a1dbd2173962a759fb9f88be0c2d87405582a2..9e94b270dd14cb5f30e7e12ccbe39f4d0feb8f03 100644 (file)
@@ -66,7 +66,7 @@ class MDAtoms;
  * \param[in,out] vsite      The virtual site data, can be NULL
  * \param[in,out] shellfc    The shell/flexible-constraint data, can be NULL
  */
-void mdAlgorithmsSetupAtomData(t_commrec         *cr,
+void mdAlgorithmsSetupAtomData(const t_commrec   *cr,
                                const t_inputrec  *ir,
                                const gmx_mtop_t  *top_global,
                                gmx_localtop_t    *top,
index 7362424b0eafe7135318cb95ad03658a916786a9..3c30f22e77a706559e8bed291bc1cc59ba97f67b 100644 (file)
@@ -118,7 +118,7 @@ typedef struct {
 
 //! Print the EM starting conditions
 static void print_em_start(FILE                     *fplog,
-                           t_commrec                *cr,
+                           const t_commrec          *cr,
                            gmx_walltime_accounting_t walltime_accounting,
                            gmx_wallcycle_t           wcycle,
                            const char               *name)
@@ -218,7 +218,7 @@ static void print_converged(FILE *fp, const char *alg, real ftol,
 }
 
 //! Compute the norm and max of the force array in parallel
-static void get_f_norm_max(t_commrec *cr,
+static void get_f_norm_max(const t_commrec *cr,
                            t_grpopts *opts, t_mdatoms *mdatoms, const rvec *f,
                            real *fnorm, real *fmax, int *a_fmax)
 {
@@ -312,7 +312,7 @@ static void get_f_norm_max(t_commrec *cr,
 }
 
 //! Compute the norm of the force
-static void get_state_f_norm_max(t_commrec *cr,
+static void get_state_f_norm_max(const t_commrec *cr,
                                  t_grpopts *opts, t_mdatoms *mdatoms,
                                  em_state_t *ems)
 {
@@ -322,7 +322,7 @@ static void get_state_f_norm_max(t_commrec *cr,
 
 //! Initialize the energy minimization
 static void init_em(FILE *fplog, const char *title,
-                    t_commrec *cr,
+                    const t_commrec *cr,
                     const gmx_multisim_t *ms,
                     gmx::IMDOutputProvider *outputProvider,
                     t_inputrec *ir,
@@ -478,7 +478,7 @@ static void init_em(FILE *fplog, const char *title,
 }
 
 //! Finalize the minimization
-static void finish_em(t_commrec *cr, gmx_mdoutf_t outf,
+static void finish_em(const t_commrec *cr, gmx_mdoutf_t outf,
                       gmx_walltime_accounting_t walltime_accounting,
                       gmx_wallcycle_t wcycle)
 {
@@ -504,7 +504,7 @@ static void swap_em_state(em_state_t **ems1, em_state_t **ems2)
 }
 
 //! Save the EM trajectory
-static void write_em_traj(FILE *fplog, t_commrec *cr,
+static void write_em_traj(FILE *fplog, const t_commrec *cr,
                           gmx_mdoutf_t outf,
                           gmx_bool bX, gmx_bool bF, const char *confout,
                           gmx_mtop_t *top_global,
@@ -562,7 +562,7 @@ static void write_em_traj(FILE *fplog, t_commrec *cr,
 //! \brief Do one minimization step
 //
 // \returns true when the step succeeded, false when a constraint error occurred
-static bool do_em_step(t_commrec *cr,
+static bool do_em_step(const t_commrec *cr,
                        const gmx_multisim_t *ms,
                        t_inputrec *ir, t_mdatoms *md,
                        gmx_bool bMolPBC,
@@ -696,7 +696,7 @@ static bool do_em_step(t_commrec *cr,
 }
 
 //! Prepare EM for using domain decomposition parallellization
-static void em_dd_partition_system(FILE *fplog, int step, t_commrec *cr,
+static void em_dd_partition_system(FILE *fplog, int step, const t_commrec *cr,
                                    gmx_mtop_t *top_global, t_inputrec *ir,
                                    em_state_t *ems, gmx_localtop_t *top,
                                    gmx::MDAtoms *mdAtoms, t_forcerec *fr,
@@ -848,7 +848,7 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
 }
 
 //! Parallel utility summing energies and forces
-static double reorder_partsum(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms,
+static double reorder_partsum(const t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms,
                               gmx_mtop_t *top_global,
                               em_state_t *s_min, em_state_t *s_b)
 {
@@ -926,7 +926,7 @@ static double reorder_partsum(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms
 }
 
 //! Print some stuff, like beta, whatever that means.
-static real pr_beta(t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms,
+static real pr_beta(const t_commrec *cr, t_grpopts *opts, t_mdatoms *mdatoms,
                     gmx_mtop_t *top_global,
                     em_state_t *s_min, em_state_t *s_b)
 {
index bf661a252861d3e79eb0b5ff68e9f69bde616c50..2f6832aa6b1153472a97dc967ee6f4dcfbbc3839 100644 (file)
@@ -1668,7 +1668,7 @@ static void init_nsgrid_lists(t_forcerec *fr, int ngid, gmx_ns_t *ns)
     }
 }
 
-static int nsgrid_core(t_commrec *cr, t_forcerec *fr,
+static int nsgrid_core(const t_commrec *cr, t_forcerec *fr,
                        matrix box, int ngid,
                        gmx_localtop_t *top,
                        t_grid *grid,
@@ -2162,7 +2162,7 @@ int search_neighbours(FILE *log, t_forcerec *fr,
                       matrix box,
                       gmx_localtop_t *top,
                       gmx_groups_t *groups,
-                      t_commrec *cr,
+                      const t_commrec *cr,
                       t_nrnb *nrnb, t_mdatoms *md,
                       gmx_bool bFillGrid)
 {
index a65e03def9df1692570fa02c016f5166e9e3a043..ab1b9057cf94ce000b7b2a0d40109eb72e97ffaa 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,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.
@@ -86,13 +86,13 @@ void init_ns(FILE *fplog, const t_commrec *cr,
 int search_neighbours(FILE *log, t_forcerec *fr, matrix box,
                       gmx_localtop_t *top,
                       gmx_groups_t *groups,
-                      t_commrec *cr,
+                      const t_commrec *cr,
                       t_nrnb *nrnb, t_mdatoms *md,
                       gmx_bool bFillGrid);
 
 
 /* Debugging routines from wnblist.c */
-void dump_nblist(FILE *out, t_commrec *cr, t_forcerec *fr, int nDNL);
+void dump_nblist(FILE *out, const t_commrec *cr, t_forcerec *fr, int nDNL);
 
 int read_nblist(FILE *in, FILE *out, int **mat, int natoms, gmx_bool bSymm);
 /* Returns total number of neighbors. If bSymm the matrix is symmetrized. */
index 6dfe8693ba8284df5ea0394b76b5352a1095e2eb..7e834b8dfee4dc72710e1b330f4939dd6eda15d0 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, 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.
@@ -77,7 +77,7 @@
 /* GAMESS interface */
 
 void
-init_gamess(t_commrec *cr, t_QMrec *qm, t_MMrec *mm);
+init_gamess(const t_commrec *cr, t_QMrec *qm, t_MMrec *mm);
 
 real
 call_gamess(t_forcerec *fr,
@@ -130,7 +130,7 @@ static int struct_comp(const void *a, const void *b)
 
 } /* struct_comp */
 
-static real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec gmx_unused *qm,
+static real call_QMroutine(const t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec gmx_unused *qm,
                            t_MMrec gmx_unused *mm, rvec gmx_unused f[], rvec gmx_unused fshift[])
 {
     /* makes a call to the requested QM routine (qm->QMmethod)
@@ -183,7 +183,7 @@ static real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr,
     return (QMener);
 }
 
-static void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm)
+static void init_QMroutine(const t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm)
 {
     /* makes a call to the requested QM routine (qm->QMmethod)
      */
@@ -360,10 +360,10 @@ t_QMMMrec *mk_QMMMrec(void)
 
 } /* mk_QMMMrec */
 
-void init_QMMMrec(t_commrec  *cr,
-                  gmx_mtop_t *mtop,
-                  t_inputrec *ir,
-                  t_forcerec *fr)
+void init_QMMMrec(const t_commrec *cr,
+                  gmx_mtop_t      *mtop,
+                  t_inputrec      *ir,
+                  t_forcerec      *fr)
 {
     /* we put the atomsnumbers of atoms that belong to the QMMM group in
      * an array that will be copied later to QMMMrec->indexQM[..]. Also
@@ -582,7 +582,7 @@ void init_QMMMrec(t_commrec  *cr,
     }
 } /* init_QMMMrec */
 
-void update_QMMMrec(t_commrec       *cr,
+void update_QMMMrec(const t_commrec *cr,
                     t_forcerec      *fr,
                     const rvec      *x,
                     const t_mdatoms *md,
@@ -852,9 +852,9 @@ void update_QMMMrec(t_commrec       *cr,
 } /* update_QMMM_rec */
 
 
-real calculate_QMMM(t_commrec  *cr,
-                    rvec        f[],
-                    t_forcerec *fr)
+real calculate_QMMM(const t_commrec *cr,
+                    rvec             f[],
+                    t_forcerec      *fr)
 {
     real
         QMener = 0.0;
index 887cbdd3b3cbdeee386394a5b6075bfbf87fddeb..714646e415f260c2a909b00a3feeb2ab4f4f9521 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,2017, by the GROMACS development team, led by
+ * 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.
@@ -109,10 +109,10 @@ void atomic_number(int nr, char ***atomtype, int *nucnum);
 t_QMMMrec *mk_QMMMrec(void);
 /* allocates memory for QMMMrec */
 
-void init_QMMMrec(t_commrec  *cr,
-                  gmx_mtop_t *mtop,
-                  t_inputrec *ir,
-                  t_forcerec *fr);
+void init_QMMMrec(const t_commrec *cr,
+                  gmx_mtop_t      *mtop,
+                  t_inputrec      *ir,
+                  t_forcerec      *fr);
 
 /* init_QMMMrec initializes the QMMM record. From
  * topology->atoms.atomname and topology->atoms.atomtype the atom
@@ -121,7 +121,7 @@ void init_QMMMrec(t_commrec  *cr,
  * and md->cQMMM gives numbers of the MM and QM atoms
  */
 
-void update_QMMMrec(t_commrec       *cr,
+void update_QMMMrec(const t_commrec *cr,
                     t_forcerec      *fr,
                     const rvec      *x,
                     const t_mdatoms *md,
@@ -133,9 +133,9 @@ void update_QMMMrec(t_commrec       *cr,
  * elements of the t_QMMMrec struct.
  */
 
-real calculate_QMMM(t_commrec  *cr,
-                    rvec        f[],
-                    t_forcerec *fr);
+real calculate_QMMM(const t_commrec *cr,
+                    rvec             f[],
+                    t_forcerec      *fr);
 
 /* QMMM computes the QM forces. This routine makes either function
  * calls to gmx QM routines (derived from MOPAC7 (semi-emp.) and MPQC
index f180b6c865c850d8718100bf738d170981ac37f0..b799b7cbfd2aeb182363145d70d5f52294082326 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) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,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.
@@ -128,7 +128,7 @@ int add_bind(t_bin *b, int nr, double r[])
     return index;
 }
 
-void sum_bin(t_bin *b, t_commrec *cr)
+void sum_bin(t_bin *b, const t_commrec *cr)
 {
     int i;
 
index c868b1edf535bcb367faf1d51fc938b36a61cfa6..86b0bbd5b686ce1ea8b3e7633713f75cd64ab51c 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) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,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,7 +60,7 @@ int add_binr(t_bin *b, int nr, real r[]);
 int add_bind(t_bin *b, int nr, double r[]);
 /* Add reals to the bin. Returns index */
 
-void sum_bin(t_bin *b, struct t_commrec *cr);
+void sum_bin(t_bin *b, const t_commrec *cr);
 /* Globally sum the reals in the bin */
 
 void extract_binr(t_bin *b, int index, int nr, real r[]);
index d51e2397cb53c23d29a9258e64bbd5669d8e6a7f..c40022a11d77aa0e6b0f5817e11ad057f4559ccd 100644 (file)
@@ -593,7 +593,7 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
     return shfc;
 }
 
-void make_local_shells(t_commrec *cr, t_mdatoms *md,
+void make_local_shells(const t_commrec *cr, t_mdatoms *md,
                        gmx_shellfc_t *shfc)
 {
     t_shell      *shell;
@@ -828,7 +828,7 @@ static void print_epot(FILE *fp, gmx_int64_t mdstep, int count, real epot, real
 }
 
 
-static real rms_force(t_commrec *cr, gmx::ArrayRef<const gmx::RVec> force, int ns, t_shell s[],
+static real rms_force(const t_commrec *cr, gmx::ArrayRef<const gmx::RVec> force, int ns, t_shell s[],
                       int ndir, real *sf_dir, real *Epot)
 {
     double      buf[4];
@@ -894,7 +894,7 @@ static void dump_shells(FILE *fp, gmx::ArrayRef<gmx::RVec> x, gmx::ArrayRef<gmx:
 
 static void init_adir(FILE *log, gmx_shellfc_t *shfc,
                       gmx_constr_t constr, t_idef *idef, t_inputrec *ir,
-                      t_commrec *cr,
+                      const t_commrec *cr,
                       const gmx_multisim_t *ms,
                       int dd_ac1,
                       gmx_int64_t step, t_mdatoms *md, int end,
@@ -976,7 +976,7 @@ static void init_adir(FILE *log, gmx_shellfc_t *shfc,
               nullptr, nullptr, nrnb, econqDeriv_FlexCon);
 }
 
-void relax_shell_flexcon(FILE *fplog, t_commrec *cr,
+void relax_shell_flexcon(FILE *fplog, const t_commrec *cr,
                          const gmx_multisim_t *ms,
                          gmx_bool bVerbose,
                          gmx_int64_t mdstep, t_inputrec *inputrec,
index b8ddae55338efc67a6d593fa84392a2c7001cd68..b0b95cd9e12b2da24bb79a7a71918ba75f7ea1c4 100644 (file)
@@ -64,11 +64,11 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
                                   bool usingDomainDecomposition);
 
 /* Get the local shell with domain decomposition */
-void make_local_shells(t_commrec *cr, t_mdatoms *md,
+void make_local_shells(const t_commrec *cr, t_mdatoms *md,
                        gmx_shellfc_t *shfc);
 
 /* Optimize shell positions */
-void relax_shell_flexcon(FILE *log, t_commrec *cr,
+void relax_shell_flexcon(FILE *log, const t_commrec *cr,
                          const gmx_multisim_t *ms,
                          gmx_bool bVerbose,
                          gmx_int64_t mdstep, t_inputrec *inputrec,
index 221277eb48cc8d55f10154aa18bb556c5b789a39..876243c6bc71f44b1e7dc2673f41f044f393d087 100644 (file)
@@ -127,7 +127,7 @@ void print_time(FILE                     *out,
                 gmx_walltime_accounting_t walltime_accounting,
                 gmx_int64_t               step,
                 t_inputrec               *ir,
-                t_commrec gmx_unused     *cr)
+                const t_commrec          *cr)
 {
     time_t finish;
     char   timebuf[STRLEN];
@@ -176,6 +176,8 @@ void print_time(FILE                     *out,
     {
         fprintf(out, "\n");
     }
+#else
+    GMX_UNUSED_VALUE(cr);
 #endif
 
     fflush(out);
@@ -207,7 +209,7 @@ void print_date_and_time(FILE *fplog, int nodeid, const char *title,
     fprintf(fplog, "%s on rank %d %s\n", title, nodeid, time_string);
 }
 
-void print_start(FILE *fplog, t_commrec *cr,
+void print_start(FILE *fplog, const t_commrec *cr,
                  gmx_walltime_accounting_t walltime_accounting,
                  const char *name)
 {
@@ -274,7 +276,7 @@ static void calc_virial(int start, int homenr, rvec x[], rvec f[],
     }
 }
 
-static void pull_potential_wrapper(t_commrec *cr,
+static void pull_potential_wrapper(const t_commrec *cr,
                                    t_inputrec *ir,
                                    matrix box, rvec x[],
                                    ForceWithVirial *force,
@@ -300,7 +302,7 @@ static void pull_potential_wrapper(t_commrec *cr,
     wallcycle_stop(wcycle, ewcPULLPOT);
 }
 
-static void pme_receive_force_ener(t_commrec       *cr,
+static void pme_receive_force_ener(const t_commrec *cr,
                                    ForceWithVirial *forceWithVirial,
                                    gmx_enerdata_t  *enerd,
                                    gmx_wallcycle_t  wcycle)
@@ -331,7 +333,7 @@ static void pme_receive_force_ener(t_commrec       *cr,
     wallcycle_stop(wcycle, ewcPP_PMEWAITRECVF);
 }
 
-static void print_large_forces(FILE *fp, t_mdatoms *md, t_commrec *cr,
+static void print_large_forces(FILE *fp, t_mdatoms *md, const t_commrec *cr,
                                gmx_int64_t step, real forceTolerance,
                                const rvec *x, const rvec *f)
 {
@@ -362,7 +364,7 @@ static void print_large_forces(FILE *fp, t_mdatoms *md, t_commrec *cr,
     }
 }
 
-static void post_process_forces(t_commrec *cr,
+static void post_process_forces(const t_commrec *cr,
                                 gmx_int64_t step,
                                 t_nrnb *nrnb, gmx_wallcycle_t wcycle,
                                 gmx_localtop_t *top,
@@ -814,7 +816,7 @@ static void checkPotentialEnergyValidity(gmx_int64_t           step,
  */
 static void
 computeSpecialForces(FILE             *fplog,
-                     t_commrec        *cr,
+                     const t_commrec  *cr,
                      t_inputrec       *inputrec,
                      gmx_int64_t       step,
                      double            t,
@@ -1033,7 +1035,7 @@ static inline void launchGpuRollingPruning(const t_commrec          *cr,
     }
 }
 
-static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
+static void do_force_cutsVERLET(FILE *fplog, const t_commrec *cr,
                                 const gmx_multisim_t *ms,
                                 t_inputrec *inputrec,
                                 gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
@@ -1717,7 +1719,7 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
     }
 }
 
-static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
+static void do_force_cutsGROUP(FILE *fplog, const t_commrec *cr,
                                const gmx_multisim_t *ms,
                                t_inputrec *inputrec,
                                gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
@@ -2040,7 +2042,7 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
 
 }
 
-void do_force(FILE *fplog, t_commrec *cr,
+void do_force(FILE *fplog, const t_commrec *cr,
               const gmx_multisim_t *ms,
               t_inputrec *inputrec,
               gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
@@ -2122,7 +2124,7 @@ void do_force(FILE *fplog, t_commrec *cr,
 
 void do_constrain_first(FILE *fplog, gmx_constr_t constr,
                         t_inputrec *ir, t_mdatoms *md,
-                        t_state *state, t_commrec *cr,
+                        t_state *state, const t_commrec *cr,
                         const gmx_multisim_t *ms,
                         t_nrnb *nrnb,
                         t_forcerec *fr, gmx_localtop_t *top)
@@ -2655,7 +2657,7 @@ void put_atoms_in_box_omp(int ePBC, const matrix box, gmx::ArrayRef<gmx::RVec> x
 }
 
 // TODO This can be cleaned up a lot, and move back to runner.cpp
-void finish_run(FILE *fplog, const gmx::MDLogger &mdlog, t_commrec *cr,
+void finish_run(FILE *fplog, const gmx::MDLogger &mdlog, const t_commrec *cr,
                 const t_inputrec *inputrec,
                 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
@@ -2847,7 +2849,7 @@ extern void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, gmx:
 
 
 void init_md(FILE *fplog,
-             t_commrec *cr, gmx::IMDOutputProvider *outputProvider,
+             const t_commrec *cr, gmx::IMDOutputProvider *outputProvider,
              t_inputrec *ir, const gmx_output_env_t *oenv,
              const MdrunOptions &mdrunOptions,
              double *t, double *t0,
index bb28aa0f2e0d1cb5918615b8a8849565520b38e8..d1b1c89102ecc9b68ec1c7c93a7685aec00175a1 100644 (file)
@@ -88,7 +88,7 @@ gmx_global_stat_t global_stat_init(t_inputrec *ir);
 void global_stat_destroy(gmx_global_stat_t gs);
 
 void global_stat(gmx_global_stat_t gs,
-                 t_commrec *cr, gmx_enerdata_t *enerd,
+                 const t_commrec *cr, gmx_enerdata_t *enerd,
                  tensor fvir, tensor svir, rvec mu_tot,
                  t_inputrec *inputrec,
                  gmx_ekindata_t *ekind,
@@ -104,7 +104,7 @@ int do_per_step(gmx_int64_t step, gmx_int64_t nstep);
 /* ROUTINES from sim_util.c */
 
 void print_time(FILE *out, gmx_walltime_accounting_t walltime_accounting,
-                gmx_int64_t step, t_inputrec *ir, t_commrec *cr);
+                gmx_int64_t step, t_inputrec *ir, const t_commrec *cr);
 
 /*! \brief Print date, time, MPI rank and a description of this point
  * in time.
@@ -117,11 +117,11 @@ void print_time(FILE *out, gmx_walltime_accounting_t walltime_accounting,
 void print_date_and_time(FILE *log, int rank, const char *title,
                          double the_time);
 
-void print_start(FILE *fplog, t_commrec *cr,
+void print_start(FILE *fplog, const t_commrec *cr,
                  gmx_walltime_accounting_t walltime_accounting,
                  const char *name);
 
-void finish_run(FILE *log, const gmx::MDLogger &mdlog, t_commrec *cr,
+void finish_run(FILE *log, const gmx::MDLogger &mdlog, const t_commrec *cr,
                 const t_inputrec *inputrec,
                 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
@@ -139,13 +139,13 @@ void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, gmx::ArrayR
 
 void do_constrain_first(FILE *log, gmx_constr *constr,
                         t_inputrec *inputrec, t_mdatoms *md,
-                        t_state *state, t_commrec *cr,
+                        t_state *state, const t_commrec *cr,
                         const gmx_multisim_t *ms,
                         t_nrnb *nrnb,
                         t_forcerec *fr, gmx_localtop_t *top);
 
 void init_md(FILE *fplog,
-             t_commrec *cr, gmx::IMDOutputProvider *outputProvider,
+             const t_commrec *cr, gmx::IMDOutputProvider *outputProvider,
              t_inputrec *ir, const gmx_output_env_t *oenv,
              const MdrunOptions &mdrunOptions,
              double *t, double *t0,
index 0db91f37e4645b6d98b402a4172a4745336391bd..f08c6c5197612f833aa62a89a2048b85f6ba2beb 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, 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.
@@ -137,7 +137,7 @@ static int filter_enerdterm(real *afrom, gmx_bool bToBuffer, real *ato,
 }
 
 void global_stat(gmx_global_stat_t gs,
-                 t_commrec *cr, gmx_enerdata_t *enerd,
+                 const t_commrec *cr, gmx_enerdata_t *enerd,
                  tensor fvir, tensor svir, rvec mu_tot,
                  t_inputrec *inputrec,
                  gmx_ekindata_t *ekind, gmx_constr_t constr,
index be43b87605133582a7345bdec9608b6098a30303..c1982a7012d3d5d1f03b34f448177d0a884ecddc 100644 (file)
@@ -1344,7 +1344,7 @@ void update_ekinstate(ekinstate_t *ekinstate, gmx_ekindata_t *ekind)
 
 }
 
-void restore_ekinstate_from_state(t_commrec *cr,
+void restore_ekinstate_from_state(const t_commrec *cr,
                                   gmx_ekindata_t *ekind, const ekinstate_t *ekinstate)
 {
     int i, n;
@@ -1556,7 +1556,7 @@ void update_pcouple_before_coordinates(FILE             *fplog,
 void update_constraints(FILE                          *fplog,
                         gmx_int64_t                    step,
                         real                          *dvdlambda, /* the contribution to be added to the bonded interactions */
-                        t_inputrec                    *inputrec,  /* input record and box stuff        */
+                        const t_inputrec              *inputrec,  /* input record and box stuff        */
                         t_mdatoms                     *md,
                         t_state                       *state,
                         gmx_bool                       bMolPBC,
@@ -1564,7 +1564,7 @@ void update_constraints(FILE                          *fplog,
                         gmx::PaddedArrayRef<gmx::RVec> force,     /* forces on home particles */
                         t_idef                        *idef,
                         tensor                         vir_part,
-                        t_commrec                     *cr,
+                        const t_commrec               *cr,
                         const gmx_multisim_t          *ms,
                         t_nrnb                        *nrnb,
                         gmx_wallcycle_t                wcycle,
@@ -1899,7 +1899,7 @@ void update_coords(FILE                          *fplog,
                    matrix                         M,
                    gmx_update_t                  *upd,
                    int                            UpdatePart,
-                   t_commrec                     *cr, /* these shouldn't be here -- need to think about it */
+                   const t_commrec               *cr, /* these shouldn't be here -- need to think about it */
                    gmx_constr_t                   constr)
 {
     gmx_bool bDoConstr = (nullptr != constr);
index d29ec47f52f0088ac66654580fc4fb10c2155166..4bdd6f5ae18010c5e26cc97b2ace7de9a88cd483 100644 (file)
@@ -126,7 +126,7 @@ void update_coords(FILE                          *fplog,
                    matrix                         M,
                    gmx_update_t                  *upd,
                    int                            bUpdatePart,
-                   t_commrec                     *cr, /* these shouldn't be here -- need to think about it */
+                   const 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 */
@@ -136,7 +136,7 @@ extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, co
 void update_constraints(FILE                    *fplog,
                         gmx_int64_t              step,
                         real                    *dvdlambda, /* FEP stuff */
-                        t_inputrec              *inputrec,  /* input record and box stuff      */
+                        const t_inputrec        *inputrec,  /* input record and box stuff      */
                         t_mdatoms               *md,
                         t_state                 *state,
                         gmx_bool                 bMolPBC,
@@ -144,7 +144,7 @@ void update_constraints(FILE                    *fplog,
                         gmx::ArrayRef<gmx::RVec> force, /* forces on home particles */
                         t_idef                  *idef,
                         tensor                   vir_part,
-                        t_commrec               *cr,
+                        const t_commrec         *cr,
                         const gmx_multisim_t    *ms,
                         t_nrnb                  *nrnb,
                         gmx_wallcycle_t          wcycle,
@@ -183,7 +183,7 @@ update_ekinstate(ekinstate_t *ekinstate, gmx_ekindata_t *ekind);
 /*! \brief Restores data from \p ekinstate to \p ekind, then broadcasts it
    to the rest of the simulation */
 void
-restore_ekinstate_from_state(t_commrec *cr,
+restore_ekinstate_from_state(const t_commrec *cr,
                              gmx_ekindata_t *ekind, const ekinstate_t *ekinstate);
 
 void berendsen_tcoupl(const t_inputrec *ir, const gmx_ekindata_t *ekind, real dt,
index 38fd2e8ef6535d00df0542a7047b70ed7806b2dd..45903d0172c0c444e0e63431dfa34b48ee270b9d 100644 (file)
@@ -633,7 +633,7 @@ void construct_vsites(const gmx_vsite_t *vsite,
                       real dt, rvec *v,
                       const t_iparams ip[], const t_ilist ilist[],
                       int ePBC, gmx_bool bMolPBC,
-                      t_commrec *cr,
+                      const t_commrec *cr,
                       const matrix box)
 {
     const bool useDomdec = (vsite != nullptr && vsite->useDomdec);
@@ -1617,7 +1617,7 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
                     gmx_bool VirCorr, matrix vir,
                     t_nrnb *nrnb, const t_idef *idef,
                     int ePBC, gmx_bool bMolPBC, const t_graph *g, const matrix box,
-                    t_commrec *cr, gmx_wallcycle *wcycle)
+                    const t_commrec *cr, gmx_wallcycle *wcycle)
 {
     wallcycle_start(wcycle, ewcVSITESPREAD);
     const bool useDomdec = vsite->useDomdec;
@@ -2016,7 +2016,7 @@ static int **get_vsite_pbc(const t_iparams *iparams, const t_ilist *ilist,
 
 
 gmx_vsite_t *initVsite(const gmx_mtop_t &mtop,
-                       t_commrec        *cr)
+                       const t_commrec  *cr)
 {
     GMX_RELEASE_ASSERT(cr != nullptr, "We need a valid commrec");
 
index ae84408b81d59602615f1069ebe2b22c84fc6d87..8b1d2132f85ad2b8668da787c7e4b294a948b9bb 100644 (file)
@@ -86,7 +86,7 @@ void construct_vsites(const gmx_vsite_t *vsite,
                       real dt, rvec v[],
                       const t_iparams ip[], const t_ilist ilist[],
                       int ePBC, gmx_bool bMolPBC,
-                      t_commrec *cr,
+                      const t_commrec *cr,
                       const matrix box);
 
 /*! \brief Create positions of vsite atoms for the whole system assuming all molecules are wholex
@@ -103,7 +103,7 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
                     gmx_bool VirCorr, matrix vir,
                     t_nrnb *nrnb, const t_idef *idef,
                     int ePBC, gmx_bool bMolPBC, const t_graph *g, const matrix box,
-                    t_commrec *cr, gmx_wallcycle *wcycle);
+                    const t_commrec *cr, gmx_wallcycle *wcycle);
 /* Spread the force operating on the vsite atoms on the surrounding atoms.
  * If fshift!=NULL also update the shift forces.
  * If VirCorr=TRUE add the virial correction for non-linear vsite constructs
@@ -122,7 +122,7 @@ int count_intercg_vsites(const gmx_mtop_t *mtop);
  * \returns A valid vsite struct or nullptr when there are no virtual sites
  */
 gmx_vsite_t *initVsite(const gmx_mtop_t &mtop,
-                       t_commrec        *cr);
+                       const t_commrec  *cr);
 
 void split_vsites_over_threads(const t_ilist   *ilist,
                                const t_iparams *ip,
index b9851082b2e6de2083da37e685ccf4775d50af33..37c1ae4af5f9355e637d286905ac1efb2396c3cd 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,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.
@@ -138,7 +138,7 @@ static void write_nblist(FILE *out, gmx_domdec_t *dd, t_nblist *nblist, int nDNL
 
 
 
-void dump_nblist(FILE *out, t_commrec *cr, t_forcerec *fr, int nDNL)
+void dump_nblist(FILE *out, const t_commrec *cr, t_forcerec *fr, int nDNL)
 {
     int  n, i;
 
index b7b1189747c726a46b8f9f9f39b5a375e8c6fb3b..c24d9018db46eb9cfde4f065d4b90756cb699e82 100644 (file)
@@ -1710,7 +1710,7 @@ static void do_pull_pot_coord(struct pull_t *pull, int coord_ind, t_pbc *pbc,
 }
 
 real pull_potential(struct pull_t *pull, t_mdatoms *md, t_pbc *pbc,
-                    t_commrec *cr, double t, real lambda,
+                    const t_commrec *cr, double t, real lambda,
                     rvec *x, gmx::ForceWithVirial *force, real *dvdlambda)
 {
     real V = 0;
@@ -1766,7 +1766,7 @@ real pull_potential(struct pull_t *pull, t_mdatoms *md, t_pbc *pbc,
 }
 
 void pull_constraint(struct pull_t *pull, t_mdatoms *md, t_pbc *pbc,
-                     t_commrec *cr, double dt, double t,
+                     const t_commrec *cr, double dt, double t,
                      rvec *x, rvec *xp, rvec *v, tensor vir)
 {
     assert(pull != NULL);
@@ -1817,7 +1817,7 @@ static void make_local_pull_group(gmx_ga2la_t *ga2la,
     }
 }
 
-void dd_make_local_pull_groups(t_commrec *cr, struct pull_t *pull, t_mdatoms *md)
+void dd_make_local_pull_groups(const t_commrec *cr, struct pull_t *pull, t_mdatoms *md)
 {
     gmx_domdec_t   *dd;
     pull_comm_t    *comm;
@@ -1941,7 +1941,7 @@ void dd_make_local_pull_groups(t_commrec *cr, struct pull_t *pull, t_mdatoms *md
     pull->bSetPBCatoms = TRUE;
 }
 
-static void init_pull_group_index(FILE *fplog, t_commrec *cr,
+static void init_pull_group_index(FILE *fplog, const t_commrec *cr,
                                   int g, pull_group_work_t *pg,
                                   gmx_bool bConstraint, ivec pulldim_con,
                                   const gmx_mtop_t *mtop,
@@ -2117,7 +2117,7 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
 struct pull_t *
 init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
           int nfile, const t_filenm fnm[],
-          const gmx_mtop_t *mtop, t_commrec *cr,
+          const gmx_mtop_t *mtop, const t_commrec *cr,
           const gmx_output_env_t *oenv, real lambda,
           gmx_bool bOutFile,
           const ContinuationOptions &continuationOptions)
index 900d92e58055ae4acdc45b6f7851ed25643383ad..73bb40586289b59d68963521ad4227e44a9db5dd 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, 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.
@@ -185,7 +185,7 @@ void clear_pull_forces(struct pull_t *pull);
  * \returns The pull potential energy.
  */
 real pull_potential(struct pull_t *pull, t_mdatoms *md, struct t_pbc *pbc,
-                    t_commrec *cr, double t, real lambda,
+                    const t_commrec *cr, double t, real lambda,
                     rvec *x, gmx::ForceWithVirial *force, real *dvdlambda);
 
 
@@ -204,7 +204,7 @@ real pull_potential(struct pull_t *pull, t_mdatoms *md, struct t_pbc *pbc,
  * \param[in,out] vir    The virial, which, if != NULL, gets a pull correction.
  */
 void pull_constraint(struct pull_t *pull, t_mdatoms *md, struct t_pbc *pbc,
-                     t_commrec *cr, double dt, double t,
+                     const t_commrec *cr, double dt, double t,
                      rvec *x, rvec *xp, rvec *v, tensor vir);
 
 
@@ -215,7 +215,7 @@ void pull_constraint(struct pull_t *pull, t_mdatoms *md, struct t_pbc *pbc,
  * \param pull           The pull group.
  * \param md             All atoms.
  */
-void dd_make_local_pull_groups(t_commrec *cr,
+void dd_make_local_pull_groups(const t_commrec *cr,
                                struct pull_t *pull, t_mdatoms *md);
 
 
@@ -239,7 +239,7 @@ struct pull_t *init_pull(FILE                      *fplog,
                          int                        nfile,
                          const t_filenm             fnm[],
                          const gmx_mtop_t          *mtop,
-                         t_commrec                * cr,
+                         const t_commrec           *cr,
                          const gmx_output_env_t    *oenv,
                          real                       lambda,
                          gmx_bool                   bOutFile,
@@ -273,7 +273,7 @@ void pull_print_output(struct pull_t *pull, gmx_int64_t step, double time);
  * \param[in,out] xp   Updated x, can be NULL.
  *
  */
-void pull_calc_coms(t_commrec        *cr,
+void pull_calc_coms(const t_commrec  *cr,
                     struct pull_t    *pull,
                     t_mdatoms        *md,
                     struct t_pbc     *pbc,
index 2f90fc5b4ecb22b7b36ff77768138e73d8d5d6d4..429290d71939cb5bfb36f18be6f5073ca555c0f1 100644 (file)
@@ -332,7 +332,7 @@ static inline gmx_bool bSlabTau(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
 }
 
 /* Output rotation energy, torques, etc. for each rotation group */
-static void reduce_output(t_commrec *cr, t_rot *rot, real t, gmx_int64_t step)
+static void reduce_output(const t_commrec *cr, t_rot *rot, real t, gmx_int64_t step)
 {
     int             g, i, islab, nslabs = 0;
     int             count; /* MPI element counter                               */
@@ -491,7 +491,7 @@ static void reduce_output(t_commrec *cr, t_rot *rot, real t, gmx_int64_t step)
 
 /* Add the forces from enforced rotation potential to the local forces.
  * Should be called after the SR forces have been evaluated */
-extern real add_rot_forces(t_rot *rot, rvec f[], t_commrec *cr, gmx_int64_t step, real t)
+extern real add_rot_forces(t_rot *rot, rvec f[], const t_commrec *cr, gmx_int64_t step, real t)
 {
     int             g, l, ii;
     t_rotgrp       *rotg;
@@ -3386,7 +3386,7 @@ static inline void copy_correct_pbc_image(
 }
 
 
-static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg,
+static void init_rot_group(FILE *fplog, const t_commrec *cr, int g, t_rotgrp *rotg,
                            rvec *x, gmx_mtop_t *mtop, gmx_bool bVerbose, FILE *out_slabs, const matrix box,
                            t_inputrec *ir, gmx_bool bOutputCenters)
 {
@@ -3659,7 +3659,7 @@ static int calc_mpi_bufsize(t_rot *rot)
 
 
 extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[],
-                     t_commrec *cr, const t_state *globalState, gmx_mtop_t *mtop, const gmx_output_env_t *oenv,
+                     const t_commrec *cr, const t_state *globalState, gmx_mtop_t *mtop, const gmx_output_env_t *oenv,
                      const MdrunOptions &mdrunOptions)
 {
     t_rot          *rot;
@@ -3885,13 +3885,13 @@ static void choose_pbc_image(rvec x[], t_rotgrp *rotg, matrix box, int npbcdim)
 
 
 extern void do_rotation(
-        t_commrec      *cr,
-        t_inputrec     *ir,
-        matrix          box,
-        rvec            x[],
-        real            t,
-        gmx_int64_t     step,
-        gmx_bool        bNS)
+        const t_commrec *cr,
+        t_inputrec      *ir,
+        matrix           box,
+        rvec             x[],
+        real             t,
+        gmx_int64_t      step,
+        gmx_bool         bNS)
 {
     int             g, i, ii;
     t_rot          *rot;
index 5463efb9e46e125a3410b04db7a584ec8e7e66e5..915b04264f000679711e98a36afa8d474d4d875a 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, 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.
@@ -86,7 +86,7 @@ extern "C" {
  * \param mdrunOptions  Options for mdrun.
  */
 extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[],
-                     struct t_commrec *cr, const t_state *globalState, gmx_mtop_t *mtop, const gmx_output_env_t *oenv,
+                     const t_commrec *cr, const t_state *globalState, gmx_mtop_t *mtop, const gmx_output_env_t *oenv,
                      const MdrunOptions &mdrunOptions);
 
 
@@ -116,7 +116,7 @@ extern void dd_make_local_rotation_groups(struct gmx_domdec_t *dd, t_rot *rot);
  * \param bNS     After domain decomposition / neighbor searching several
  *                local arrays have to be updated (masses, shifts)
  */
-extern void do_rotation(struct t_commrec *cr, t_inputrec *ir, matrix box, rvec x[], real t,
+extern void do_rotation(const t_commrec *cr, t_inputrec *ir, matrix box, rvec x[], real t,
                         gmx_int64_t step, gmx_bool bNS);
 
 
@@ -137,7 +137,7 @@ extern void do_rotation(struct t_commrec *cr, t_inputrec *ir, matrix box, rvec x
  * \param t       Time, used for output.
  * \returns       The potential energy of the rotation potentials.
  */
-extern real add_rot_forces(t_rot *rot, rvec f[], struct t_commrec *cr, gmx_int64_t step, real t);
+extern real add_rot_forces(t_rot *rot, rvec f[], const t_commrec *cr, gmx_int64_t step, real t);
 
 
 /*! \brief Close the enforced rotation output files.
index 0c62ff647fede330a2c2457742972a1557395f49..c228846e164181872159be5d70fab0fbfc73c1d7 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, 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/real.h"
 #include "gromacs/utility/smalloc.h"
 
-static void pull_reduce_real(t_commrec   *cr,
-                             pull_comm_t *comm,
-                             int          n,
-                             real        *data)
+static void pull_reduce_real(const t_commrec *cr,
+                             pull_comm_t     *comm,
+                             int              n,
+                             real            *data)
 {
     if (cr != nullptr && PAR(cr))
     {
@@ -100,10 +100,10 @@ static void pull_reduce_real(t_commrec   *cr,
     }
 }
 
-static void pull_reduce_double(t_commrec   *cr,
-                               pull_comm_t *comm,
-                               int          n,
-                               double      *data)
+static void pull_reduce_double(const t_commrec *cr,
+                               pull_comm_t     *comm,
+                               int              n,
+                               double          *data)
 {
     if (cr != nullptr && PAR(cr))
     {
@@ -140,7 +140,7 @@ static void pull_reduce_double(t_commrec   *cr,
     }
 }
 
-static void pull_set_pbcatom(t_commrec *cr, pull_group_work_t *pgrp,
+static void pull_set_pbcatom(const t_commrec *cr, pull_group_work_t *pgrp,
                              rvec *x,
                              rvec x_pbc)
 {
@@ -163,7 +163,7 @@ static void pull_set_pbcatom(t_commrec *cr, pull_group_work_t *pgrp,
     }
 }
 
-static void pull_set_pbcatoms(t_commrec *cr, struct pull_t *pull,
+static void pull_set_pbcatoms(const t_commrec *cr, struct pull_t *pull,
                               rvec *x,
                               rvec *x_pbc)
 {
@@ -193,7 +193,7 @@ static void pull_set_pbcatoms(t_commrec *cr, struct pull_t *pull,
     }
 }
 
-static void make_cyl_refgrps(t_commrec *cr, struct pull_t *pull, t_mdatoms *md,
+static void make_cyl_refgrps(const t_commrec *cr, struct pull_t *pull, t_mdatoms *md,
                              t_pbc *pbc, double t, rvec *x)
 {
     /* The size and stride per coord for the reduction buffer */
@@ -549,7 +549,7 @@ static void sum_com_part_cosweight(const pull_group_work_t *pgrp,
 }
 
 /* calculates center of mass of selection index from all coordinates x */
-void pull_calc_coms(t_commrec *cr,
+void pull_calc_coms(const t_commrec *cr,
                     struct pull_t *pull, t_mdatoms *md, t_pbc *pbc, double t,
                     rvec x[], rvec *xp)
 {
index 914eb6284da9ed5b21f4b28ecb1fe67a1192379b..1564711566090a6127db83489ed6c13bf761374b 100644 (file)
@@ -497,7 +497,7 @@ void wallcycle_scale_by_num_threads(gmx_wallcycle_t wc, bool isPmeRank, int nthr
  * wcc_all are unused by the GPU reporting, but it is not satisfactory
  * for the future. Also, there's no need for MPI_Allreduce, since
  * only MASTERRANK uses any of the results. */
-WallcycleCounts wallcycle_sum(t_commrec *cr, gmx_wallcycle_t wc)
+WallcycleCounts wallcycle_sum(const t_commrec *cr, gmx_wallcycle_t wc)
 {
     WallcycleCounts cycles_sum;
     wallcc_t       *wcc;
index 632ea53d29b385bccf80af4906444c3db885c00d..cffbb8e61ac3a8ced7c1381004bfb6ae38699b89 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, 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,7 +60,7 @@ struct gmx_wallclock_gpu_pme_t;
 typedef std::array<double, ewcNR+ewcsNR> WallcycleCounts;
 /* Convenience typedef */
 
-WallcycleCounts wallcycle_sum(struct t_commrec *cr, gmx_wallcycle_t wc);
+WallcycleCounts wallcycle_sum(const t_commrec *cr, gmx_wallcycle_t wc);
 /* Return a vector of the sum of cycle counts over the nodes in
    cr->mpi_comm_mysim. */