Sie befinden sich im Service: RWTH Compute Cluster Linux (HPC)

CP2K

CP2K

Kurzinformation

CP2K is a quantum chemistry and solid state physics software package that can perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems.


 Detailinformation 

1. General Information 

Following executables are available: cp2k.* cp2k_shell.* dbcsr_example_1.* dbcsr_example_2.* dbcsr_example_3.* dbcsr_performance_driver.* dbcsr_test_csr_conversions.* dbcsr_test_driver.* graph.*

In the HPC Cluster, CP2K is usually build in multiple versions.  By default an actual Intel compiler and Open MPI are used. Following versions are available:

  1. '*.sopt' - serial version
  2. '*.ssmp' - OpenMP-parallelised version
  3. '*.popt' - MPI-parallelised version
  4. '*.psmp' - MPI- and OpenMP-paralleised (hybride) version

That means, for serial version of CP2K you call cp2k.sopt binary, and for hybrid (MPI+OpenMP) cp2k.psmp

The Data directory path has been set using $CP2K_DATA_DIR environment variable. Change/unset if needed.

MPI or OpenMP or hybrid? Hear The Master's voice: https://www.cp2k.org/faq:mpi_vs_openmp and note that

  • the GCC+Intel MKL '*.ssmp' and '*.psmp' deny support of multithreaded operation: "STOP Intel's FFTW3 interface to MKL is not thread-safe prior to MKL 11.1.0!  Please rebuild CP2K, linking against FFTW 3 from www.fftw.org or a newer version of MKL. Now exiting..." regardless the fact that MKL 11.3 is linked. Thus, these versions are effectively not usable for GCC compiled version. Switch to Intel's versions.
  • the intel/16.0 versions of '*.ssmp' and '*.psmp' fail with SIGSEGV's in some cases when running multithreaded; switch to intel/14.0 or intel/15.0 versions.

MPI versions are all using ScaLAPACK (cf. https://groups.google.com/forum/#!msg/cp2k/JWp3b3eNLtk/Lstgh4fh3wQJ ) from Intel MKL, thus you have to load the LIBRARIES and intelmkl modules when using version compiled with compiler other than Intel. You must not load additional module when using Intel version as a release of Intel MKL is bundled to the compilers.

2. How to access the software

$ module load CHEMISTRY
$ module load cp2k
 

3. Example batch scripts 

a. serial job

#!/usr/local_rwth/bin/zsh
 
### Request memory and stack space
#SBATCH --mem-per-cpu=3900M
  
### load modules
module load CHEMISTRY
module load cp2k
  
# start non-interactive batch job
cp2k.sopt U.inp

b. OpenMP parallel job; GCC-compiled version

#!/usr/local_rwth/bin/zsh
 
### Request memory you need for your job in MB
#SBATCH --mem-per-cpu=2200M
 
# Request 24 threads
#SBATCH --cpus-per-task=24
 
### load modules
module switch intel gcc
module load CHEMISTRY LIBRARIES
module load cp2k      intelmkl
 
# start non-interactive batch job
 cp2k.ssmp U.inp

c. MPI parallel job

#!/usr/local_rwth/bin/zsh
  
###  12 processes, all on one node
#SBATCH --nodes=1
#SBATCH --ntasks=12
  
### Limit for maximum memory per slot (in MB)
#SBATCH --mem-per-cpu=3900
  
### The time limit for the job in minutes (reaching this time limit, the process is signaled and killed)
#SBATCH --time=80
  
### load the necessary module files
module load CHEMISTRY
module load cp2k
  
### start the MPI binary
$MPIEXEC $FLAGS_MPI_BATCH cp2k.popt U.inp

d. Hybrid (MPI+OpenMP) parallel job (two nodes, no BCS)

#!/usr/local_rwth/bin/zsh
  
### Hybrid Job with 4 MPI Processes in groups to 24 threads per process
#SBATCH --ntasks=4
#SBATCH --cpus-per-task=24
 
 
#################
# ATTENTION !!! #
#################
# Divide the needed memory per task through the cpus-per-task, as slurm requests memory per cpu, not per task !
# Example:
# You need 24 GB memory per task, you have 24 cpus per task ordered
# order 24GB/24 -> 1G memory per cpu (i.e., per thread)
#SBATCH --mem-per-cpu=1850
  
### The time limit for the job in minutes (reaching this time limit, the process is signaled and killed)
#SBATCH --time=80
 
 
### load the necessary module files
module load CHEMISTRY
module load cp2k
  
### start the hybrid binary
$MPIEXEC $FLAGS_MPI_BATCH cp2k.psmp U.inp

Zusathinweise

  • https://www.cp2k.org/
  • CP2K is a Fortran program and Fortran programs (especially OpenMP programs) are known to consume a lot of stack space. As now the default stack limit is set to 'unlimited' you do not need to issue any additional command.
  • note the limitations of 'ssmp' and 'psmp' versions (see above).
  • The 'sopt' and 'popt' versions of release 3.0 are regression-tested with none failures. Version 2.6.2 and 5.1 is not regression-tested.
  • Due to compiler bugs it was not possible to build CP2K version 5.1 using Intel compilers 16 and older. Switch to version 17 or (recommended) 18, or GCC compilers.
  • Due to bugs about C++-bindings it was not not possible to build CP2K version 5.1 with Open MPI version 1.10.x (all compilers). Use Intel MPI.

zuletzt geändert am 29.01.2021

Wie hat Ihnen dieser Inhalt geholfen?

Creative Commons Lizenzvertrag
Dieses Werk ist lizenziert unter einer Creative Commons Namensnennung - Weitergabe unter gleichen Bedingungen 3.0 Deutschland Lizenz