Ceci est une ancienne révision du document !


CP2K

Programme Version Compilateur Interconnexion chemin d'accès OS / Processeur modèle de configuration
cp2k.popt 2.2.426 gcc 4.6.3 openmpi-1.4.5 /usr/bin/cp2k.popt Debian7 x86_64 set_debian7-clean
modulefile : CP2K/2.2.426
cp2k.sopt 2.5.1 gcc 4.7.2 openmpi-1.4.5 /applis/PSMN/debian7/CP2K/2.5.1/gnu-4.7.2/bin/ Debian7 x86_64 set_debian7-clean
cp2k.popt 2.5.1 gcc 4.7.2 openmpi-1.4.5 /applis/PSMN/debian7/CP2K/2.5.1/gnu-4.7.2/bin/ Debian7 x86_64 set_debian7-clean
cp2k.psmp 2.5.1 gcc 4.7.2 openmpi-1.4.5 /applis/PSMN/debian7/CP2K/2.5.1/gnu-4.7.2/bin/ Debian7 x86_64 set_debian7-clean
modulefile : CP2K/2.5.1
cp2k.popt 2.5.1 Intel 14.0.1 openmpi-1.6.4 /applis/PSMN/debian7/CP2K/2.5.1/intel-14.0.1/complete-elpa/ Debian7 E5-2670 N/A
modulefile : CP2K/2.5.1-complete
cp2k.popt 2.5.1 Intel 14.0.1 openmpi-1.6.4 /applis/PSMN/debian7/CP2K/2.5.1/intel-14.0.1/minimal-elpa/ Debian7 E5-2670 N/A
modulefile : CP2K/2.5.1-minimal

Pour utiliser les modules, consulter Environment Modules

Doc users CP2K version > 3

Rush de build pour CP2K (version 3.x et sup.)

export MKLROOT="/applis/PSMN/compil/intel/v15/mkl"
module load openmpi/2.0.1-gnu-5.4.0
 
tar -xjvf cp2k-4.1.tar.bz2
cd cp2k-4.1/tools/toolchain/
 
./install_cp2k_toolchain.sh --with-mkl=/applis/PSMN/compil/intel/v15/mkl

Now copy makefiles to arch dir :

cp cp2k-4.1/tools/toolchain/install/arch/local.*opt ../../arch/

To build CP2K you must change directory:

cd ../../makefiles/
make -j 8 ARCH=local VERSION=sopt
make -j 8 ARCH=local VERSION=popt

Do NOT build several versions at the same time. Known to be buggy.

To use the installed tools and libraries and cp2k version compiled with it you will first need to execute at the prompt:

source cp2k-4.1/tools/toolchain/install/setup

cp2k.sopt and cp2k.popt are available in your $PATH.

Doc admin-sys PSMN

CP2K 2.5.1 + gcc 4.7.2

  • Makefile (patch from Debian)
Makefile1.patch
--- cp2k-orig/makefiles/Makefile
+++ cp2k/makefiles/Makefile
@@ -414,7 +414,7 @@
 #
 makedepf90:
        -test -d $(TOOLDIR)/makedepf90-build || ( mkdir makedepf90-build ; cp $(TOOLSRC)/makedepf90/* makedepf90-build )
-       { cd makedepf90-build ; ./configure --prefix=$(TOOLDIR) --bindir=$(TOOLDIR) ; $(MAKE) VERSION="2.8.8cp2k" ; $(MAKE) install ; }
+       { cd makedepf90-build ; CPPFLAGS= ./configure --prefix=$(TOOLDIR) --bindir=$(TOOLDIR) ; $(MAKE) VERSION="2.8.8cp2k" ; $(MAKE) install ; }
 
 #
 # the rule how to generate the .o from the .F
Makefile2.patch
--- cp2k-orig/makefiles/Makefile  2014-02-28 13:07:47.203872318 +0100
+++ cp2k/makefiles/Makefile       2014-02-28 13:08:10.095990024 +0100
@@ -394,7 +394,7 @@
        +$(LD) $(LDFLAGS) -o $(CP2KSHELL) cp2k_shell.o $(ALL_LIB) $(LIBS)
 
 $(FES): $(FESOBJS) graph.o 
-       +$(LD) $(LDFLAGS) -o $(FES) graph.o $(FESOBJS)
+       +$(LD) $(LDFLAGS) -o $(FES) graph.o $(FESOBJS) $(ALL_LIB) $(LIBS)
 
 # Allow the standalone DBCSR programs to compile with CUDA and/or HWTOPO
  • arch/Linux-generic-gfortran.sopt (new file from Debian)
Linux-generic-gfortran.sopt
CC         = gcc
CPP        =
FC         = gfortran
LD         = gfortran
AR         = ar -r
 
DFLAGS   = -D__GFORTRAN -D__FFTSG -D__FFTW3 $(FFTW3_ALIGN) -D__LIBINT -D__LIBXC2
CPPFLAGS = -C -traditional $(DFLAGS)
FCFLAGS  = -g -Wall -O2 -ffast-math -funroll-loops -ftree-vectorize -ffree-form -ffree-line-length-none $(DFLAGS)
LDFLAGS  = $(FCFLAGS) 
LIBS     = -llapack -lblas -lfftw3 -lint -lderiv -lxc
  • arch/Linux-generic-gfortran.popt (new file from Debian)
Linux-generic-gfortran.popt
CC         = mpicc
CPP        =
FC         = mpif90
LD         = gfortran
AR         = ar -r
 
DFLAGS   = -D__GFORTRAN -D__FFTSG -D__FFTW3 $(FFTW3_ALIGN) -D__LIBINT -D__LIBXC2 -D__parallel -D__BLACS -D__SCALAPACK
CPPFLAGS = -C -traditional $(DFLAGS)
FCFLAGS  = -g -Wall -O2 -ffast-math -funroll-loops -ftree-vectorize -ffree-form -ffree-line-length-none $(DFLAGS)
LDFLAGS  = $(FCFLAGS) $(LIB_BLACS) $(LIB_SCALAPACK) 
LIBS     = -llapack -lblas -lfftw3 -lint -lderiv -lxc -lmpi -lmpif90 -lmpif77 $(LIB_BLACS) $(LIB_SCALAPACK)
  • arch/Linux-generic-gfortran.psmp (new file from Debian)
Linux-generic-gfortran.psmp
CC         = mpicc
CPP        =
FC         = mpif90
LD         = gfortran
AR         = ar -r
 
DFLAGS   = -D__GFORTRAN -D__FFTSG -D__FFTW3 $(FFTW3_ALIGN) -D__LIBINT -D__LIBXC2 -D__parallel -D__BLACS -D__SCALAPACK
CPPFLAGS = -C -traditional $(DFLAGS)
FCFLAGS  = -g -Wall -O2 -fopenmp -ffast-math -funroll-loops -ftree-vectorize -ffree-form -ffree-line-length-none $(DFLAGS)
LDFLAGS  = $(FCFLAGS) $(LIB_BLACS) $(LIB_SCALAPACK) 
LIBS     = -llapack -lblas -lfftw3 -lfftw3_threads -lint -lderiv -lxc -lmpi -lmpif90 -lmpif77 $(LIB_BLACS) $(LIB_SCALAPACK)
  • build

à faire dans l'ordre (sopt, puis popt, puis psmp) de l'étape 3a du fichier INSTALL

> cd cp2k/makefiles
make -j 8 ARCH=Linux-generic-gfortran VERSION=sopt
make -j 8 ARCH=Linux-generic-gfortran VERSION=popt
make -j 8 ARCH=Linux-generic-gfortran VERSION=psmp

Les binaires seront dans cp2k/exe/$ARCH/cp2k.$VERSION. Ils sont semi-statique (ie: tant qu'on change pas de plateforme, on peut les placer où on veut).

Installations optimisées de CP2K

Version la plus récénte compilée avec compilateurs Intel et MKL sur les systèmes Debian

Il s'agit de la version du dépôt de développement CP2K (la plus complète au niveau des fonctionnalités).

L'installation ci-dessous a été faite à l'automne 2014 (sur la dernière révision du CP2K et avec les dernières versions de la suite Intel et OpenMPI disponibles à ce moment là).

Environnement de travail

Il faut d'abord charger l'environnement correspondant (Debian + Intel + OpenMPI) sur l'un des serveurs de compilation Debian :

   $ source /usr/local/modeles/set_debian7-clean.csh
   $ source /usr/share/modules/init/tcsh
   $ module use /applis/PSMN/Modules
   $ module load Base/psmn
   $ module load openmpi/1.6.4-intel-14.0.1

Download CP2K

   $ svn checkout svn://svn.code.sf.net/p/cp2k/code/trunk cp2k-devel-cic
   A    cp2k-devel-cic/basis_sets
   ...
   A    cp2k-devel-cic/potentials/mm_potentials/mathematica/FitPot.nb
   Révision 14631 extraite.
NEW (15 juin 2015) : La révision 15430 a été testée et fonctionne de la même façon.

Etape de "configuration"

   $ cd cp2k-devel-cic/cp2k/arch

Créer le fichier de configuration Linux-x86-64-intel-MKL.popt comme suit, afin de prendre correctement en compte les composantes BLAS, LAPACK et FFT de MKL (avec l'interface FFTw) :

# Linux-x86-64-intel-MKL.popt
#
#
CC       = cc
CPP      = 
FC       = mpif90 
LD       = mpif90
AR       = ar -r
 
MKLROOT=/softs/intel/v13/mkl
INTEL_LIB = $(MKLROOT)/lib/intel64
LIBXC_DIR = /applis/PSMN/debian7/Libs/libXC/2.0.1/intel-14.0.1-avx
 
CPPFLAGS =
DFLAGS   = -D__MKL -D__FFTW3 -D__LIBXC2 -D__parallel \
	   -D__SCALAPACK 
CFLAGS   = $(DFLAGS) 
 
FCFLAGS  = $(DFLAGS) -O2 -g -traceback -fpp -free \
           -I$(MKLROOT)/include -I$(MKLROOT)/include/fftw
FCFLAGS2  = $(DFLAGS) -O1 -g -traceback -fpp -free \
           -I$(MKLROOT)/include -I$(MKLROOT)/include/fftw
FCFLAGS3  = $(DFLAGS) -O0 -g -traceback -fpp -free \
           -I$(MKLROOT)/include -I$(MKLROOT)/include/fftw
 
LDFLAGS  = $(FCFLAGS) -static-intel
 
LIBS     = $(INTEL_LIB)/libmkl_scalapack_lp64.a \
          -L${INTEL_LIB} -lmkl_blas95_lp64 \
          -L${INTEL_LIB} -lmkl_lapack95_lp64 \
	 -Wl,--start-group  $(INTEL_LIB)/libmkl_intel_lp64.a \
	 $(INTEL_LIB)/libmkl_sequential.a \
	 $(INTEL_LIB)/libmkl_core.a \
	 $(INTEL_LIB)/libmkl_blacs_openmpi_lp64.a -Wl,--end-group \
	 -lpthread -lm \
	 -L$(LIBXC_DIR)/lib -lxc \
 
 
OBJECTS_ARCHITECTURE = machine_intel.o
 
graphcon.o: graphcon.F
	$(FC) -c $(FCFLAGS2) $<
 
qs_vxc_atom.o: qs_vxc_atom.F
	$(FC) -c $(FCFLAGS2) $<   

Etape de "build"

   $ cd ../makefiles
   $ make -j 4 ARCH=Linux-x86-64-intel-MKL VERSION=popt

Cette étape peut durer quelques dizaines de minutes (un café bien mérité est possible …).

Le binaire est ainsi généré : $HOME/cp2k-devel-cic/cp2k/exe/Linux-x86-64-intel-MKL/cp2k.popt

Test de l'installation

On peut lancer un test rapide fourni dans CP2K directement sur le serveur de compilation :

   $ cd ../tests/QS/
   $ mpirun -np 2 $HOME/.../cp2k-devel-cic/cp2k/exe/Linux-x86-64-intel-MKL/cp2k.popt C.inp

(à completer “…” pour avoir le chemin exact où cette compilation a été faite)

Regarder par exemple le temps total (la 1ère ligne “CP2K”) dans le tableau TIMING (2.928 s pour la présente compilation)

Test en conditions de production

Plusieurs jobs ont été exécutés sur des configurations fournies par des utilisateurs PSMN en utilisant les queues de production E5-2670. Les résultats ont montré un gain du temps de calcul par un facteur entre 5 et 6 par rapport aux installations génériques.

documentation/tools/software/cp2k.1481814947.txt.gz · Dernière modification : 2020/08/25 15:58 (modification externe)