4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * GRowing Old MAkes el Chrono Sweat
29 static char *SRCID_mdrun_c
= "$Id$";
42 int main(int argc
,char *argv
[])
44 static char *desc
[] = {
45 "The mdrun program performs Molecular Dynamics simulations.",
46 "It reads the run input file ([TT]-s[tt]) and distributes the",
47 "topology over processors if needed. The coordinates are passed",
48 "around, so that computations can begin.",
49 "First a neighborlist is made, then the forces are computed.",
50 "The forces are globally summed, and the velocities and",
51 "positions are updated. If necessary shake is performed to constrain",
52 "bond lengths and/or bond angles.",
53 "Temperature and Pressure can be controlled using weak coupling to a",
55 "mdrun produces at least three output file, plus one log file",
56 "([TT]-g[tt]) per processor.",
57 "The trajectory file ([TT]-o[tt]), contains coordinates, velocities and",
59 "The structure file ([TT]-c[tt]) contains the coordinates and",
60 "velocities of the last step.",
61 "The energy file ([TT]-e[tt]) contains energies, the temperature,",
62 "pressure, etc, a lot of these things are also printed in the log file",
64 "Optionally coordinates can be written to a compressed trajectory file",
66 "When running in parallel with PVM or an old version of MPI the",
67 "[TT]-np[tt] option must be given to indicate the number of",
69 "The option [TT]-dgdl[tt] is only used when free energy perturbation is",
71 "With [TT]-rerun[tt] an input trajectory can be given for which ",
72 "forces and energies will be (re)calculated.[PAR]",
73 "ED (essential dynamics) sampling is switched on by using the [TT]-ei[tt]",
74 "flag followed by an [TT].edi[tt] file.",
75 "The [TT].edi[tt] file can be produced using options in the essdyn",
76 "menu of the WHAT IF program. mdrun produces a [TT].edo[tt] file that",
77 "contains projections of positions, velocities and forces onto selected",
79 "The options [TT]-pi[tt], [TT]-po[tt], [TT]-pd[tt], [TT]-pn[tt] are used",
80 "for potential of mean force calculations and umbrella sampling.",
82 "When mdrun receives a TERM signal it will set nsteps to the current",
83 "step plus one, which causes the run to end after one step and write",
84 "all the usual output.",
85 "When running with MPI, a TERM signal to one of the mdrun processes",
86 "is sufficient, this signal should not be sent to mpirun or",
87 "the mdrun process that is the parent of the others."
91 static t_filenm fnm
[] = {
92 { efTPX
, NULL
, NULL
, ffREAD
},
93 { efTRN
, "-o", NULL
, ffWRITE
},
94 { efXTC
, "-x", NULL
, ffOPTWR
},
95 { efSTO
, "-c", "confout", ffWRITE
},
96 { efENX
, "-e", "ener", ffWRITE
},
97 { efLOG
, "-g", "md", ffWRITE
},
98 { efXVG
, "-dgdl", "dgdl", ffOPTWR
},
99 { efTRX
, "-rerun", "rerun", ffOPTRD
},
100 /* function "optRerunMDset" (in runner.c) checks if -rerun is specified */
101 /* { efHAT, "-hat","ghat", ffOPTRD }, currently useless */
102 { efEDI
, "-ei", "sam", ffOPTRD
},
103 { efEDO
, "-eo", "sam", ffOPTWR
},
104 { efPPA
, "-pi", "pull", ffOPTRD
},
105 { efPPA
, "-po", "pullout", ffOPTWR
},
106 { efPDO
, "-pd", "pull", ffOPTWR
},
107 { efNDX
, "-pn", "pull", ffOPTRD
},
109 #define NFILE asize(fnm)
111 /* Command line options ! */
112 static bool bVerbose
=FALSE
,bCompact
=TRUE
;
116 static int nDLB
=0,nstepout
=10;
117 static t_pargs pa
[] = {
119 { "-np", FALSE
, etINT
, {&nprocs
},
120 "Number of processors, must be the same as used for grompp" },
122 { "-v", FALSE
, etBOOL
,{&bVerbose
}, "Be loud and noisy" },
123 { "-compact", FALSE
, etBOOL
,{&bCompact
}, "Write a compact log file" },
124 { "-dlb", FALSE
, etINT
, {&nDLB
},
125 "HIDDENUse dynamic load balancing every ... step. BUGGY do not use" },
126 { "-stepout", FALSE
, etINT
, {&nstepout
},
127 "HIDDENFrequency of writing the remaining runtime" }
131 cr
= init_par(&argc
,&argv
);
132 bVerbose
= bVerbose
&& MASTER(cr
);
136 CopyRight(stderr
,argv
[0]);
138 parse_common_args(&argc
,argv
,
139 PCA_KEEP_ARGS
| PCA_NOEXIT_ON_ARGS
| PCA_SET_NPRI
|
140 PCA_CAN_SET_DEFFNM
| (MASTER(cr
) ? 0 : PCA_QUIET
),
141 TRUE
,NFILE
,fnm
,asize(pa
),pa
,asize(desc
),desc
,0,NULL
);
143 open_log(ftp2fn(efLOG
,NFILE
,fnm
),cr
);
146 CopyRight(stdlog
,argv
[0]);
147 please_cite(stdlog
,"Berendsen95a");
150 if (opt2bSet("-ei",NFILE
,fnm
))
151 ed_open(NFILE
,fnm
,&edyn
);
153 mdrunner(cr
,NFILE
,fnm
,bVerbose
,bCompact
,nDLB
,FALSE
,nstepout
,&edyn
);