problems to compile and run the parallel version of cp2k with g95 compiler and mpich

hawk2012 hawk2... at
Thu Jul 17 03:43:03 CEST 2008

Dear All:

I just successfully compiled and tested the serial version of cp2k
using the recommended compiler g95. Now, I am moving on to the next
step to compile the parallel version of cp2k with g95 and mpich.
Following the INSTALL instructutions, I dowloaded mpich-1.2.6.tar.gz
and compiled it by setting FC=g95 and F90=g95 to generate the g95
version of mpich under /home/mpich.g95. Then I downloaded
scalapack-1.8.0.tgz. Its README file says  the BLAS, BLACS and LAPACK
libraries should be available before compiling scalapack. Since BLAS
and LAPACK have been installed during installation of serial version
of cp2k, only BLACS needs to be installed. So, I downloaded
mpiblacs.tgz and mpiblacs-patch03.tgz and successfully compiled
blacsCinit_MPI-LINUX-0.a, blacs_MPI-LINUX-0.a,
blacsF77init_MPI-LINUX-0.a by setting F77=g95 in file
However, I noticed that file used to compile scalapack also specified
libatlas.a. I guess ATLAS library should also be installed before
installing scalapack. Therefore, I downloaded atlas3.6.0.tgz and
compiled library libatlas.a. After specifying the locations of all
necessary libraries and mpi compilers I successfully compiled the
library libscalapack.a.
Finally I modified the Linux-x86-64-g95.popt as below:
CC       = cc
CPP      =
FC       = /home/mpich.g95/bin/mpif90
LD       = /home/mpich.g95/bin/mpif90
AR       = ar -r
DFLAGS   = -D__G95 -D__FFTSG -D__parallel -D__BLACS -D__SCALAPACK -
FCFLAGS  = $(DFLAGS) -ffree-form -O2 -ffast-math -march=opteron -cpp -
LIBS     = /home/scalapack/scalapack-1.8.0/libscalapack.a \
           /home/BLACS/LIB/blacsF77init_MPI-LINUX-0.a \
           /home/BLACS/LIB/blacs_MPI-LINUX-0.a \
           /home/BLACS/LIB/blacsCinit_MPI-LINUX-0.a \
           /home/lapack-3.1.1/lapack_LINUX.a \
           /home/GotoBLAS/libgoto.a \
           /home/fftw/lib/libfftw3.a \
           /home/libint/lib/libderiv.a \
           /home/libint/lib/libint.a \

After entering cp2k/makefiles directory I typed 'make ARCH=Linux-
x86-64-g95 VERSION=popt' to compile the parallel version of cp2k. The
compiling process went well except a few warnings. However an error
was reported during the final linking stage:
ar: creating /home/cp2k2.0/cp2k/makefiles/../lib/Linux-x86-64-g95/popt/
/home/mpich.g95/bin/mpif90 -D__G95 -D__FFTSG -D__parallel -D__BLACS -
D__SCALAPACK -D__FFTW3 -D__LIBINT -ffree-form -O2 -ffast-math -
march=opteron -cpp -g -D__COMPILE_ARCH="\"Linux-x86-64-g95\"" -
D__COMPILE_DATE="\"Wed Jul 16 16:48:23 CDT 2008\"" -
D__COMPILE_HOST="\"dmol8\"" -D__COMPILE_LASTCVS="\"/qs_scf_types.F/
1.32/Mon Jul  7 22:07:02 2008//\"" -o /home/cp2k2.0/cp2k/makefiles/../
exe/Linux-x86-64-g95/cp2k.popt cp2k.o /home/cp2k2.0/cp2k/makefiles/../
lib/Linux-x86-64-g95/popt/libcp2k_lib.a /home/cp2k2.0/cp2k/
makefiles/../lib/Linux-x86-64-g95/popt/libcp2k_fft_lib.a /home/cp2k2.0/
cp2k/makefiles/../lib/Linux-x86-64-g95/popt/libcp2k_base_lib.a  /home/
scalapack/scalapack-1.8.0/libscalapack.a /home/BLACS/LIB/
blacsF77init_MPI-LINUX-0.a /home/BLACS/LIB/blacs_MPI-LINUX-0.a /home/
lapack-3.1.1/lapack_LINUX.a /home/GotoBLAS/libgoto.a /home/fftw/lib/
libfftw3.a /home/libint/lib/libderiv.a /home/libint/lib/libint.a /usr/
/home/GotoBLAS/libgoto.a(blas_server.o)(.text+0x5b5): In function
: undefined reference to `pthread_create'
/home/GotoBLAS/libgoto.a(blas_server.o)(.text+0xa7d): In function
: undefined reference to `pthread_join'
make[1]: *** [/home/cp2k2.0/cp2k/makefiles/../exe/Linux-x86-64-g95/
cp2k.popt] Error 1
make[1]: Leaving directory `/home/cp2k2.0/cp2k/obj/Linux-x86-64-g95/
make: *** [build] Error 2

It seemed that libgoto.a has some problem this time although I used it
to compile cp2k.sopt successfully this morning. Then I replaced the
libgoto.a library with the standard BLAS library /home/BLAS/
blas_LINUX.a obtained by compiling the package blas.tgz. After this
change the linking process succeeded and the executable cp2k.popt was
generated. However, problem appeared when I tried to test cp2k.popt
with the same input file H2O.inp I used to test cp2k.sopt. After
typing 'home/mpich.g95/bin/mpirun -np 2 ./cp2k.popt ./H2O.inp > log &'
I got the following error message in the log file:
 CP2K: An error occurred opening the file </home/cp2k2.0/cp2k/tests/
MD> with the unit number      1 (IOSTAT =     21)
However, the test case can be run normally if I issued the command './
cp2k.popt ./H2O.inp > log &'. It seemed that cp2k.popt is still an
serial version of cp2k although I compiled it with parallel settings.
Any idea?

More information about the CP2K-user mailing list