How to build Siesta 3.0-rc2 on Intel Westmere with Infiniband network

ABOUT SIESTA:

SIESTA was born in 1996 to implement, in self consistent DFT, the order-N techniques developed for tight-binding in the early 1990s. Because order-N was carefully imposed in all the code, this was very efficient, specially for large systems and moderate precisions. Later, the need for higher precisions, and the addition of many new functionalities, imposed compromises to the order-N philosophy, but efficiency kept being one of SIESTA's strongest points.

Official website: http://www.icmab.es/siesta/

This document explains how to build Siesta 3.0-rc2 on Intel Westmere with Infiniband Network using the following software:

  • Intel Compiler 10.1 (also includes the MKL library 10.1)
  • OpenMPI 1.4.2*


* OpenMPI was build with intel 10.1, BLCR 8.2, OFED-1.5.1 and with SGE flags.

The reason of using this version of Intel Compiler is because we tested the compilation with different versions (intel 8.1, 9.1, 11.1.072) that provokes a high number of failed tests in the Test phase.

Environment Set Up


For long term builds is is recommended to use a screen session. This software allows to reattach a background session.

# screen -S siesta_3.0-rc2.ompi
# tar -xvzf siesta-3.0-rc2.tgz


Before compiling siesta, we load the modules needed to build this software. It is very popular to integrate the dependencies inside the module files. In this case, when we load the OpenMPI environment, this module also loads the Intel Compiler, BLCR and OFED modules.

# module load OpenMPI/1.4.2_intel-10.1_ofed-1.5.1_blcr-8.2
# module load  mkl/10.1
# module list
Currently Loaded Modulefiles:
1) OFED/1.5.1
2) blcr/0.8.2
3) intel/10.1
4) mkl/10.1
5) OpenMPI/1.4.2_intel-10.1_ofed-1.5.1_blcr-8.2


Build Siesta

First of all, we must enter to the Obj directory:

 cd /scratch/siesta-3.0-rc2/Obj


And run the following command to prepare the building files:

 sh ../Src/obj_setup.sh


The next step is to edit and copy the following arch.make file (in bold letter you can see the modifications):

 

#
# This file is part of the SIESTA package.
#
# Copyright (c) Fundacion General Universidad Autonoma de Madrid:
# E.Artacho, J.Gale, A.Garcia, J.Junquera, P.Ordejon, D.Sanchez-Portal
# and J.M.Soler, 1996- .
#
# Use of this software constitutes agreement with the full conditions
# given in the SIESTA license, as signed by all legitimate users.
#
SIESTA_ARCH=intel-mkl
#
# Intel fortran compiler for linux with mkl optimized blas and lapack
#
# Be sure to experiment with different optimization options.
# You have quite a number of combinations to try...
#
FC=mpif90
#
FFLAGS= -w -mp -O2  -xSSE4.2 -static-intel
FFLAGS_DEBUG= -g
FFLAGS_CHECKS= -g -O0 -debug full -traceback -C  
LDFLAGS=-Vaxlib
COMP_LIBS=
RANLIB=ranlib
#
NETCDF_LIBS=
NETCDF_INTERFACE=
FPPFLAGS_CDF=
#
MPI_INTERFACE=libmpi_f90.a
MPI_INCLUDE=/aplic/MPI/OpenMPI/1.4.2_intel-10.1_ofed-1.5.1_blcr-8.2/include/
FPPFLAGS_MPI=-DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT
DEFS_MPI= -DMPI
#
MKLPATH=/opt/intel/mkl/10.1.3.027/lib/em64t
LIBS= -L$(MKLPATH) -lmkl $(MKLPATH)/libmkl_scalapack_lp64.a $(MKLPATH)/libmkl_solver_lp64.a -Wl,--start-group $(MKLPATH)/libmkl_intel_lp64.a $(MKLPATH)/libmkl_intel_thread.a $(MKLPATH)/libmkl_core.a $(MKLPATH)/libmkl_blacs_openmpi_lp64.a -Wl,--end-group -openmp -lpthread

SYS=bsd
FPPFLAGS= $(FPPFLAGS_CDF) $(FPPFLAGS_MPI)
#
.F.o:
$(FC) -c $(FFLAGS) $(INCFLAGS)  $(FPPFLAGS) $<
.f.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS)   $<
.F90.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS)  $(FPPFLAGS) $<
.f90.o:
 $(FC) -c $(FFLAGS) $(INCFLAGS)   $<
#



____

Once we have modified the file, it's time to compile it:

 make 2>&1 | tee kkmake



When the compilation finish, we should test our compilation. For these reason we enter to Tests directory (in the same Obj directory),

 cd Tests


And we execute this command for testing it:

 make SIESTA="mpirun -np 4 /scratch/siesta-3.0-rc2/Obj/siesta" 2>&1 | tee kktest


Then in the "kktest" file you should find all the final results of the tests.

With this build and the version of compiler used, despite it, we have one failed test:

h2o_orderN

Now, it's time to compile Transiesta. Before it, copy the binaries of siesta in your destination directory (in our case we prefer to copy the entire siesta directory):

rsync -avHl --progress /scratch/siesta-3.0-rc2/   /aplic/siesta/siesta-3.0-rc2_intelmkl_10.1_ompi1.4.2


Ok, let's to compile TRANSIESTA:

 cd ../Obj

make clean (CAUTION, you will remove the siesta binary with this action, this is the reason because we compile in the scratch directory and then we copy the compilation of siesta to a destination directory)

make transiesta 2>&1 | tee kkmake_transiesta


Once finished it, we will test the transiesta binary following the instructions of the siesta's manual:

$ cd Tests/transiesta/Fast

First, it is necessary to do the electrode calculation (see below for details),

$ cd Elec
$ mkdir OUT_Test
$ cd OUT_Test
$ cp ../* .
$ transiesta elec.fast.out

Note that apart from the usual files generated by SIESTA, now you will find the elec.fast.TSHS file (in general .TSHS). This file contains the real-space Hamiltonian and Overlap matrices, together with some other information, that will be used, in the case of electrodes, to calculate the surface Green's functions.

Once the electrode file has been generated, we can perform the TRANSIESTA calculation (where the SolutionMethod flag is set to transiesta).

$ cd ../../Scat
$ mkdir OUT_TS_Test
$ cd OUT_TS_Test
$ cp ../* .
$ cp ../../Elec/OUT_Test/elec.fast.TSHS .
$ transiesta scat.fast.out

Now the two following files should have been generated, scat.fast.TSHS and scat.fast.TSDE. The first one contains, as previously mentioned, essentially the Hamiltonian and Overlap matrices, and the .TSDE file has the TRANSIESTA density matrix, the equivalent to the .DM file of SIESTA. The transmission function and the current are calculated using the tbtrans postprocessing.

Finally we can copy the transiesta binary to the destination directory:

cp -pr transiesta /aplic/siesta/siesta-3.0-rc2_intelmkl_10.1_ompi1.4.2/Obj/


The modules associated with this compilation is the following:

#%Module1.0#####################################################################
##
##

proc ModulesHelp { } {

 puts stderr "\t This module loads the environtment variables of siesta 3.0 rc2  compiled with Intel 10.1+OpenMPI 1.4.2"

}
module-whatis   "This module loads the environtment variables of siesta 3.0 rc2  compiled with Intel 10.1 +OpenMPI 1.4.2"
prepend-path    PATH            /aplic/siesta/siesta-3.0-rc2_intelmkl_10.1_ompi1.4.2/Obj
prepend-path    PATH            /aplic/siesta/siesta-3.0-rc2_intelmkl_10.1_ompi1.4.2/Pseudo/atom/
module load intel/10.1
module load mkl/10.1
module load OpenMPI/1.4.2_intel-10.1_ofed-1.5.1_blcr-8.2


Tux

do you find useful or interesting?
please, send us your feedback.
HPC Knowledge Portal Team.