This repository provides a Docker setup for building a containerized version of VASP (Vienna Ab-initio Simulation Package), optionally with Transition State Tools for VASP, as well as Libxc, for a vast selection of functionals and Miniconda3, ensuring easy access to Python within the containerized environment. Note that the Dockerfile in its current form is version specific and is tailored towards VASP version 6.4.3.
This setup ensures portability, reproducibility, and an easy way to run VASP with Python support across different environments. By leveraging Docker and Singularity, you can seamlessly run your simulations both locally and on HPC clusters.
Before building the Docker image, you must provide your own VASP source code archive. This is due to licensing restrictions.
Place one of the following tarballs in the vasp subdirectory:
vasp.6.4.3+vtsttools.tgz(for VASP with VTST tools)vasp.6.4.3.tgz(for standard VASP)
as well as
vdw_kernel.bindat.tgz(kernel for van der Waals functionals)potpaw_PBE.64.tgz(PBE pseudopotential library)
Note: The directory structure should look like this before building:
.
├── Dockerfile
├── entrypoint.sh
├── makefile.include
├── vasp
│ ├── vasp.6.4.3+vtsttools.tgz # or vasp.6.4.3.tgz
│ ├── potpaw_PBE.64.tgz
│ ├── vdw_kernel.bindat.tgz
└── (non essential repository files)
To build the Docker image, run the following command in the directory containing the Dockerfile:
docker build -t vasp:6.4.3 .This will create a Docker image named vasp:6.4.3 with VASP, Libxc, and Miniconda3 installed.
To run the container interactively, use:
docker run --rm -it vasp:6.4.3However in most cases you will need access to your local files inside your container, therefore it is better to use:
docker run --rm -it -v $(pwd):/tmp vasp:6.4.3 The -v flag mounts the current directory $(pwd) inside the container at /tmp`, allowing you to run VASP on your input files.
To execute VASP dirrectly inside the container, you can use:
docker run --rm -v $(pwd):/tmp vasp:6.4.3 vasp_stdThis is useful when you only need to run VASP in a single directory once.
Note: The --rm flag removes the container after use which is usually good practice in order to save storage space, however if for some reason you would like to reuse the container in the future (for example if you installed extra python packages and don't want to do this every time all over again) skip this flag.
Since many HPC environments do not support Docker directly, you need to convert the Docker image to a format compatible with Singularity (Apptainer).
On your local machine, save the Docker image as a .tar file:
docker save -o vasp-643.tar vasp:6.4.3Transfer this file to your HPC cluster using scp or rsync:
scp vasp-643.tar username@hpc.example.com:/path/to/transfer/Once on the HPC system, load Singularity (Apptainer) and import the image:
singularity build --fakeroot vasp-643.sif docker-archive://vasp-643.tarNote: Be careful to export SINGULARITY_TMPDIR and SINGULARITY_CACHEDIR variables to a directory for which you have adequate read/write permissions, usually /var/tmp is a safe choice.
To run an interactive session:
singularity run vasp-643.sifTo execute VASP within the Singularity container:
singularity exec vasp-643.sif vasp_stdTo mount a local working directory inside the container /tmp folder for your simulations:
singularity run --bind /scratch:/tmp vasp-643.sifsingularity exec --bind /scratch:/tmp vasp-643.sif vasp_stdThis assumes your simulation directory is placed inside /scratch which is often reserved as a fast local storage on a compute node, but make sure that this is also the case for your HPC enviroment (read the documentation).
For any issues or questions, feel free to open an issue in this repository.
License: Note that VASP is a licensed software, and you are responsible for obtaining the appropriate license before using this container.