Also removed some pointless struct keywords.
Refs #2423
Change-Id: Iacc008fb11a31646e798364e253de322c16ccaee
}
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];
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;
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;
}
}
-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;
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))
{
}
-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;
}
}
-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;
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];
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;
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,
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);
*/
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,
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 */
*/
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);
/* 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);
/*! \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;
/*! \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;
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)
}
}
-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)
/* 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;
/* 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];
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 */
/* 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[],
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;
/* 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 */
/* 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;
/* 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;
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,
void do_edsam(const t_inputrec *ir,
gmx_int64_t step,
- t_commrec *cr,
+ const t_commrec *cr,
rvec xs[],
rvec v[],
matrix box,
*
* 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.
* \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.
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,
* \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
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)
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)
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);
*
* 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
*
* 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.
* 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,
* 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,
* 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,
}
/*! \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
};
/*! \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>();
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)
}
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)
}
/*! \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,
}
}
-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,
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)
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;
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;
}
/*! \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,
}
}
-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,
*
* 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.
}
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;
/*
* 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.
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
}
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,
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,
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,
/*! \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);
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,
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,
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,
* 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,
/*! \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;
/*! \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;
/*! \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))
{
}
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,
}
-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;
}
-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;
* \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[],
*
* \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);
* \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);
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];
}
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];
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,
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;
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) +
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,
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,
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
gmx_groups_t *groups,
gmx_localtop_t *top,
t_mdatoms *md,
- t_commrec *cr,
+ const t_commrec *cr,
t_nrnb *nrnb,
gmx_bool bFillGrid)
{
}
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,
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.
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,
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 */
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,
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;
*
* 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.
* 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;
/* 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;
*
* 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.
* \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,
* \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);
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,
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;
}
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,
/* 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,
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,
/*
* 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.
* 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,
/*
* 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.
* 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,
* \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,
//! 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)
}
//! 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)
{
}
//! 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)
{
//! 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,
}
//! 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)
{
}
//! 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,
//! \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,
}
//! 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,
}
//! 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)
{
}
//! 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)
{
}
}
-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,
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)
{
*
* 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.
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. */
*
* 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.
/* 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,
} /* 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)
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)
*/
} /* 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
}
} /* 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,
} /* 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;
*
* 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.
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
* 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,
* 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
*
* 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.
return index;
}
-void sum_bin(t_bin *b, t_commrec *cr)
+void sum_bin(t_bin *b, const t_commrec *cr)
{
int i;
*
* 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.
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[]);
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;
}
-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];
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,
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,
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,
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];
{
fprintf(out, "\n");
}
+#else
+ GMX_UNUSED_VALUE(cr);
#endif
fflush(out);
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)
{
}
}
-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,
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)
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)
{
}
}
-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,
*/
static void
computeSpecialForces(FILE *fplog,
- t_commrec *cr,
+ const t_commrec *cr,
t_inputrec *inputrec,
gmx_int64_t step,
double t,
}
}
-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,
}
}
-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,
}
-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,
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)
}
// 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,
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,
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,
/* 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.
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,
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,
*
* 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.
}
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,
}
-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;
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,
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,
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);
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 */
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,
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,
/*! \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,
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);
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;
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");
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
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
* \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,
*
* 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.
-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;
}
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;
}
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);
}
}
-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;
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,
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)
*
* 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.
* \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);
* \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);
* \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);
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,
* \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,
}
/* 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 */
/* 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;
}
-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)
{
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;
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;
*
* 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.
* \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);
* \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);
* \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.
*
* 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))
{
}
}
-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))
{
}
}
-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)
{
}
}
-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)
{
}
}
-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 */
}
/* 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)
{
* 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;
*
* 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.
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. */