Tutorial Scripts and Environment Variables

by Pasquale Pavone for exciting beryllium

Purpose: Here, it will be explained how to set those environment variables which are needed for running examples presented in the tutorials. Furthermore, some general information is given about the scripts that are used in exciting tutorials.


0. Did you already download exciting?


1. Setting environment variables

The next instructions have to be executed only once before starting your first tutorial!

Very important: Before starting, the following environment variable must be set by the user

  • EXCITINGROOT = Directory where exciting has been downloaded, e.g.: /home/exciting-tutorial/exciting .

Furthermore, one can define the following optional environment variable

  • EXCITINGRUNDIR = Scratch directory used for running calculation by some exciting scripts. Example of definition: /home/exciting-tutorial/tmpdir . If this variable is not defined, a running directory called xc-rundir will be created inside the directory where the scripts are executed.

The above variables are used to define other environment variables

  • EXCITINGBIN = Path to the exciting executable files, defined as $EXCITINGROOT/bin .
  • EXCITINGSCRIPTS = Directory where the tutorial scripts are located, defined as $EXCITINGROOT/tools .
  • EXCITINGATAT = Directory containing scripts for ATAT@exciting, defined as $EXCITINGSCRIPTS/ATAT@exciting .
  • EXCITINGASE = Directory containing the ASE tool, defined as $EXCITINGSCRIPTS/ase .
  • EXCITINGSTM = Directory containing the STM scripts, defined as $EXCITINGSCRIPTS/stm .
  • EXCITINGVISUAL = Directory containing several visualization templates.
  • ATATROOT = Directory containing the ATAT package, defined as $EXCITINGSCRIPTS/atat .
  • TIMEFORMAT = Output format for writing on the screen the running elapsed time, used in some script.

The setting of these variables can be done in a bash shell. In order to do this, edit the ~/.bashrc file in your $HOME directory (or create the file if it does not exist yet). Then, append the following lines to the ~/.bashrc file.

#=====================================================================================
# The following shell variables are needed for executing scripts in exciting tutorials
# 
export EXCITINGROOT=/home/exciting-tutorial/exciting
export EXCITINGBIN=$EXCITINGROOT/bin
export EXCITINGRUNDIR=
export EXCITINGSCRIPTS=$EXCITINGROOT/tools
export EXCITINGATAT=$EXCITINGSCRIPTS/ATAT@exciting
export EXCITINGASE=$EXCITINGSCRIPTS/ase
export EXCITINGSTM=$EXCITINGSCRIPTS/stm
export EXCITINGVISUAL=$EXCITINGROOT/xml/visualizationtemplates
export ATATROOT=$EXCITINGSCRIPTS/atat
#-------------------------------------------------------------------------------------
export TIMEFORMAT="   Elapsed time = %0lR"
#-------------------------------------------------------------------------------------
export PYTHONPATH=$PYTHONPATH:$EXCITINGASE:$EXCITINGSTM
export PATH=$PATH:$EXCITINGSCRIPTS:$EXCITINGBIN
export PATH=$PATH:$EXCITINGATAT:$EXCITINGATAT/bin:$EXCITINGASE/tools:$EXCITINGSTM
#=====================================================================================

Please note again: Explicit paths given above (such as /home/exciting-tutorial/exciting and /home/exciting-tutorial/tmpdir) are only valid as examples which can be changed by the user to the appropriate ones. In order to activate changes, any time you modify the ~/.bashrc file, you have to start a new shell or source ~/.bashrc.

$ source ~/.bashrc

If you have already used previous versions of exciting: You have probably some environmental variables defined inside your ~/.bashrc file. In this case, you must delete the old definitions before setting the new ones. In order to apply correctly the new settings you have to log out your account and enter it again.

Remark on the species files directory in exciting: Starting with the release of exciting beryllium is not possible to define the directory containing the species files by linking directly to the exciting-code site.


2. Tutorial scripts

All the scripts used in the exciting tutorials can be found in the directory $EXCITINGROOT/tools.

General classification of script types
  • SETUP-xxxxxx.py: Python scripts for preparing appropriate input files for exciting calculations.
  • EXECUTE-xxxxxx.sh: (Bash) shell scripts for running exciting calculations.
  • CHECKFIT-xxxxxx.py: Python scripts used for post-processing results of exciting calculations.
  • OPTIMIZE-xxxxxx.xx: Scripts used for lattice optimization.
  • ElaStic@exciting-xxxxxx.xx: Scripts which use the ElaStic tool.
  • PLOT-xxxxxx.py: Python visualization tools.
  • PLOT-xxxxxx.gnu: Gnuplot visualization tools.
Minimal requirements for running tutorial scripts
  • Bash shell
  • Python 2.6.6
  • Matplotlib 0.99.3
  • Gnuplot 4.4
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License