3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
33 * Gromacs Runs On Most of All Computer Systems
56 gmx_bool bKeepAndNumCPT;
65 typedef struct gmx_global_stat *gmx_global_stat_t;
67 /*! /brief Manages measuring wall clock times for simulations */
69 double start_time_stamp; //!< Seconds since the epoch recorded at the start of the simulation
70 double start_time_stamp_per_thread; //!< Seconds since the epoch recorded at the start of the simulation for this thread
71 double elapsed_run_time; //!< Total seconds elapsed over the simulation
72 double elapsed_run_time_per_thread; //!< Total seconds elapsed over the simulation running this thread
73 gmx_large_int_t nsteps_done; //!< Used by integrators to report the amount of work they did
77 void do_pbc_first(FILE *log, matrix box, t_forcerec *fr,
78 t_graph *graph, rvec x[]);
80 void do_pbc_first_mtop(FILE *fplog, int ePBC, matrix box,
81 gmx_mtop_t *mtop, rvec x[]);
83 void do_pbc_mtop(FILE *fplog, int ePBC, matrix box,
84 gmx_mtop_t *mtop, rvec x[]);
88 /* ROUTINES from stat.c */
89 gmx_global_stat_t global_stat_init(t_inputrec *ir);
91 void global_stat_destroy(gmx_global_stat_t gs);
93 void global_stat(FILE *log, gmx_global_stat_t gs,
94 t_commrec *cr, gmx_enerdata_t *enerd,
95 tensor fvir, tensor svir, rvec mu_tot,
97 gmx_ekindata_t *ekind,
98 gmx_constr_t constr, t_vcm *vcm,
100 gmx_mtop_t *top_global, t_state *state_local,
101 gmx_bool bSumEkinhOld, int flags);
102 /* Communicate statistics over cr->mpi_comm_mysim */
104 gmx_mdoutf_t *init_mdoutf(int nfile, const t_filenm fnm[],
106 const t_commrec *cr, const t_inputrec *ir,
107 const output_env_t oenv);
108 /* Returns a pointer to a data structure with all output file pointers
109 * and names required by mdrun.
112 void done_mdoutf(gmx_mdoutf_t *of);
113 /* Close all open output files and free the of pointer */
115 #define MDOF_X (1<<0)
116 #define MDOF_V (1<<1)
117 #define MDOF_F (1<<2)
118 #define MDOF_XTC (1<<3)
119 #define MDOF_CPT (1<<4)
121 void write_traj(FILE *fplog, t_commrec *cr,
124 gmx_mtop_t *top_global,
125 gmx_large_int_t step, double t,
126 t_state *state_local, t_state *state_global,
127 rvec *f_local, rvec *f_global,
128 int *n_xtc, rvec **x_xtc);
129 /* Routine that writes frames to trn, xtc and/or checkpoint.
130 * What is written is determined by the mdof_flags defined above.
131 * Data is collected to the master node only when necessary.
134 int do_per_step(gmx_large_int_t step, gmx_large_int_t nstep);
135 /* Return TRUE if io should be done */
137 /* ROUTINES from sim_util.c */
139 double gmx_gettime();
141 void print_time(FILE *out, gmx_runtime_t *runtime,
142 gmx_large_int_t step, t_inputrec *ir, t_commrec *cr);
144 void runtime_start(gmx_runtime_t *runtime);
146 void runtime_end(gmx_runtime_t *runtime);
148 double runtime_get_elapsed_time(gmx_runtime_t *runtime);
150 void print_date_and_time(FILE *log, int pid, const char *title,
151 const gmx_runtime_t *runtime);
153 void finish_run(FILE *log, t_commrec *cr,
154 t_inputrec *inputrec,
155 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
156 gmx_runtime_t *runtime,
157 wallclock_gpu_t *gputimes,
158 gmx_bool bWriteStat);
160 void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr);
162 void calc_dispcorr(FILE *fplog, t_inputrec *ir, t_forcerec *fr,
163 gmx_large_int_t step, int natoms,
164 matrix box, real lambda, tensor pres, tensor virial,
165 real *prescorr, real *enercorr, real *dvdlcorr);
167 void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, real *lambda, double *lam0);
169 void do_constrain_first(FILE *log, gmx_constr_t constr,
170 t_inputrec *inputrec, t_mdatoms *md,
171 t_state *state, t_commrec *cr, t_nrnb *nrnb,
172 t_forcerec *fr, gmx_localtop_t *top);
174 void init_md(FILE *fplog,
175 t_commrec *cr, t_inputrec *ir, const output_env_t oenv,
176 double *t, double *t0,
177 real *lambda, int *fep_state, double *lam0,
178 t_nrnb *nrnb, gmx_mtop_t *mtop,
180 int nfile, const t_filenm fnm[],
181 gmx_mdoutf_t **outf, t_mdebin **mdebin,
182 tensor force_vir, tensor shake_vir,
184 gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags);
185 /* Routine in sim_util.c */
191 #endif /* _sim_util_h */