Friday 22 June 2012

Compiling cp2k in parallel

Welcome to heartbeat, coz we got life.
Compiling cp2k in parallel can be a real pain, especially with the almost site specific location of libraries on different computers/clusters or distros. So i attempted to compile cp2k on a stock distribution of CentOS 6.2. Some of the more strenuous parts of this exercise are locating the right libraries for your system. In case you do not know what you need here is a minimal list:
Blacs
Scalapack
Lapack
fftw3
So install these easy ones with the yum command

For centos the rest of the stuff is not in the default repos, but rpms for the packages exist out in the wild, so i head over to Pbone and search for the rpms using their search functionality. The end result is that you should have the following downloaded somewhere on your computer:
blacs-common-1.1-39.el6.1.x86_64.rpm
blacs-openmpi-1.1-39.el6.1.x86_64.rpm
blacs-openmpi-devel-1.1-39.el6.1.x86_64.rpm
blacs-openmpi-static-1.1-39.el6.1.x86_64.rpm
scalapack-common-1.7.5-10.el6.x86_64.rpm
scalapack-openmpi-1.7.5-10.el6.x86_64.rpm
scalapack-openmpi-devel-1.7.5-10.el6.x86_64.rpm
scalapack-openmpi-static-1.7.5-10.el6.x86_64.rpm
Next install the rpm packages using the command, and presto your good to go, though a caveat is that the order in which you install matters since the static libs require the devel libs which require the usual rpms that requires the common rpm. To solve this follow the order in which i have listed them ( commons first then the static last) you can start with scalapack if you find blacs depends on it :) . Now to the cp2k source!
If you haven't got the source, get it. Under the arch directory create a new text file named cp2k_x86-64_gfortran.popt, and make the contents look like this: and change directory to makefile and run make like this: Let it run to completion, when its done try a test with the new executable placed in Like this: Or your preferred method of running in parallel.
if it doesn't segfault, well breath a sigh of relief, and watch it run.
Here are the final few lines of my run: Well, thats all folks.

No comments:

Post a Comment