The Vienna Ab initio Simulation Package (VASP) is a computer program for atomic scale materials modelling, e.g. electronic structure calculations and quantum-mechanical molecular dynamics, from first principles.
...
Available versionThere are two modules of VASP on Lanta. One is for running on CPU node, and the another is for running on GPU node.
Version | Processing unit | Module name |
---|
6.3.2
| CPU | VASP/6.3.2-GNU-cpu |
GPU | VASP/6.3.2-NVHPC-gpu |
1. Input fileThe basic input files for running VASP on Lanta are VASP inputs and job submission script.
2. Job submission scriptcreate a script using vi submit.sh
command and specify the following details depending on computational resources you want to use.
2.1 Run VASP on CPU nodeVASP on Lanta has OpenMP support, so users can use a combination of OpenMP threading and parallelization over MPI ranks. However, only some cases can get benefit from using multiple OpenMP threads per MPI rank. For further information, please visit Combining OpenMP + MPI in VASP. Here, both job submission scripts with Pure MPI and Hybrid OpenMP+MPI are shown.
2.1.1 Pure MPI Code Block |
---|
#!/bin/bash -l
#SBATCH -p compute #specify partition
#SBATCH -N 1 #specify number of nodes
#SBATCH --ntasks-per-node=64 #specify number of tasks per node
#SBATCH -t 2:00:00 #job time limit <hr:min:sec>
#SBATCH -A thaisc #project name
#SBATCH -J VASP-run #job name
##Module Load##
module load VASP/6.3.2-GNU-cpu
##Extra Modules load due to MPI issue
module load craype-network-ucx
module swap cray-mpich cray-mpich-ucx
module load libfabric/1.15.0.0
#set the maximum stacksize to unlimited
ulimit -s unlimited
# Extra setting due to MPI issue
export UCX_TLS=all
export UCX_WARN_UNUSED_ENV_VARS=n
#disable OpenMP
export OMP_NUM_THREADS=1
##Run VASP###
srun vasp_std |
The script above using compute partition (-p compute
), 1 node (-N 1
) with 64 tasks per node (--ntasks-per-node=64
), so the total CPUs core for this job is 64 (the number of tasks) x 1 (default CPU per task) = 64 cores.
2.1.2 Hybrid MPI + OpenMP Code Block |
---|
#!/bin/bash -l
#SBATCH -p compute #specify partition
#SBATCH -N 1 #specify number of nodes
#SBATCH --ntasks-per-node=16 #specify number of tasks per node
#SBATCH --cpus-per-task=4 #specify number of openmp thread per task
#SBATCH -t 2:00:00 #job time limit <hr:min:sec>
#SBATCH -A thaisc #project name
#SBATCH -J VASP-run #job name
##Module Load##
module load VASP/6.3.2-GNU-cpu
##Extra Modules load due to MPI issue
module load craype-network-ucx
module swap cray-mpich cray-mpich-ucx
module load libfabric/1.15.0.0
#set the maximum stacksize to unlimited
ulimit -s unlimited
# Extra setting due to MPI issue
export UCX_TLS=all
export UCX_WARN_UNUSED_ENV_VARS=n
# Set OpenMP variables
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
export OMP_PLACES=cores
export OMP_PROC_BIND=close
export OMP_STACKSIZE=512m
##Run VASP###
srun vasp_std
|
...
Info |
---|
Please note that more CPU cores is not always mean better performance. It is a good idea to do a test with your own system for the optimum CPU cores. |
2.2 Run VASP on GPU node Code Block |
---|
#!/bin/bash -l
#SBATCH -p gpu #specify partition
#SBATCH -N 1 #specify number of nodes
#SBATCH --ntasks-per-node=4 #specify number of tasks per node
#SBATCH --gpus-per-task=1 #specify number of gpus per task
#SBATCH --cpus-per-task=16 #specify number of openmp thread per task
#SBATCH -t 2:00:00 #job time limit <hr:min:sec>
#SBATCH -A thaisc #project name
#SBATCH -J VASP-run #job name
##Module Load##
module load VASP/6.3.2-GNU-cpu
##Extra Modules load due to MPI issue
module load craype-network-ucx
module swap cray-mpich cray-mpich-ucx
module load libfabric/1.15.0.0
#set the maximum stacksize to unlimited
ulimit -s unlimited
# Extra setting due to MPI issue
export UCX_TLS=all
export UCX_WARN_UNUSED_ENV_VARS=n
# Set OpenMP variables
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
export OMP_PLACES=cores
export OMP_PROC_BIND=close
export OMP_STACKSIZE=512m
##Run VASP###
srun vasp_std |
The script above using gpu partition (-p gpu
), 1 node (-N 1
) with 4 tasks per node (--ntasks-per-node=4
), 1 GPU card per task (--gpus-per-task=1
) and each task uses 16 CPUs core (--cpus-per-task=16
), so the total CPU cores for this job is 4 (the number of tasks) x 16 (no. of CPUs per task) = 64 cores. The total GPUs used in this job is 4 (one gpu node on Lanta has 4 GPU GPUs of A100).
Info |
---|
Total cores per LANTA GPU node is 64 |
Info |
---|
the number of MPI ranks (ntasks) should less than or equal to the number of GPUs (--ntasks-per-node should not exceed 4) |
3. Job submissionusing sbatch submit.sh
command to submit the job to the queuing system.
...