01 – Installing SIESTA

Directory tree (optional)

To organize the SIESTA compilation and usage, we recommend to create a siesta directory in your $HOME/Simulations using:

$ cd $HOME
$ mkdir Simulations
$ cd Simulations
$ mkdir siesta

and  three subdirectories (programs, pseudos, IO):

$ cd siesta
$ mkdir programs
$ mkdir pseudos
$ mkdir IO

In the following section, we shall install SIESTA in programs, download pseudopotential files (*.psf) in pseudos, and simulate the materials (input/output) in IO.

You can use a different directory tree to compile and use the SIESTA to simulate your systems, but change consistently with this tutorial.

Downloading SIESTA

Download the latest version of SIESTA at https://launchpad.net/siesta. For example, you can download and unpack with:

$ cd $HOME/Simulations/siesta/programs
$ wget https://launchpad.net/siesta/4.1/4.1-b4/+download/siesta-4.1-b4.tar.gz
$ tar -xvzf siesta-4.1-b4.tar.gz

this will create the directory siesta-4.1-b4 in $HOME/siesta/programs. We will do two installations of SIESTA, one simple with OpenMP parallelization, and another (faster) with OpenMPI for multiple nodes.

Compiling SIESTA with OpenMP

In Ubuntu 18.04, download and install the following libraries:

sudo apt-get install make gfortran libopenblas-dev libomp-dev

Rename and enter siesta-omp directory following the commands below:

$ mv siesta-4.1-b4 siesta-omp
$ cd siesta-omp/Obj
$ bash ../obj_setup.sh
$ cp gfortran.make arch.make

Edit the arch.make file with some program to edit files, as vim:

$ vim arch.make

In this file, set the following variables as:

FFLAGS = -O3 -fPIC -ftree-vectorize -fopenmp
LIBS = -L/usr/lib -lopenblas -fopenmp

and do not forget to save and close the file in vim (:wq). Be careful not to get lost in vim.

Finally, make compilation with make command:

$ make -j4

to compile quickly using 4 cores. Replace the “4” by the number of core you want to use to compile.

This compilation will create an executable siesta in your siesta-omp/Obj directory. We recommend create a symbolic link in /usr/local/bin as superusers (sudo).

$ cd $HOME/Simulations/siesta/programs/siesta-omp/Obj/
$ sudo ln -s siesta /usr/local/bin/siesta-omp

Done! Now you can execute the siesta program from any directory.

Compiling SIESTA with MPI

We can also install the SIESTA with another type of parallelization. The OpenMPI is a library for high-performance computing which can be used for parallelization on multiple nodes (computers).

sudo apt-get install make gfortran libopenblas-dev libfftw3-dev \
                       openmpi-common openmpi-bin libopenmpi-dev \
                       libblacs-mpi-dev libnetcdf-dev netcdf-bin \
                       libnetcdff-dev libscalapack-mpi-dev \
                       libblas-dev liblapack-dev

Create a new SIESTA installation

$ cd $HOME/Simulations/siesta/programs
$ tar -xvzf siesta-4.1-b4.tar.gz
$ mv siesta-4.1-b4 siesta-mpi
$ cd siesta-mpi/Obj

Link for arch.make.openmpi file on github. Compile the SIESTA with this arch.make file.

$ bash ../Src/obj_setup.sh
$ wget https://raw.githubusercontent.com/QuantumMackGraphe/siesta-tutorials/master/arch.make.openmpi
$ mv arch.make.openmpi arch.make
$ make -j4

After the compilation, we can create a symbolic link in /usr/local/bin:

$ sudo ln -s siesta /usr/local/bin/siesta-mpi

To run the job in parallel with openmpi, in general we can use the following command:

$ OMP_NUM_THREADS=1 mpirun -np 4 siesta-mpi input.fdf > job.out &

 

 

Next: 02 – First simulation with SIESTA