Running pwscf/Quantum ESPRESSO on Beowulf like clusters

Running pwscf/Quantum ESPRESSO on Beowulf like clusters



This post may be helpful for beginners for using pwscf/ quantum espresso on Beowulf like Linux clusters. This post assumes that you have already built or have an access to it. In case you want to build it one, click here, but this need some changes and some tricks involved, which I will be posting next.

To successfully run pwscf/ quantum espresso on cluster we need to follow new steps
1) Installing necessary libraries and openmpi
2) Installing pwscf/ quantum espresso
3) configuring ssh for mpi to access other nodes without password
4) Putting pseudo potential file on all nodes
5) executing the pwscf/ quantum espresso for calculation

From here we will take one by one

Step 1) Installing necessary libraries and openmpi

I have used Ubuntu hence I will use apt-get for installing form terminal, if you have other distribution you can follow as recommended.

sudo apt-get install openmpi-bin openmpi-common libopenmpi1.6 libopenmpi-dev

this will install the open mpi on the node with Internet connection. In case you were not able to configuring Internet access to slave nodes you can downloaded the packages and install by using dpkg

apt-get download  openmpi-bin openmpi-common libopenmpi1.6 libopenmpi-dev

this command will download the deb package

sudo dpkg -i *.deb

this command will install all the deb files in the directory.
Here is the list of libraries required for successful compiling of pwscf/quantum espresso and here is the deb files for Ubuntu 14.04.

step 2) Installing pwscf/ quantum espresso

pwscf/ quantum espresso have a very good documentation pleas follow it for successful installation. Here I am just summarizing it. Unpack the zip file downloaded from here to /home/user, user=user home folder in every node. I have used espresso-5.1 but use the latest stable version. Configure and compile necessary packages.  In terminal type

sudo mv espresso-5.1 ..

now your espresso path is /home/espresso-5.1, earlier the path was /home/user/espresso-5.1.
Make sure path to espresso-5.1 is same in all the nodes.

3) configuring ssh for mpi to access other nodes without password
This is very easy step
type  ssh-keygen -t dsa in master node
rename the id_dsa.pub file as authorized_keys then copy this file to /home/user/.ssh folder of slave nodes. By this you can ssh to slave nodes without password. 

4) Putting pseudo potential file on all nodes

Putting the pseudo potential file in all the nodes is necessary to successfully run the pwscf/ quantum espresso in parallel.
In pwscf/ quantum espresso input file I have defined the

pseudo_dir = ./

then pwscf expects the pseudo file in the home directory because ssh user@000.000.0.00 (executed by mpi in this case and also in the every case) will take you to user home folder.
I have put my pseudo files in user home folders of slave nodes (~/) and kept pseudo_dir = ./ . In case you put pseudo files at different place make sure path to pseudo file is same in all the nodes.

5)  executing the pwscf/ quantum espresso for calculation

pwscf/ quantun espresso can be executed for calculation by script file or also by appending the input file. Nothing is changed here it is same as in the desktop computer but with additional step.
Make a file named mpi_hosts in this file give the details of the hosts. My mpi_hosts file is like this

localhost slots=4
cocatalyst@192.168.2.3 slots=4
cocatalyst@192.168.2.4 slots =4


Note: My master node user name is different than the slave nodes. If the user name of the slave nodes and master nodes are same then only mentioning ip is enough.

you can run the calculation by executing the pw.x command as

mpirun -np 12 --hostfile  mpi_hosts /home/espresso-5.1/bin/pw.x -nk x -npool y <./inputfile.in > outputfile.out

Here -nk x is number of k points for parallelization and -npool is the number of pool for k point parallelization. Refer quantum espresso user guide for more information on parallelization and for utilizing advantage of parallelization. 


I have referred  following links to prepare this
1) http://techtinkering.com/2009/12/02/setting-up-a-beowulf-cluster-using-open-mpi-on-linux/
2) http://www.ps3cluster.umassd.edu/step3mpi.html
3) http://msmunir-ina.blogspot.kr/2013/12/hands-on-lab-session-5.html

Comments

Popular posts from this blog

Easy and efficient way of creating surface/slabs for pwscf/quantum espresso