Yambo via Docker

From The Yambo Project
Revision as of 15:14, 28 March 2022 by Davide (talk | contribs) (Copy and paste from previous school)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

An alternative to get the Yambo code is to install the Yambo container in your machine and this can be done in few steps:

  • Install the docker platform (Linux or Mac). Follow the instruction in the docker website.
  • Pull the Yambo container:
 sudo docker pull nicspalla/yambo-gcc_openmp_petsc:latest

sudo it is not necessary if your user is part of the group named docker (suggested on Linux!).

For Linux users:

 sudo groupadd docker
 sudo usermod -aG docker $USER

For Mac users:

 sudo dscl . create /Groups/docker
 sudo dseditgroup -o edit -a $USER -t user docker

Log out and log back in so that your group membership is re-evaluated.

  • You are done. To run Yambo into the container:
docker run -ti --user $(id -u):$(id -g) \
   --mount type=bind,source="$(pwd)",target=/tmpdir \
   -e OMP_NUM_THREADS=4  \
   nicspalla/yambo-gcc_openmp_petsc:latest \
   yambo -F yambo.in -J yambo.out

Otherwise (suggested!), copy and paste the code below in a file, i.e called drun.sh:

#!/bin/bash 
docker run -ti --user $(id -u):$(id -g) \
   --mount type=bind,source="$(pwd)",target=/tmpdir \
   -e OMP_NUM_THREADS=4  \
   nicspalla/yambo-gcc_openmp_petsc:latest $@

then give the file execute privileges:

chmod +x drun.sh

Move (or copy) this file in the directory where you want to use Yambo and use it as prefix of your Yambo calculation:

./drun.sh yambo -F yambo.in -J yambo.out

If the yambo container is working correctly you should obtain:

./drun.sh yambo

yambo: cannot access CORE database (SAVE/*db1 and/or SAVE/*wf)
./drun.sh yambo -h

should provide in output the help for yambo usage.