The Vasp script
NSC has developed a script to make it easier to run the Vasp
program. The location of the script varies on the different computers,
but, when available, you will find its location in the submit scripts
given below for the respective computers.
The vasp script will take care of I/O-file handling and execution of
the Vasp program. There exist default selections of input and output
files but both selections can be modified by the user with script
options "-f" and "-F", respectively. The selected output files are
returned after program completion in a gzipped archive file named
"jobname.tgz".
A short description of the vasp script is available with the -h option:
[panor@mycomputer]$ ./vasp -h
usage: vasp [-d] [-D] [-f string] [-F string] [-h] [-o file] [-t di
rectory] [-v vaspexe] [-V] [-w directory] [-z] jobname
options:
-d delete job scratch directory before calculation starts
-D do not delete job scratch directory after calculation stops
-f string list of comma-separated input files file1,file2,...
default: INCAR,KPOINTS,POTCAR,POSCAR
-F string list of comma-separated output files file1,file2,...
default: OSZICAR,CONTCAR,OUTCAR,DOSCAR
-h print this information and exit
-o file redirect output summary OSZICAR from SCRATCH to this file i
n WRKDIR
-t dir change SCRATCH to directory dir
default: /disk/local/22756
-v vaspexe run with alternative Vasp executable
-V print script version and exit
-w dir change WRKDIR to directory dir
default: /software/apps/vasp/4.6.31/bin
-z use the noncollinear version of the program
default: use collinear version compiled with NGZhalf
[panor@mycomputer]$
Note:
- The -o option will make the OSZICAR file available in your
submit directory while the program is running, a feature which makes jobs
supervision easier.
- In case of name conflict, the script does not overwrite
existing files but instead appends an integer number to the file name
of the existing file.
Resource specifics
Vasp on Neolith
To run Vasp on Neolith with use of 2 nodes and total of 16 cores for 1
hour, submit the shell script below to the queue (the submit command
is: sbatch scriptname). The input files
xxxx.INCAR, xxxx.POTCAR, xxxx.POSCAR, and xxxx.KPOITNS are assumed to
be located in the submit directory (where xxxx is a prefix string for
this particular job). Input files are copied to the /disk/local
directory of each node (slaves need to be able to read the input files
as well) in order not to slow down the network file system (NFS). A
selection of output files are copied from the scratch directory to the
submit directory after program completion; other files are removed
after the job has finished.
See one of the output files for this calculation [OUTCAR].
#!/bin/bash
#SBATCH -N 2
#SBATCH -t 1:00:00
#SBATCH -J vasptest
/software/apps/vasp/bin/vasp xxxx
#
# End of script
#
Vasp on Monolith
To run Vasp on Monolith with use of 2 nodes and 4 processors for 1
hour, submit the shell script below to the queue (the submit command
is: qsub scriptname). The input files
xxxx.INCAR, xxxx.POTCAR, xxxx.POSCAR, and xxxx.KPOITNS are assumed to
be located in the submit directory (where xxxx is a prefix string for
this particular job). Input files are copied to the /disk/local
directory of each node (slaves need to be able to read the input files
as well) in order not to slow down the network file system
(NFS). Output files that are to be kept must be specified in the
script file; other files are removed after the job has finished.
See one of the output files for this calculation [OUTCAR].
#!/bin/bash
#PBS -l walltime=1:00:00
#PBS -l nodes=2:ppn=2
job=xxxx
TMPDIR=/disk/local
MPIRUN=/usr/local/bin/mpprun
VASP=/usr/local/chem/vasp/VASP-4.6/src/vasp.4.6/vasp
MPIVASP=/usr/local/chem/vasp/VASP-4.6/src/vasp.4.6/mpi_vasp
NProc=`wc -l < $PBS_NODEFILE`
NodeList=`cat $PBS_NODEFILE | sort -u | tr -s "\n" "," | sed "s/,$//"`
cd $TMPDIR
for infile in INCAR POTCAR POSCAR KPOINTS
do
pdcp -w $NodeList $PBS_O_WORKDIR/$job.$infile $TMPDIR/$infile
done
if [ $NProc -eq 1 ]; then
$VASP
else
$MPIRUN $MPIVASP
fi
for outfile in OSZICAR EIGENVAL DOSCAR OUTCAR
do
cp $TMPDIR/$outfile $PBS_O_WORKDIR/$job.$outfile
done
#
# End of script
#
Note:
- If your job exceeds the time limit specification, the last lines
of the shell script will not be executed and you will loose your
output files. This can be circumvented by use of the stage-out
process. For further details see the Monolith user guide. [here]
Vasp on Mozart
To set the shell environment so that Vasp can be executed on
Mozart, you need to add the Vasp module. Therefore, before the
first use of Vasp, type
echo "vasp" >> $HOME/.modules
and the vasp module will be automatically added in the future. You
will then get the latest revision of Vasp as the default
program.
To run Vasp on Mozart with use of 4 processors for 1 hour, submit the
shell script below to the queue (the submit command is: qsub
scriptname). The input files
xxxx.INCAR, xxxx.POTCAR, xxxx.POSCAR, and xxxx.KPOITNS are assumed to
be located in the submit directory (where xxxx is a prefix string for
this particular job). Input files are copied to a process unique
directory under /scratch/$USER (see comment in batch script). Output
files that are to be kept must be specified in the script file; other
files are removed after the job has finished.
See one of the output files for this calculation [OUTCAR].
#!/bin/bash
#PBS -l walltime=1:00:00
#PBS -l nodes=1:ppn=4
NProc=`wc -l < $PBS_NODEFILE`
job=xxxx
# Run Vasp under a PID unique directory, TMPDIR is set by the Vasp module.
mkdir $TMPDIR/$$
cd $TMPDIR/$$
for infile in INCAR POTCAR POSCAR KPOINTS
do
cp $PBS_O_WORKDIR/$job.$infile $infile
done
if [ $NProc -eq 1 ]; then
$VASP_EXEDIR/vasp
else
mpirun -np $NProc $VASP_EXEDIR/mpi_vasp
fi
for outfile in OSZICAR EIGENVAL DOSCAR OUTCAR
do
cp $outfile $PBS_O_WORKDIR/$outfile.$$
done
# Remove scratch direcory
rm -r $TMPDIR/$$
#
# End of script
#
Note:
- Vasp offers parallization over bands and plane wave coefficients,
see [here].
On Mozart we recommend the use of LPLANE=.TRUE.and NPAR equal to 1
when running on less or equal to 8 CPUs. Set NPAR equal to 2 when
running on an even number of CPUs between 10 and 16, and 3 for up 24
CPUs, etc.
- Certain calculations can be performed with a reduced charge
density as specified with compilation options NGZhalf and
NGXhalf. This results in a more efficient code, see [here]. If
you wish to run codes that are compiled with these settings, please
change names on executables from "vasp" to "vasp_ngx" and "mpi_vasp"
to "mpi_vasp_ngz" in the above run script.
Vasp on SweGrid
To run Vasp on SweGrid with use of 2 processors for 10 minutes, submit
the xRSL script below (the submit command is: ngsub -f
scriptname). The input files
xxxx.INCAR, xxxx.POTCAR, xxxx.POSCAR, and xxxx.KPOITNS are assumed to
be located in the submit directory (where xxxx is a prefix string for
this particular job), and the output
files xxxx.OSZICAR and xxxx.tgz are stored on the SweGrid resource
after the calculation has finished. The xxxx.tgz output file is an
gzipped archive file containing additional output and restart files
(which files that are included in the archive can be specified as an
option to the vasp script). The result
files can be retrieved from the SweGrid resource in different ways. In
this example, the output files (in addition to log-files) are fetched
with the command: ngget jobname.
&(jobname="job_xxxx")
(count=2)
(cputime="10 minutes")
(executable="/usr/bin/time")
(arguments="vasp" "xxxx")
(inputfiles=("xxxx.INCAR" "")("xxxx.KPOINTS" "")("xxxx.POSCAR" "")("xxx
x.POTCAR" ""))
(outputfiles=("xxxx.OSZICAR" "")("xxxx.tgz" ""))
(runtimeenvironment="APPS/CHEM/VASP-4.6-1.0")
(stdout="stdout")
(stderr="stderr")
(gmlog="gmlog")
Note:
- Before submission can be done, you must acquire a valid token or
proxy for SweGrid (the command to use is grid-proxy-init) [details].
- The result files are kept on the SweGrid resource only for
limited time only. Remember to retrieve result files [details].
- If you have access to a Swegrid storage resource (a grid-ftp
server) you may transfer input/output files to this resource
before/after the calculation has completed. You typically need to
contact the system administrator to grant you access before using an
existing grid-ftp server (it is not enough to have regular login
access). The xRSL file below provides an example in which the output
file xxxx_yyyy.out is transferred to a user directory on the computer
green.nsc.liu.se:
&(jobname="job_xxxx")
(count=2)
(cputime="10 minutes")
(executable="/usr/bin/time")
(arguments="vasp" "xxxx")
(inputfiles=("xxxx.INCAR" "")("xxxx.KPOINTS" "")("xxxx.POSCAR" "")("xxx
x.POTCAR" ""))
(outputfiles=("xxxx.tgz" "gsiftp://green.nsc.liu.se/home/panor/xxxx.tgz
"))
(runtimeenvironment="APPS/CHEM/VASP-4.6-1.0")
(stdout="stdout")
(stderr="stderr")
(gmlog="gmlog")
Vasp on Green
To run Vasp on Green with use of 2 processors for 1 hour, submit the
shell script below to the queue (the submit command is: qsub
scriptname). The input files
xxxx.INCAR, xxxx.POTCAR, xxxx.POSCAR, and xxxx.KPOITNS are assumed to
be located in the submit directory (where xxxx is a prefix string, or
job name, for this particular job).
See one of the output files for this calculation [OUTCAR].
#!/bin/bash
#PBS -l walltime=1:00:00
#PBS -l nodes=2
/usr/local/chem/vasp/bin/vasp -o oszicar Mercury
#
# End of script
#
Page last modified: 2008-04-22 11:11
For more information contact us at
info@nsc.liu.se.