25 July 2015

615. SIESTA on debian jessie with intel mkl and ifort

It's pretty similar to what I described in http://verahill.blogspot.com.au/2015/07/614-siesta-with-mpi-on-debian-jessie.html, with the main differences being the SCALAPACK, FC, BLACS and BLAS settings in arch.make

I presume that (the sadly no longer free for non-US academics) MKL was set up as shown here: http://verahill.blogspot.com.au/2013/06/465-intel-mkl-math-kernel-library-on.html

I haven't run all the tests on the build yet, but most of the ones that I tried worked, with the exception of the benzene test which came out with "Failure to converge standard eigenproblem", which is described here: http://departments.icmab.es/leem/siesta/Documentation/Manuals/manual-2.0/node47.html and isn't due to the build parameters.

NOTE: this doesn't work on mkl version 2013.sp1.3.174 as the blacs openmpi lib is missing. It does work on 2013.3.163, which is the version I used below. I have no idea why the libraries supplied with mkl are so different.

Follow
sudo apt-get install libopenmpi-dev
sudo mkdir /opt/siesta
sudo chown $USER /opt/siesta
cd /opt/siesta
wget http://departments.icmab.es/leem/siesta/CodeAccess/Code/siesta-3.2-pl-5.tgz
tar xvf siesta-3.2-pl-5.tgz
cd siesta-3.2-pl-5/Obj
sh ../Src/obj_setup.sh
../Src/./configure --enable-mpi

Edit arch.make:
# # 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. # .SUFFIXES: .SUFFIXES: .f .F .o .a .f90 .F90 SIESTA_ARCH=x86_64-unknown-linux-gnu--unknown FPP= FPP_OUTPUT= FC=ifort RANLIB=ranlib SYS=nag SP_KIND=4 DP_KIND=8 KINDS=$(SP_KIND) $(DP_KIND) FFLAGS=-g -O2 FPPFLAGS= -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT LDFLAGS= ARFLAGS_EXTRA= FCFLAGS_fixed_f= FCFLAGS_free_f90= FPPFLAGS_fixed_F= FPPFLAGS_free_F90= BLAS_LIBS=-L/opt/intel/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential LAPACK_LIBS=dc_lapack.a liblapack.a BLACS_LIBS=/opt/intel/mkl/lib/intel64/libmkl_blacs_openmpi_lp64.a SCALAPACK_LIBS=-L/opt/intel/mkl/lib/intel64 -lmkl_scalapack_lp64 COMP_LIBS=dc_lapack.a liblapack.a libblas.a NETCDF_LIBS= NETCDF_INTERFACE= MPI_LIBS= -L/usr/lib/openmpi/lib -lmpi -lmpi_f90 -lmpi_f77 LIBS=$(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(NETCDF_LIBS) $(MPI_LIBS) -lpthread #SIESTA needs an F90 interface to MPI #This will give you SIESTA's own implementation #If your compiler vendor offers an alternative, you may change #to it here. MPI_INTERFACE=libmpi_f90.a MPI_INCLUDE=/usr/lib/openmpi/include #Dependency rules are created by autoconf according to whether #discrete preprocessing is necessary or not. .F.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $< .F90.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $< .f.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f) $< .f90.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $<
Then build:
make

You can edit Tests/test.mk to make sure that it's pointing to your siesta executable (or make a symlink to siesta in /opt/siest/siesta-3.2-pl-5/) and that it uses mpirun and the appropriate number of threads.

Then run make in Tests/ to run all the tests.

24 July 2015

614. SIESTA with MPI and acml on debian jessie

One of my students might be using SIESTA for some simulations, and a first step towards that is to set it up on my cluster.

This isn't an optimised build -- right now I'm just looking at having a simple parallell build that runs.

I had a look at http://www.pa.msu.edu/people/tomanek/SIESTA-installation.html and http://pelios.csx.cam.ac.uk/~mc321/siesta.html.
 
NOTE: don't use the int64 acml or openblas BLAS libs, or you'll get SIGSEV due to invalid memory reference when running. NWChem is the complete opposite, and for some reason both the int64 and regulat acml libs have the same names. Not sure how that's supposed to work out on a system with nwchem, which needs the int64 libs.

See here for acml on debian. I've got /opt/acml/acml5.3.1/gfortran64_int64/lib in my /etc/ld.so.conf.d/acml.conf on behalf of nwchem.
 Being lazy, I opted for the debian scalapack and libblacs packages:
 
sudo apt-get install libscalapack-mpi-dev libblacs-mpi-dev libopenmpi-dev

To get the link to the SIESTA code, go to http://departments.icmab.es/leem/siesta/CodeAccess/selector.html

Then, if you're an academic, you can do:
sudo mkdir /opt/siesta
sudo chown $USER /opt/siesta
cd /opt/siesta
wget http://departments.icmab.es/leem/siesta/CodeAccess/Code/siesta-3.2-pl-5.tgz
tar xvf siesta-3.2-pl-5.tgz
cd siesta-3.2-pl-5/Obj
sh ../Src/obj_setup.sh
*** Compilation setup done. *** Remember to copy an arch.make file or run configure as: ../Src/configure [configure_options]
../Src/./configure --help
`configure' configures siesta 2.0 to adapt to many kinds of systems. Usage: ./configure [OPTION]... [VAR=VALUE]... [..] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'. [..] --enable-mpi Compile the parallel version of SIESTA --enable-debug Compile with debugging support --enable-fast Compile with best known optimization flags Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-netcdf=<lib> use NetCDF library --with-siesta-blas use BLAS library packaged with SIESTA --with-blas=<lib> use BLAS library --with-siesta-lapack use LAPACK library packaged with SIESTA --with-lapack=<lib> use LAPACK library --with-blacs=<lib> use BLACS library --with-scalapack=<lib> use ScaLAPACK library [..]
../Src/./configure --enable-mpi
checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu [..] checking for mpifc... no checking for mpxlf... no checking for mpif90... mpif90 checking for MPI_Init... no checking for MPI_Init in -lmpi... yes [..] checking for sgemm in /opt/openblas/lib/libopenblas.so... yes checking LAPACK already linked... yes checking LAPACK includes divide-and-conquer routines... yes configure: using DC_LAPACK routines packaged with SIESTA due to bug in library. Linker flag might be needed to avoid duplicate symbols configure: creating ./config.status config.status: creating arch.make
Edit arch.make:
# # 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. # .SUFFIXES: .SUFFIXES: .f .F .o .a .f90 .F90 SIESTA_ARCH=x86_64-unknown-linux-gnu--unknown FPP= FPP_OUTPUT= FC=mpif90 RANLIB=ranlib SYS=nag SP_KIND=4 DP_KIND=8 KINDS=$(SP_KIND) $(DP_KIND) FFLAGS=-g -O2 FPPFLAGS= -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT LDFLAGS= ARFLAGS_EXTRA= FCFLAGS_fixed_f= FCFLAGS_free_f90= FPPFLAGS_fixed_F= FPPFLAGS_free_F90= BLAS_LIBS=-L/opt/acml/acml5.3.1/gfortran64/lib -lacml LAPACK_LIBS= BLACS_LIBS=-L/usr/lib -lblacs-openmpi -lblacsCinit-openmpi SCALAPACK_LIBS=-L/usr/lib -lscalapack-openmpi COMP_LIBS=dc_lapack.a NETCDF_LIBS= NETCDF_INTERFACE= MPI_LIBS= -L/usr/lib/openmpi/lib -lmpi -lmpi_f90 LIBS=$(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(NETCDF_LIBS) $(MPI_LIBS) -lpthread #SIESTA needs an F90 interface to MPI #This will give you SIESTA's own implementation #If your compiler vendor offers an alternative, you may change #to it here. MPI_INTERFACE=libmpi_f90.a MPI_INCLUDE=. #Dependency rules are created by autoconf according to whether #discrete preprocessing is necessary or not. .F.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $< .F90.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $< .f.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f) $< .f90.o: $(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $<
make
cd ../
ln -s Obj/siesta siesta

I added /opt/siesta/siesta-3.2-pl-5 to $PATH.

To test, edit /opt/siesta/siesta-3.2-pl-5/test.mk:
6 #SIESTA=../../../siesta 7 SIESTA=mpirun -n 2 ../../../siesta
Then
cd /opt/siesta/siesta-3.2-pl-5/Tests/h3po4_2
export LD_LIBRARY_CONFIG=/opt/acml/acml5.3.1/gfortran64/lib 
make
>>>> Running h3po4_2 test... ==> Copying pseudopotential file for H... ==> Copying pseudopotential file for O... ==> Copying pseudopotential file for P... ==> Running SIESTA as mpirun -n 2 ../../../siesta ===> SIESTA finished successfully

Also, look at work/h3po4_2.out:
* Running on    2 nodes in parallel
>> Start of run:  24-JUL-2015  21:58:13

                           ***********************       
                           *  WELCOME TO SIESTA  *       
                           ***********************       

reinit: Reading from standard input
[..]
elaps:  optical           1       0.000       0.000     0.00
  
>> End of run:  24-JUL-2015  21:58:20

07 July 2015

613. Debian Jessie: Turn off update pop-ups in gnome, and switching to lxterminal, nemo and ksnapshot

I originally installed the OS on my desktop back 2010 (Lenny) and haven't treated it very nicely (mixed releases, repos and have in general been installing, uninstalling and replacing packages with my own compiled ones -- and have fiddled with a few too many things) so when I was beginning to have issues on my desktop when compiling ECCE -- issues that weren't present on any other systems that were freshly installed -- I decided to start over again and install debian anew. I went straight for Debian Jessie, although I had many reasons to stay with Wheezy, such as systemd and, more importantly, the fact that Sun GridEngine is completely missing in Debian Jessie! See here.

Luckily the debian wheezy package works quite well on jessie -- but that's pure luck. I'm currently on the fence between hoping that SGE continues to work well until the SID version trickles down to backports (IF it does),  or whether to learn how to set up SLURM instead.

Either way, here are a few things that annoyed me in Jessie (more specifically they annoyed me in GNOME) and that had to be fixed:

* Turn off update notifications
I hate being bugged by notifications about updating/upgrading my system. I'm not running windows -- it's unbecoming of a linux desktop to behave like that.

To fix it, go to Settings, Personal/Notifications and untick Package Updater

(simple -- you just need to know it's there)

* Nautilus doesn't do extra pane anymore. Bye bye nautilus.
Instead, install nemo, which is the rigthful heir to nautilus. It pulls in a lot of dependencies, but it's worth it.

To make nemo default do
me@beryllium:$ xdg-mime query default inode/directory
org.gnome.Nautilus.desktop
me@beryllium:$ xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
me@beryllium:$ xdg-mime query default inode/directory
nemo.desktop
* Gnome-terminal doesn't do transparency anymore. Bye bye gnome-terminal.
Instead, install lx-terminal. To set it as default in both the OS and gnome, in the terminal do
gsettings set org.cinnamon.desktop.default-applications.terminal exec lxterminal
sudo update-alternatives --config x-terminal-emulator
* Adding firefox and thunderbird to default applications
I also felt compelled to install firefox and add it to the list over available applications in gnome so I could set it as the default browser Edit /var/lib/dpkg/alternatives/x-www-browser so that it reads
 auto
/usr/bin/x-www-browser
x-www-browser.1.gz
/usr/share/man/man1/x-www-browser.1.gz

/usr/bin/chromium
40

/usr/bin/firefox-bin
70

/usr/bin/iceweasel
70
/usr/share/man/man1/iceweasel.1.gz
I also followed this post: http://verahill.blogspot.com.au/2013/11/530-briefly-adding-new-entry-to-default.html
For thunderbird, I only followed the latter post.

* To disable screen saver completely:
gsettings set org.gnome.settings-daemon.plugins.power active false 
* I've got no idea how to elegantly exorcise bijiben-shell-search-provider, which keeps making my CPU usage spike. It's not nice.

* Note that dragging windows no longer works with Alt+left click -- instead use the windows key (Super key). Why this old standard behaviour got nuked I don't understand.

* I installed ksnapshot and set it as the default for prtn scrn instead of the crippled gnome-screenshot. Yes, it pulls in a lot of dependencies, but it's worth it.

Looking at the list above I'm slowly realising that it's probably time to say goodby to gnome for good. It's not going to a place where I want to follow it.

Pity.

There are a few things that I like about gnome 3. Well, there's a single thing that I like that got introduced: quickly searching for programs in the Activities Overview. Turns out that the applications menu wasn't that necessary after all.

The removal of features from nautilus, screenshot, terminal etc annoys me a lot though. Same goes for the removal of the minimize button.

Finally, I only find gnome useable once I've installed the gnome extensions by frippery. Stock gnome is useless to me.