4d6d780bf2175668d58df384850e3c153c3b79fc
[alexxy/gromacs.git] / docs / user-guide / environment-variables.rst
1 Environment Variables
2 =====================
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 configuration
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``
20         Print constraint virial and force virial energy terms.
21
22 ``GMX_MAXBACKUP``
23         |Gromacs| automatically backs up old
24         copies of files when trying to write a new file of the same
25         name, and this variable controls the maximum number of
26         backups that will be made, default 99. If set to 0 it fails to
27         run if any output file already exists. And if set to -1 it
28         overwrites any output file without making a backup.
29
30 ``GMX_NO_QUOTES``
31         if this is explicitly set, no cool quotes
32         will be printed at the end of a program.
33
34 ``GMX_SUPPRESS_DUMP``
35         prevent dumping of step files during
36         (for example) blowing up during failure of constraint
37         algorithms.
38
39 ``GMX_TPI_DUMP``
40         dump all configurations to a :ref:`pdb`
41         file that have an interaction energy less than the value set
42         in this environment variable.
43
44 ``GMX_VIEW_XPM``
45         ``GMX_VIEW_XVG``, ``GMX_VIEW_EPS`` and ``GMX_VIEW_PDB``, commands used to
46         automatically view :ref:`xvg`, :ref:`xpm`, :ref:`eps`
47         and :ref:`pdb` file types, respectively; they default to ``xv``, ``xmgrace``,
48         ``ghostview`` and ``rasmol``. Set to empty to disable
49         automatic viewing of a particular file type. The command will
50         be forked off and run in the background at the same priority
51         as the |Gromacs| tool (which might not be what you want).
52         Be careful not to use a command which blocks the terminal
53         (e.g. ``vi``), since multiple instances might be run.
54
55 ``GMX_VIRIAL_TEMPERATURE``
56         print virial temperature energy term
57
58 ``GMX_LOG_BUFFER``
59         the size of the buffer for file I/O. When set
60         to 0, all file I/O will be unbuffered and therefore very slow.
61         This can be handy for debugging purposes, because it ensures
62         that all files are always totally up-to-date.
63
64 ``GMX_LOGO_COLOR``
65         set display color for logo in :ref:`gmx view`.
66
67 ``GMX_PRINT_LONGFORMAT``
68         use long float format when printing
69         decimal values.
70
71 ``GMX_COMPELDUMP``
72         Applies for computational electrophysiology setups
73         only (see reference manual). The initial structure gets dumped to
74         :ref:`pdb` file, which allows to check whether multimeric channels have
75         the correct PBC representation.
76
77 ``GMX_TRAJECTORY_IO_VERBOSITY``
78         Defaults to 1, which prints frame count e.g. when reading trajectory
79         files. Set to 0 for quiet operation.
80
81 Debugging
82 ---------
83 ``GMX_PRINT_DEBUG_LINES``
84         when set, print debugging info on line numbers.
85
86 ``GMX_DD_NST_DUMP``
87         number of steps that elapse between dumping
88         the current DD to a PDB file (default 0). This only takes effect
89         during domain decomposition, so it should typically be
90         0 (never), 1 (every DD phase) or a multiple of :mdp:`nstlist`.
91
92 ``GMX_DD_NST_DUMP_GRID``
93         number of steps that elapse between dumping
94         the current DD grid to a PDB file (default 0). This only takes effect
95         during domain decomposition, so it should typically be
96         0 (never), 1 (every DD phase) or a multiple of :mdp:`nstlist`.
97
98 ``GMX_DD_DEBUG``
99         general debugging trigger for every domain
100         decomposition (default 0, meaning off). Currently only checks
101         global-local atom index mapping for consistency.
102
103 ``GMX_DD_NPULSE``
104         over-ride the number of DD pulses used
105         (default 0, meaning no over-ride). Normally 1 or 2.
106
107 There are a number of extra environment variables like these
108 that are used in debugging - check the code!
109
110 Performance and Run Control
111 ---------------------------
112 ``GMX_DO_GALACTIC_DYNAMICS``
113         planetary simulations are made possible (just for fun) by setting
114         this environment variable, which allows setting :mdp:`epsilon-r` to -1 in the :ref:`mdp`
115         file. Normally, :mdp:`epsilon-r` must be greater than zero to prevent a fatal error.
116         See webpage_ for example input files for a planetary simulation.
117
118 ``GMX_ALLOW_CPT_MISMATCH``
119         when set, runs will not exit if the
120         ensemble set in the :ref:`tpr` file does not match that of the
121         :ref:`cpt` file.
122
123 ``GMX_CUDA_NB_EWALD_TWINCUT``
124         force the use of twin-range cutoff kernel even if :mdp:`rvdw` equals
125         :mdp:`rcoulomb` after PP-PME load balancing. The switch to twin-range kernels is automated,
126         so this variable should be used only for benchmarking.
127
128 ``GMX_CUDA_NB_ANA_EWALD``
129         force the use of analytical Ewald kernels. Should be used only for benchmarking.
130
131 ``GMX_CUDA_NB_TAB_EWALD``
132         force the use of tabulated Ewald kernels. Should be used only for benchmarking.
133
134 ``GMX_CUDA_STREAMSYNC``
135         force the use of cudaStreamSynchronize on ECC-enabled GPUs, which leads
136         to performance loss due to a known CUDA driver bug present in API v5.0 NVIDIA drivers (pre-30x.xx).
137         Cannot be set simultaneously with ``GMX_NO_CUDA_STREAMSYNC``.
138
139 ``GMX_DISABLE_CUDALAUNCH``
140         disable the use of the lower-latency cudaLaunchKernel API even when supported (CUDA >=v7.0).
141         Should only be used for benchmarking purposes.
142
143 ``GMX_DISABLE_CUDA_TIMING``
144         Disables GPU timing of CUDA tasks; synonymous with ``GMX_DISABLE_GPU_TIMING``.
145
146 ``GMX_CYCLE_ALL``
147         times all code during runs.  Incompatible with threads.
148
149 ``GMX_CYCLE_BARRIER``
150         calls MPI_Barrier before each cycle start/stop call.
151
152 ``GMX_DD_ORDER_ZYX``
153         build domain decomposition cells in the order
154         (z, y, x) rather than the default (x, y, z).
155
156 ``GMX_DD_USE_SENDRECV2``
157         during constraint and vsite communication, use a pair
158         of ``MPI_Sendrecv`` calls instead of two simultaneous non-blocking calls
159         (default 0, meaning off). Might be faster on some MPI implementations.
160
161 ``GMX_DLB_BASED_ON_FLOPS``
162         do domain-decomposition dynamic load balancing based on flop count rather than
163         measured time elapsed (default 0, meaning off).
164         This makes the load balancing reproducible, which can be useful for debugging purposes.
165         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.
166
167 ``GMX_DLB_MAX_BOX_SCALING``
168         maximum percentage box scaling permitted per domain-decomposition
169         load-balancing step (default 10)
170
171 ``GMX_DD_RECORD_LOAD``
172         record DD load statistics for reporting at end of the run (default 1, meaning on)
173
174 ``GMX_DETAILED_PERF_STATS``
175         when set, print slightly more detailed performance information
176         to the :ref:`log` file. The resulting output is the way performance summary is reported in versions
177         4.5.x and thus may be useful for anyone using scripts to parse :ref:`log` files or standard output.
178
179 ``GMX_DISABLE_SIMD_KERNELS``
180         disables architecture-specific SIMD-optimized (SSE2, SSE4.1, AVX, etc.)
181         non-bonded kernels thus forcing the use of plain C kernels.
182
183 ``GMX_DISABLE_GPU_TIMING``
184         timing of asynchronously executed GPU operations can have a
185         non-negligible overhead with short step times. Disabling timing can improve performance in these cases.
186
187 ``GMX_DISABLE_GPU_DETECTION``
188         when set, disables GPU detection even if :ref:`gmx mdrun` was compiled
189         with GPU support.
190
191 ``GMX_GPU_APPLICATION_CLOCKS``
192         setting this variable to a value of "0", "ON", or "DISABLE" (case insensitive)
193         allows disabling the CUDA GPU allication clock support.
194
195 ``GMX_DISRE_ENSEMBLE_SIZE``
196         the number of systems for distance restraint ensemble
197         averaging. Takes an integer value.
198
199 ``GMX_EMULATE_GPU``
200         emulate GPU runs by using algorithmically equivalent CPU reference code instead of
201         GPU-accelerated functions. As the CPU code is slow, it is intended to be used only for debugging purposes.
202
203 ``GMX_ENX_NO_FATAL``
204         disable exiting upon encountering a corrupted frame in an :ref:`edr`
205         file, allowing the use of all frames up until the corruption.
206
207 ``GMX_FORCE_UPDATE``
208         update forces when invoking ``mdrun -rerun``.
209
210 ``GMX_GPU_ID``
211         set in the same way as ``mdrun -gpu_id``, ``GMX_GPU_ID``
212         allows the user to specify different GPU IDs for different ranks, which can be useful for selecting different
213         devices on different compute nodes in a cluster.  Cannot be used in conjunction with ``mdrun -gpu_id``.
214
215 ``GMX_GPUTASKS``
216         set in the same way as ``mdrun -gputasks``, ``GMX_GPUTASKS`` allows the mapping
217         of GPU tasks to GPU device IDs to be different on different ranks, if e.g. the MPI
218         runtime permits this variable to be different for different ranks. Cannot be used
219         in conjunction with ``mdrun -gputasks``. Has all the same requirements as ``mdrun -gputasks``.
220
221 ``GMX_IGNORE_FSYNC_FAILURE_ENV``
222         allow :ref:`gmx mdrun` to continue even if
223         a file is missing.
224
225 ``GMX_LJCOMB_TOL``
226         when set to a floating-point value, overrides the default tolerance of
227         1e-5 for force-field floating-point parameters.
228
229 ``GMX_MAXCONSTRWARN``
230         if set to -1, :ref:`gmx mdrun` will
231         not exit if it produces too many LINCS warnings.
232
233 ``GMX_NB_GENERIC``
234         use the generic C kernel.  Should be set if using
235         the group-based cutoff scheme and also sets ``GMX_NO_SOLV_OPT`` to be true,
236         thus disabling solvent optimizations as well.
237
238 ``GMX_NB_MIN_CI``
239         neighbor list balancing parameter used when running on GPU. Sets the
240         target minimum number pair-lists in order to improve multi-processor load-balance for better
241         performance with small simulation systems. Must be set to a non-negative integer,
242         the 0 value disables list splitting.
243         The default value is optimized for supported GPUs (NVIDIA Fermi to Maxwell),
244         therefore changing it is not necessary for normal usage, but it can be useful on future architectures.
245
246 ``GMX_NBLISTCG``
247         use neighbor list and kernels based on charge groups.
248
249 ``GMX_NBNXN_CYCLE``
250         when set, print detailed neighbor search cycle counting.
251
252 ``GMX_NBNXN_EWALD_ANALYTICAL``
253         force the use of analytical Ewald non-bonded kernels,
254         mutually exclusive of ``GMX_NBNXN_EWALD_TABLE``.
255
256 ``GMX_NBNXN_EWALD_TABLE``
257         force the use of tabulated Ewald non-bonded kernels,
258         mutually exclusive of ``GMX_NBNXN_EWALD_ANALYTICAL``.
259
260 ``GMX_NBNXN_SIMD_2XNN``
261         force the use of 2x(N+N) SIMD CPU non-bonded kernels,
262         mutually exclusive of ``GMX_NBNXN_SIMD_4XN``.
263
264 ``GMX_NBNXN_SIMD_4XN``
265         force the use of 4xN SIMD CPU non-bonded kernels,
266         mutually exclusive of ``GMX_NBNXN_SIMD_2XNN``.
267
268 ``GMX_NO_ALLVSALL``
269         disables optimized all-vs-all kernels.
270
271 ``GMX_NO_CART_REORDER``
272         used in initializing domain decomposition communicators. Rank reordering
273         is default, but can be switched off with this environment variable.
274
275 ``GMX_NO_LJ_COMB_RULE``
276         force the use of LJ paremeter lookup instead of using combination rules
277         in the non-bonded kernels.
278
279 ``GMX_NO_CUDA_STREAMSYNC``
280         the opposite of ``GMX_CUDA_STREAMSYNC``. Disables the use of the
281         standard cudaStreamSynchronize-based GPU waiting to improve performance when using CUDA driver API
282         ealier than v5.0 with ECC-enabled GPUs.
283
284 ``GMX_NO_INT``, ``GMX_NO_TERM``, ``GMX_NO_USR1``
285         disable signal handlers for SIGINT,
286         SIGTERM, and SIGUSR1, respectively.
287
288 ``GMX_NO_NODECOMM``
289         do not use separate inter- and intra-node communicators.
290
291 ``GMX_NO_NONBONDED``
292         skip non-bonded calculations; can be used to estimate the possible
293         performance gain from adding a GPU accelerator to the current hardware setup -- assuming that this is
294         fast enough to complete the non-bonded calculations while the CPU does bonded force and PME computation.
295         Freezing the particles will be required to stop the system blowing up.
296
297 ``GMX_NO_PULLVIR``
298         when set, do not add virial contribution to COM pull forces.
299
300 ``GMX_NOPREDICT``
301         shell positions are not predicted.
302
303 ``GMX_NO_SOLV_OPT``
304         turns off solvent optimizations; automatic if ``GMX_NB_GENERIC``
305         is enabled.
306
307 ``GMX_NSCELL_NCG``
308         the ideal number of charge groups per neighbor searching grid cell is hard-coded
309         to a value of 10. Setting this environment variable to any other integer value overrides this hard-coded
310         value.
311
312 ``GMX_PME_NTHREADS``
313         set the number of OpenMP or PME threads (overrides the number guessed by
314         :ref:`gmx mdrun`.
315
316 ``GMX_PME_P3M``
317         use P3M-optimized influence function instead of smooth PME B-spline interpolation.
318
319 ``GMX_PME_THREAD_DIVISION``
320         PME thread division in the format "x y z" for all three dimensions. The
321         sum of the threads in each dimension must equal the total number of PME threads (set in
322         `GMX_PME_NTHREADS`).
323
324 ``GMX_PMEONEDD``
325         if the number of domain decomposition cells is set to 1 for both x and y,
326         decompose PME in one dimension.
327
328 ``GMX_REQUIRE_SHELL_INIT``
329         require that shell positions are initiated.
330
331 ``GMX_REQUIRE_TABLES``
332         require the use of tabulated Coulombic
333         and van der Waals interactions.
334
335 ``GMX_SCSIGMA_MIN``
336         the minimum value for soft-core sigma. **Note** that this value is set
337         using the :mdp:`sc-sigma` keyword in the :ref:`mdp` file, but this environment variable can be used
338         to reproduce pre-4.5 behavior with respect to this parameter.
339
340 ``GMX_TPIC_MASSES``
341         should contain multiple masses used for test particle insertion into a cavity.
342         The center of mass of the last atoms is used for insertion into the cavity.
343
344 ``GMX_USE_GRAPH``
345         use graph for bonded interactions.
346
347 ``GMX_VERLET_BUFFER_RES``
348         resolution of buffer size in Verlet cutoff scheme.  The default value is
349         0.001, but can be overridden with this environment variable.
350
351 ``HWLOC_XMLFILE``
352         Not strictly a |Gromacs| environment variable, but on large machines
353         the hwloc detection can take a few seconds if you have lots of MPI processes.
354         If you run the hwloc command `lstopo out.xml` and set this environment
355         variable to point to the location of this file, the hwloc library will use
356         the cached information instead, which can be faster.
357
358 ``MPIRUN``
359         the ``mpirun`` command used by :ref:`gmx tune_pme`.
360
361 ``MDRUN``
362         the :ref:`gmx mdrun` command used by :ref:`gmx tune_pme`.
363
364 ``GMX_DISABLE_DYNAMICPRUNING``
365         disables dynamic pair-list pruning. Note that :ref:`gmx mdrun` will
366         still tune nstlist to the optimal value picked assuming dynamic pruning. Thus
367         for good performance the -nstlist option should be used.
368
369 ``GMX_NSTLIST_DYNAMICPRUNING``
370         overrides the dynamic pair-list pruning interval chosen heuristically
371         by mdrun. Values should be between the pruning frequency value
372         (1 for CPU and 2 for GPU) and :mdp:`nstlist` ``- 1``.
373
374 ``GMX_USE_TREEREDUCE``
375         use tree reduction for nbnxn force reduction. Potentially faster for large number of
376         OpenMP threads (if memory locality is important).
377
378 .. _opencl-management:
379
380 OpenCL management
381 -----------------
382 Currently, several environment variables exist that help customize some aspects
383 of the OpenCL_ version of |Gromacs|. They are mostly related to the runtime
384 compilation of OpenCL kernels, but they are also used in device selection.
385
386 ``GMX_OCL_NOGENCACHE``
387         If set, disable caching for OpenCL kernel builds. Caching is
388         normally useful so that future runs can re-use the compiled
389         kernels from previous runs. Currently, caching is always
390         disabled, until we solve concurrency issues.
391
392 ``GMX_OCL_GENCACHE``
393         Enable OpenCL binary caching. Only intended to be used for
394         development and (expert) testing as neither concurrency
395         nor cache invalidation is implemented safely!
396
397 ``GMX_OCL_NOFASTGEN``
398         If set, generate and compile all algorithm flavors, otherwise
399         only the flavor required for the simulation is generated and
400         compiled.
401
402 ``GMX_OCL_DISABLE_FASTMATH``
403         Prevents the use of ``-cl-fast-relaxed-math`` compiler option.
404
405 ``GMX_OCL_DUMP_LOG``
406         If defined, the OpenCL build log is always written to the
407         mdrun log file. Otherwise, the build log is written to the
408         log file only when an error occurs.
409
410 ``GMX_OCL_VERBOSE``
411         If defined, it enables verbose mode for OpenCL kernel build.
412         Currently available only for NVIDIA GPUs. See ``GMX_OCL_DUMP_LOG``
413         for details about how to obtain the OpenCL build log.
414
415 ``GMX_OCL_DUMP_INTERM_FILES``
416
417         If defined, intermediate language code corresponding to the
418         OpenCL build process is saved to file. Caching has to be
419         turned off in order for this option to take effect (see
420         ``GMX_OCL_NOGENCACHE``).
421
422             - NVIDIA GPUs: PTX code is saved in the current directory
423               with the name ``device_name.ptx``
424             - AMD GPUs: ``.IL/.ISA`` files will be created for each OpenCL
425               kernel built.  For details about where these files are
426               created check AMD documentation for ``-save-temps`` compiler
427               option.
428
429 ``GMX_OCL_DEBUG``
430         Use in conjunction with ``OCL_FORCE_CPU`` or with an AMD device.
431         It adds the debug flag to the compiler options (-g).
432
433 ``GMX_OCL_NOOPT``
434         Disable optimisations. Adds the option ``cl-opt-disable`` to the
435         compiler options.
436
437 ``GMX_OCL_FORCE_CPU``
438         Force the selection of a CPU device instead of a GPU.  This
439         exists only for debugging purposes. Do not expect |Gromacs| to
440         function properly with this option on, it is solely for the
441         simplicity of stepping in a kernel and see what is happening.
442
443 ``GMX_OCL_DISABLE_I_PREFETCH``
444         Disables i-atom data (type or LJ parameter) prefetch allowig
445         testing.
446
447 ``GMX_OCL_ENABLE_I_PREFETCH``
448         Enables i-atom data (type or LJ parameter) prefetch allowig
449         testing on platforms where this behavior is not default.
450
451 ``GMX_OCL_NB_ANA_EWALD``
452         Forces the use of analytical Ewald kernels. Equivalent of
453         CUDA environment variable ``GMX_CUDA_NB_ANA_EWALD``
454
455 ``GMX_OCL_NB_TAB_EWALD``
456         Forces the use of tabulated Ewald kernel. Equivalent
457         of CUDA environment variable ``GMX_OCL_NB_TAB_EWALD``
458
459 ``GMX_OCL_NB_EWALD_TWINCUT``
460         Forces the use of twin-range cutoff kernel. Equivalent of
461         CUDA environment variable ``GMX_CUDA_NB_EWALD_TWINCUT``
462
463 ``GMX_DISABLE_OCL_TIMING``
464         Disables timing for OpenCL operations
465
466 ``GMX_OCL_FILE_PATH``
467         Use this parameter to force |Gromacs| to load the OpenCL
468         kernels from a custom location. Use it only if you want to
469         override |Gromacs| default behavior, or if you want to test
470         your own kernels.
471
472 ``GMX_OCL_DISABLE_COMPATIBILITY_CHECK``
473         Disables the hardware compatibility check. Useful for developers
474         and allows testing the OpenCL kernels on non-supported platforms
475         (like Intel iGPUs) without source code modification.
476
477 Analysis and Core Functions
478 ---------------------------
479 ``GMX_QM_ACCURACY``
480         accuracy in Gaussian L510 (MC-SCF) component program.
481
482 ``GMX_QM_ORCA_BASENAME``
483         prefix of :ref:`tpr` files, used in Orca calculations
484         for input and output file names.
485
486 ``GMX_QM_CPMCSCF``
487         when set to a nonzero value, Gaussian QM calculations will
488         iteratively solve the CP-MCSCF equations.
489
490 ``GMX_QM_MODIFIED_LINKS_DIR``
491         location of modified links in Gaussian.
492
493 ``DSSP``
494         used by :ref:`gmx do_dssp` to point to the ``dssp``
495         executable (not just its path).
496
497 ``GMX_QM_GAUSS_DIR``
498         directory where Gaussian is installed.
499
500 ``GMX_QM_GAUSS_EXE``
501         name of the Gaussian executable.
502
503 ``GMX_DIPOLE_SPACING``
504         spacing used by :ref:`gmx dipoles`.
505
506 ``GMX_MAXRESRENUM``
507         sets the maximum number of residues to be renumbered by
508         :ref:`gmx grompp`. A value of -1 indicates all residues should be renumbered.
509
510 ``GMX_FFRTP_TER_RENAME``
511         Some force fields (like AMBER) use specific names for N- and C-
512         terminal residues (NXXX and CXXX) as :ref:`rtp` entries that are normally renamed. Setting
513         this environment variable disables this renaming.
514
515 ``GMX_PATH_GZIP``
516         ``gunzip`` executable, used by :ref:`gmx wham`.
517
518 ``GMX_FONT``
519         name of X11 font used by :ref:`gmx view`.
520
521 ``GMXTIMEUNIT``
522         the time unit used in output files, can be
523         anything in fs, ps, ns, us, ms, s, m or h.
524
525 ``GMX_QM_GAUSSIAN_MEMORY``
526         memory used for Gaussian QM calculation.
527
528 ``MULTIPROT``
529         name of the ``multiprot`` executable, used by the
530         contributed program ``do_multiprot``.
531
532 ``NCPUS``
533         number of CPUs to be used for Gaussian QM calculation
534
535 ``GMX_ORCA_PATH``
536         directory where Orca is installed.
537
538 ``GMX_QM_SA_STEP``
539         simulated annealing step size for Gaussian QM calculation.
540
541 ``GMX_QM_GROUND_STATE``
542         defines state for Gaussian surface hopping calculation.
543
544 ``GMX_TOTAL``
545         name of the ``total`` executable used by the contributed
546         ``do_shift`` program.
547
548 ``GMX_ENER_VERBOSE``
549         make :ref:`gmx energy` and :ref:`gmx eneconv`
550         loud and noisy.
551
552 ``VMD_PLUGIN_PATH``
553         where to find VMD plug-ins. Needed to be
554         able to read file formats recognized only by a VMD plug-in.
555
556 ``VMDDIR``
557         base path of VMD installation.
558
559 ``GMX_USE_XMGR``
560         sets viewer to ``xmgr`` (deprecated) instead of ``xmgrace``.