TABLE OF CONTENTS
2.4 Defining Programs and Directories
DESCRIPTION
This section explains commands for specifying the Quantum ESPRESSO (QE) executables and directories such as pseudo_dir and outdir.
TABLE OF CONTENTS
- Specifying the location of the QE executables
- Commands for specifying and manipulating outdir
- Commands for specifying and manipulating wfcdir
- Commands for specifying pseudo_dir
- Command for querying QE executables before their execution
- Commands for defining how to run executables
Specifying the location of the QE executables
If QE executables are not on PATH, their location can be defined in PWTK with the bin_dir command (see ::pwtk::bin_dir), i.e.:
bin_dir /directory/of/QE/binaries
where /directory/of/QE/binaries is a pathname to directory which contains the QE executables. Typically, the bin_dir command is used in the main PWTK user configuration file, ~/.pwtk/pwtk.tcl.
It is also possible to define specifically each executable with the prog command (see ::pwtk::prog). Here is an expample how to define the pw.x executable explicitly:
prog pw.x /full/path/to/pw.x
where /full/path/to/pw.x is the pathname to the pw.x executable.
Commands for specifying and manipulating outdir
The outdir directory can be manipulated with outdir-related commands. The outdir command is equivalent to CONTROL { outdir = '/path/to/outdir' }. Even more flexible are the outdir_prefix and outdir_postfix commands; if outdir is not explicitly used, it is composed as outdir_prefix/outdir_postfix. For example, outdir_prefix can be defined globally in the main PWTK user configuration file (~/.pwtk/pwtk.tcl) as:
outdir_prefix /scratch/$env(USER)/QE
and then in PWTK scripts only outdir_postfix can be used. This way, outdir is defined as outdir_prefix/outdir_postfix.
Here is a list of outdir-related commands (specified as "command => Tcl proc that provides the command"):
* outdir => ::pwtk::outdir * outdir_prefix => ::pwtk::outdir_prefix * outdir_prefix_append ==> ::pwtk::outdir_prefix_append * outdir_postfix => ::pwtk::outdir_postfix * outdir_clean => ::pwtk::outdir_clean (BEWARE: dangerous routine)
EXAMPLE
outdir /tmp
REMARK
If outdir is explicitly defined in a namelist, it has the precedence over the value defined by the outdir command.
Commands for specifying and manipulating wfcdir
The wfcdir set of commands works analogously to the the outdir set of commands:
* wfcdir => ::pwtk::wfcdir * wfcdir_prefix => ::pwtk::wfcdir_prefix * wfcdir_prefix_append ==> ::pwtk::wfcdir_prefix_append * wfcdir_postfix => ::pwtk::wfcdir_postfix * wfcdir_clean => ::pwtk::wfcdir_clean (BEWARE: dangerous routine)
REMARK
If the ESPRESSO_WFCDIR enviromental variable is defined, PWTK will use it for wfcdir when wfcdir is not explicitly set.
Commands for specifying pseudo_dir
Typically, each user has its own directory with pseudopotential files. To instruct PWTK about the default location of the pseudopotential files, define either the ESPRESSO_PSEUDO enviromental variable or use the pseudo_dir command (see ::pwtk::pseudo_dir) in the ~/.pwtk/pwtk.tcl configuration file. For example:
pseudo_dir ~/pw/pseudo
Command for querying QE executables before their execution
By default, PWTK queries the status of QE executables before they are run. This querying can be disabled or enabled with the bin_query command (see ::pwtk::bin_query).
Example:
# query the status of QE executables (this is default) bin_query on
# disable querying the status of QE executables bin_query off
where the first form enables and the second form disables the querying of existence of QE executables and their executable status before their execution. A typical case where querying should be disabled is when using QE executables from a container (e.g. singularity apptainer).
Commands for defining how to run executables
Here is a list of commands for defining how to run executables:
- nice => ::pwtk::nice
- container => ::pwtk::container
- prefix => ::pwtk::prefix
- postfix => ::pwtk::postfix
Suppose that we usually run the pw.x program from the terminal as:
nice -19 apptainer exec ~/bin/qe-7.2.sif mpirun -n 8 program.x -npool 2 < input > output
In this case, in the PWTK script, nice, container, prefix, and postfix could be set to:
nice -19 container apptainer exec ~/bin/qe-7.2.sif prefix mpirun -n 8 postfix -npool
and the calculation is then run as:
runPW input
The nice, container, prefix (and less often postfix) commands are usually set in the main PWTK user configuration file, ~/.pwtk/pwtk.tcl.