2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team,
6 * check out http://www.gromacs.org for more information.
7 * Copyright (c) 2012,2013, by the GROMACS development team, led by
8 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9 * others, as listed in the AUTHORS file in the top-level source
10 * directory and at http://www.gromacs.org.
12 * GROMACS is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public License
14 * as published by the Free Software Foundation; either version 2.1
15 * of the License, or (at your option) any later version.
17 * GROMACS is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with GROMACS; if not, see
24 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * If you want to redistribute modifications to GROMACS, please
28 * consider that scientific software is very special. Version
29 * control is crucial - bugs must be traceable. We will be happy to
30 * consider code for inclusion in the official distribution, but
31 * derived work must not be called official GROMACS. Details are found
32 * in the README & COPYING files - if they are missing, get the
33 * official version at http://www.gromacs.org.
35 * To help us fund GROMACS development, we humbly ask that you cite
36 * the research papers on the package. Check out http://www.gromacs.org.
43 #include "visibility.h"
60 gmx_bool bKeepAndNumCPT
;
69 typedef struct gmx_global_stat
*gmx_global_stat_t
;
82 gmx_large_int_t nsteps_done
;
87 void do_pbc_first(FILE *log
, matrix box
, t_forcerec
*fr
,
88 t_graph
*graph
, rvec x
[]);
91 void do_pbc_first_mtop(FILE *fplog
, int ePBC
, matrix box
,
92 gmx_mtop_t
*mtop
, rvec x
[]);
95 void do_pbc_mtop(FILE *fplog
, int ePBC
, matrix box
,
96 gmx_mtop_t
*mtop
, rvec x
[]);
100 /* ROUTINES from stat.c */
102 gmx_global_stat_t
global_stat_init(t_inputrec
*ir
);
104 void global_stat_destroy(gmx_global_stat_t gs
);
106 void global_stat(FILE *log
, gmx_global_stat_t gs
,
107 t_commrec
*cr
, gmx_enerdata_t
*enerd
,
108 tensor fvir
, tensor svir
, rvec mu_tot
,
109 t_inputrec
*inputrec
,
110 gmx_ekindata_t
*ekind
,
111 gmx_constr_t constr
, t_vcm
*vcm
,
113 gmx_mtop_t
*top_global
, t_state
*state_local
,
114 gmx_bool bSumEkinhOld
, int flags
);
115 /* Communicate statistics over cr->mpi_comm_mysim */
117 gmx_mdoutf_t
*init_mdoutf(int nfile
, const t_filenm fnm
[],
119 const t_commrec
*cr
, const t_inputrec
*ir
,
120 const output_env_t oenv
);
121 /* Returns a pointer to a data structure with all output file pointers
122 * and names required by mdrun.
126 void done_mdoutf(gmx_mdoutf_t
*of
);
127 /* Close all open output files and free the of pointer */
129 #define MDOF_X (1<<0)
130 #define MDOF_V (1<<1)
131 #define MDOF_F (1<<2)
132 #define MDOF_XTC (1<<3)
133 #define MDOF_CPT (1<<4)
136 void write_traj(FILE *fplog
, t_commrec
*cr
,
139 gmx_mtop_t
*top_global
,
140 gmx_large_int_t step
, double t
,
141 t_state
*state_local
, t_state
*state_global
,
142 rvec
*f_local
, rvec
*f_global
,
143 int *n_xtc
, rvec
**x_xtc
);
144 /* Routine that writes frames to trn, xtc and/or checkpoint.
145 * What is written is determined by the mdof_flags defined above.
146 * Data is collected to the master node only when necessary.
150 int do_per_step(gmx_large_int_t step
, gmx_large_int_t nstep
);
151 /* Return TRUE if io should be done */
153 /* ROUTINES from sim_util.c */
156 double gmx_gettime();
159 void print_time(FILE *out
, gmx_runtime_t
*runtime
,
160 gmx_large_int_t step
, t_inputrec
*ir
, t_commrec
*cr
);
163 void runtime_start(gmx_runtime_t
*runtime
);
166 void runtime_end(gmx_runtime_t
*runtime
);
169 void runtime_upd_proc(gmx_runtime_t
*runtime
);
170 /* The processor time should be updated every once in a while,
171 * since on 32-bit manchines it loops after 72 minutes.
175 void print_date_and_time(FILE *log
, int pid
, const char *title
,
176 const gmx_runtime_t
*runtime
);
179 void finish_run(FILE *log
, t_commrec
*cr
, const char *confout
,
180 t_inputrec
*inputrec
,
181 t_nrnb nrnb
[], gmx_wallcycle_t wcycle
,
182 gmx_runtime_t
*runtime
,
183 wallclock_gpu_t
*gputimes
,
185 gmx_bool bWriteStat
);
187 void calc_enervirdiff(FILE *fplog
, int eDispCorr
, t_forcerec
*fr
);
189 void calc_dispcorr(FILE *fplog
, t_inputrec
*ir
, t_forcerec
*fr
,
190 gmx_large_int_t step
, int natoms
,
191 matrix box
, real lambda
, tensor pres
, tensor virial
,
192 real
*prescorr
, real
*enercorr
, real
*dvdlcorr
);
194 void initialize_lambdas(FILE *fplog
, t_inputrec
*ir
, int *fep_state
, real
*lambda
, double *lam0
);
197 void do_constrain_first(FILE *log
, gmx_constr_t constr
,
198 t_inputrec
*inputrec
, t_mdatoms
*md
,
199 t_state
*state
, rvec
*f
,
200 t_graph
*graph
, t_commrec
*cr
, t_nrnb
*nrnb
,
201 t_forcerec
*fr
, gmx_localtop_t
*top
, tensor shake_vir
);
204 void init_md(FILE *fplog
,
205 t_commrec
*cr
, t_inputrec
*ir
, const output_env_t oenv
,
206 double *t
, double *t0
,
207 real
*lambda
, int *fep_state
, double *lam0
,
208 t_nrnb
*nrnb
, gmx_mtop_t
*mtop
,
210 int nfile
, const t_filenm fnm
[],
211 gmx_mdoutf_t
**outf
, t_mdebin
**mdebin
,
212 tensor force_vir
, tensor shake_vir
,
214 gmx_bool
*bSimAnn
, t_vcm
**vcm
,
215 t_state
*state
, unsigned long Flags
);
216 /* Routine in sim_util.c */
222 #endif /* _sim_util_h */