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