Implement user guide
[alexxy/gromacs.git] / docs / user-guide / environment-variables.md
1
2 # Environment Variables
3
4 GROMACS programs may be influenced by the use of
5 environment variables.  First of all, the variables set in
6 the `GMXRC` file are essential for running and
7 compiling GROMACS. Some other useful environment variables are
8 listed in the following sections. Most environment variables function
9 by being set in your shell to any non-NULL value. Specific
10 requirements are described below if other values need to be set. You
11 should consult the documentation for your shell for instructions on
12 how to set environment variables in the current shell, or in config
13 files for future shells. Note that requirements for exporting
14 environment variables to jobs run under batch control systems vary and
15 you should consult your local documentation for details.
16
17 ## Output Control
18
19 * `GMX_CONSTRAINTVIR`: print constraint virial and force virial energy terms.
20
21 * `GMX_MAXBACKUP`: GROMACS automatically backs up old
22         copies of files when trying to write a new file of the same
23         name, and this variable controls the maximum number of
24         backups that will be made, default 99. If set to 0 it fails to
25         run if any output file already exists. And if set to -1 it
26         overwrites any output file without making a backup.
27
28 * `GMX_NO_QUOTES`: if this is explicitly set, no cool quotes
29         will be printed at the end of a program.
30
31 * `GMX_SUPPRESS_DUMP`: prevent dumping of step files during
32         (for example) blowing up during failure of constraint
33         algorithms.
34
35 * `GMX_TPI_DUMP`: dump all configurations to a [.pdb]
36         file that have an interaction energy less than the value set
37         in this environment variable.
38
39 * `GMX_VIEW_XPM`: `GMX_VIEW_XVG`, `GMX_VIEW_EPS` and `GMX_VIEW_PDB`, commands used to
40         automatically view [.xvg], [.xpm], [.eps]
41         and [.pdb] file types, respectively; they default to `xv`, `xmgrace`,
42         `ghostview` and `rasmol`. Set to empty to disable
43         automatic viewing of a particular file type. The command will
44         be forked off and run in the background at the same priority
45         as the GROMACS tool (which might not be what you want).
46         Be careful not to use a command which blocks the terminal
47         (e.g. `vi`), since multiple instances might be run.
48
49 * `GMX_VIRIAL_TEMPERATURE`: print virial temperature energy term
50
51 * `GMX_LOG_BUFFER`: the size of the buffer for file I/O. When set
52         to 0, all file I/O will be unbuffered and therefore very slow.
53         This can be handy for debugging purposes, because it ensures
54         that all files are always totally up-to-date.
55
56 * `GMX_LOGO_COLOR`: set display color for logo in [gmx view].
57
58 * `GMX_PRINT_LONGFORMAT`: use long float format when printing
59         decimal values.
60
61 * `GMX_COMPELDUMP`: Applies for computational electrophysiology setups
62         only (see reference manual). The initial structure gets dumped to 
63         [.pdb] file, which allows to check whether multimeric channels have 
64         the correct PBC representation. 
65
66 ## Debugging
67
68 * `GMX_PRINT_DEBUG_LINES`: when set, print debugging info on line numbers.
69
70 * `GMX_DD_NST_DUMP`: number of steps that elapse between dumping
71         the current DD to a PDB file (default 0). This only takes effect
72         during domain decomposition, so it should typically be
73         0 (never), 1 (every DD phase) or a multiple of `nstlist`.
74
75 * `GMX_DD_NST_DUMP_GRID`: number of steps that elapse between dumping
76         the current DD grid to a PDB file (default 0). This only takes effect
77         during domain decomposition, so it should typically be
78         0 (never), 1 (every DD phase) or a multiple of `nstlist`.
79
80 * `GMX_DD_DEBUG`: general debugging trigger for every domain
81         decomposition (default 0, meaning off). Currently only checks
82         global-local atom index mapping for consistency.
83
84 * `GMX_DD_NPULSE`: over-ride the number of DD pulses used
85         (default 0, meaning no over-ride). Normally 1 or 2.
86
87 * There are a number of extra environment variables like these
88   that are used in debugging - check the code!
89
90 ## Performance and Run Control
91
92 * `GMX_DO_GALACTIC_DYNAMICS`: planetary simulations are made possible (just for fun) by setting
93         this environment variable, which allows setting `epsilon_r = -1` in the [.mdp]
94         file. Normally, `epsilon_r` must be greater than zero to prevent a fatal error.
95         See [wwwpage] for example input files for a planetary simulation.
96
97 * `GMX_ALLOW_CPT_MISMATCH`: when set, runs will not exit if the
98         ensemble set in the [.tpr] file does not match that of the
99         [.cpt] file.
100
101 * `GMX_CUDA_NB_EWALD_TWINCUT`: force the use of twin-range cutoff kernel even if `rvdw` =
102         `rcoulomb` after PP-PME load balancing. The switch to twin-range kernels is automated,
103         so this variable should be used only for benchmarking.
104
105 * `GMX_CUDA_NB_ANA_EWALD`: force the use of analytical Ewald kernels. Should be used only for benchmarking.
106
107 * `GMX_CUDA_NB_TAB_EWALD`: force the use of tabulated Ewald kernels. Should be used only for benchmarking.
108
109 * `GMX_CUDA_STREAMSYNC`: force the use of cudaStreamSynchronize on ECC-enabled GPUs, which leads
110         to performance loss due to a known CUDA driver bug present in API v5.0 NVIDIA drivers (pre-30x.xx).
111         Cannot be set simultaneously with `GMX_NO_CUDA_STREAMSYNC`.
112
113 * `GMX_CYCLE_ALL`: times all code during runs.  Incompatible with threads.
114
115 * `GMX_CYCLE_BARRIER`: calls MPI_Barrier before each cycle start/stop call.
116
117 * `GMX_DD_ORDER_ZYX`: build domain decomposition cells in the order
118         (z, y, x) rather than the default (x, y, z).
119
120 * `GMX_DD_USE_SENDRECV2`: during constraint and vsite communication, use a pair
121         of `MPI_SendRecv` calls instead of two simultaneous non-blocking calls
122         (default 0, meaning off). Might be faster on some MPI implementations.
123
124 * `GMX_DLB_BASED_ON_FLOPS`: do domain-decomposition dynamic load balancing based on flop count rather than
125         measured time elapsed (default 0, meaning off).
126         This makes the load balancing reproducible, which can be useful for debugging purposes.
127         A value of 1 uses the flops; a value > 1 adds (value - 1)*5% of noise to the flops to increase the imbalance and the scaling.
128
129 * `GMX_DLB_MAX_BOX_SCALING`: maximum percentage box scaling permitted per domain-decomposition
130         load-balancing step (default 10)
131
132 * `GMX_DD_RECORD_LOAD`: record DD load statistics for reporting at end of the run (default 1, meaning on)
133
134 * `GMX_DD_NST_SORT_CHARGE_GROUPS`: number of steps that elapse between re-sorting of the charge
135         groups (default 1). This only takes effect during domain decomposition, so should typically
136         be 0 (never), 1 (to mean at every domain decomposition), or a multiple of `nstlist`.
137
138 * `GMX_DETAILED_PERF_STATS`: when set, print slightly more detailed performance information
139         to the [.log] file. The resulting output is the way performance summary is reported in versions
140         4.5.x and thus may be useful for anyone using scripts to parse [.log] files or standard output.
141
142 * `GMX_DISABLE_SIMD_KERNELS`: disables architecture-specific SIMD-optimized (SSE2, SSE4.1, AVX, etc.)
143         non-bonded kernels thus forcing the use of plain C kernels.
144
145 * `GMX_DISABLE_CUDA_TIMING`: timing of asynchronously executed GPU operations can have a
146         non-negligible overhead with short step times. Disabling timing can improve performance in these cases.
147
148 * `GMX_DISABLE_GPU_DETECTION`: when set, disables GPU detection even if [mdrun] was compiled
149         with GPU support.
150
151 * `GMX_DISRE_ENSEMBLE_SIZE`: the number of systems for distance restraint ensemble
152         averaging. Takes an integer value.
153
154 * `GMX_EMULATE_GPU`: emulate GPU runs by using algorithmically equivalent CPU reference code instead of
155         GPU-accelerated functions. As the CPU code is slow, it is intended to be used only for debugging purposes.
156         The behavior is automatically triggered if non-bonded calculations are turned off using `GMX_NO_NONBONDED`
157         case in which the non-bonded calculations will not be called, but the CPU-GPU transfer will also be skipped.
158
159 * `GMX_ENX_NO_FATAL`: disable exiting upon encountering a corrupted frame in an [.edr]
160         file, allowing the use of all frames up until the corruption.
161
162 * `GMX_FORCE_UPDATE`: update forces when invoking `mdrun -rerun`.
163
164 * `GMX_GPU_ID`: set in the same way as `mdrun -gpu_id`, `GMX_GPU_ID`
165         allows the user to specify different GPU id-s, which can be useful for selecting different
166         devices on different compute nodes in a cluster.  Cannot be used in conjunction with `mdrun -gpu_id`.
167
168 * `GMX_IGNORE_FSYNC_FAILURE_ENV`: allow [mdrun] to continue even if
169         a file is missing.
170
171 * `GMX_LJCOMB_TOL`: when set to a floating-point value, overrides the default tolerance of
172         1e-5 for force-field floating-point parameters.
173
174 * `GMX_MAX_MPI_THREADS`: sets the maximum number of MPI-threads that [mdrun]
175         can use.
176
177 * `GMX_MAXCONSTRWARN`: if set to -1, [mdrun] will
178         not exit if it produces too many LINCS warnings.
179
180 * `GMX_NB_GENERIC`: use the generic C kernel.  Should be set if using
181         the group-based cutoff scheme and also sets `GMX_NO_SOLV_OPT` to be true,
182         thus disabling solvent optimizations as well.
183
184 * `GMX_NB_MIN_CI`: neighbor list balancing parameter used when running on GPU. Sets the
185         target minimum number pair-lists in order to improve multi-processor load-balance for better
186         performance with small simulation systems. Must be set to a positive integer, the default value
187         is optimized for NVIDIA Fermi and Kepler GPUs, therefore changing it is not necessary for
188         normal usage, but it can be useful on future architectures.
189
190 * `GMX_NBLISTCG`: use neighbor list and kernels based on charge groups.
191
192 * `GMX_NBNXN_CYCLE`: when set, print detailed neighbor search cycle counting.
193
194 * `GMX_NBNXN_EWALD_ANALYTICAL`: force the use of analytical Ewald non-bonded kernels,
195         mutually exclusive of `GMX_NBNXN_EWALD_TABLE`.
196
197 * `GMX_NBNXN_EWALD_TABLE`: force the use of tabulated Ewald non-bonded kernels,
198         mutually exclusive of `GMX_NBNXN_EWALD_ANALYTICAL`.
199
200 * `GMX_NBNXN_SIMD_2XNN`: force the use of 2x(N+N) SIMD CPU non-bonded kernels,
201         mutually exclusive of `GMX_NBNXN_SIMD_4XN`.
202
203 * `GMX_NBNXN_SIMD_4XN`: force the use of 4xN SIMD CPU non-bonded kernels,
204         mutually exclusive of `GMX_NBNXN_SIMD_2XNN`.
205
206 * `GMX_NO_ALLVSALL`: disables optimized all-vs-all kernels.
207
208 * `GMX_NO_CART_REORDER`: used in initializing domain decomposition communicators. Rank reordering
209         is default, but can be switched off with this environment variable.
210
211 * `GMX_NO_CUDA_STREAMSYNC`: the opposite of `GMX_CUDA_STREAMSYNC`. Disables the use of the
212         standard cudaStreamSynchronize-based GPU waiting to improve performance when using CUDA driver API
213         ealier than v5.0 with ECC-enabled GPUs.
214
215 * `GMX_NO_INT`, `GMX_NO_TERM`, `GMX_NO_USR1`: disable signal handlers for SIGINT,
216         SIGTERM, and SIGUSR1, respectively.
217
218 * `GMX_NO_NODECOMM`: do not use separate inter- and intra-node communicators.
219
220 * `GMX_NO_NONBONDED`: skip non-bonded calculations; can be used to estimate the possible
221         performance gain from adding a GPU accelerator to the current hardware setup -- assuming that this is
222         fast enough to complete the non-bonded calculations while the CPU does bonded force and PME computation.
223
224 * `GMX_NO_PULLVIR`: when set, do not add virial contribution to COM pull forces.
225
226 * `GMX_NOCHARGEGROUPS`: disables multi-atom charge groups, i.e. each atom 
227         in all non-solvent molecules is assigned its own charge group.
228
229 * `GMX_NOPREDICT`: shell positions are not predicted.
230
231 * `GMX_NO_SOLV_OPT`: turns off solvent optimizations; automatic if `GMX_NB_GENERIC`
232         is enabled.
233
234 * `GMX_NSCELL_NCG`: the ideal number of charge groups per neighbor searching grid cell is hard-coded
235         to a value of 10. Setting this environment variable to any other integer value overrides this hard-coded
236         value.
237
238 * `GMX_PME_NTHREADS`: set the number of OpenMP or PME threads (overrides the number guessed by 
239         [mdrun].
240
241 * `GMX_PME_P3M`: use P3M-optimized influence function instead of smooth PME B-spline interpolation.
242
243 * `GMX_PME_THREAD_DIVISION`: PME thread division in the format "x y z" for all three dimensions. The
244         sum of the threads in each dimension must equal the total number of PME threads (set in 
245         `GMX_PME_NTHREADS`).
246
247 * `GMX_PMEONEDD`: if the number of domain decomposition cells is set to 1 for both x and y, 
248         decompose PME in one dimension.
249
250 * `GMX_REQUIRE_SHELL_INIT`: require that shell positions are initiated.
251
252 * `GMX_REQUIRE_TABLES`: require the use of tabulated Coulombic
253         and van der Waals interactions.
254
255 * `GMX_SCSIGMA_MIN`: the minimum value for soft-core sigma. **Note** that this value is set
256         using the `sc-sigma` keyword in the [.mdp] file, but this environment variable can be used
257         to reproduce pre-4.5 behavior with respect to this parameter.
258
259 * `GMX_TPIC_MASSES`: should contain multiple masses used for test particle insertion into a cavity.
260         The center of mass of the last atoms is used for insertion into the cavity.
261
262 * `GMX_USE_GRAPH`: use graph for bonded interactions.
263
264 * `GMX_VERLET_BUFFER_RES`: resolution of buffer size in Verlet cutoff scheme.  The default value is
265         0.001, but can be overridden with this environment variable.
266
267 * `MPIRUN`: the `mpirun` command used by [gmx tune_pme].
268
269 * `MDRUN`: the [mdrun] command used by [gmx tune_pme].
270
271 * `GMX_NSTLIST`: sets the default value for `nstlist`, preventing it from being tuned during
272         [mdrun] startup when using the Verlet cutoff scheme.
273
274 * `GMX_USE_TREEREDUCE`: use tree reduction for nbnxn force reduction. Potentially faster for large number of 
275         OpenMP threads (if memory locality is important).
276
277 ## Analysis and Core Functions
278
279 * `GMX_QM_ACCURACY`: accuracy in Gaussian L510 (MC-SCF) component program.
280
281 * `GMX_QM_ORCA_BASENAME`: prefix of [.tpr] files, used in Orca calculations
282         for input and output file names.
283
284 * `GMX_QM_CPMCSCF`: when set to a nonzero value, Gaussian QM calculations will
285         iteratively solve the CP-MCSCF equations.
286
287 * `GMX_QM_MODIFIED_LINKS_DIR`: location of modified links in Gaussian.
288
289 * `DSSP`: used by [gmx do_dssp] to point to the `dssp`
290         executable (not just its path).
291
292 * `GMX_QM_GAUSS_DIR`: directory where Gaussian is installed.
293
294 * `GMX_QM_GAUSS_EXE`: name of the Gaussian executable.
295
296 * `GMX_DIPOLE_SPACING`: spacing used by [gmx dipoles].
297
298 * `GMX_MAXRESRENUM`: sets the maximum number of residues to be renumbered by
299         [gmx grompp]. A value of -1 indicates all residues should be renumbered.
300
301 * `GMX_FFRTP_TER_RENAME`: Some force fields (like AMBER) use specific names for N- and C-
302         terminal residues (NXXX and CXXX) as [.rtp] entries that are normally renamed. Setting
303         this environment variable disables this renaming.
304
305 * `GMX_PATH_GZIP`: `gunzip` executable, used by [gmx wham].
306
307 * `GMX_FONT`: name of X11 font used by [gmx view].
308
309 * `GMXTIMEUNIT`: the time unit used in output files, can be
310         anything in fs, ps, ns, us, ms, s, m or h.
311
312 * `GMX_QM_GAUSSIAN_MEMORY`: memory used for Gaussian QM calculation.
313
314 * `MULTIPROT`: name of the `multiprot` executable, used by the
315         contributed program `do_multiprot`.
316
317 * `NCPUS`: number of CPUs to be used for Gaussian QM calculation
318
319 * `GMX_ORCA_PATH`: directory where Orca is installed.
320
321 * `GMX_QM_SA_STEP`: simulated annealing step size for Gaussian QM calculation.
322
323 * `GMX_QM_GROUND_STATE`: defines state for Gaussian surface hopping calculation.
324
325 * `GMX_TOTAL`: name of the `total` executable used by the contributed
326         `do_shift` program.
327
328 * `GMX_ENER_VERBOSE`: make [gmx energy] and [gmx eneconv]
329         loud and noisy.
330
331 * `VMD_PLUGIN_PATH`: where to find VMD plug-ins. Needed to be
332         able to read file formats recognized only by a VMD plug-in.
333
334 * `VMDDIR`: base path of VMD installation.
335
336 * `GMX_USE_XMGR`: sets viewer to `xmgr` (deprecated) instead of `xmgrace`.