CP2K

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. CP2K provides a general framework for different modeling methods such as DFT using the mixed Gaussian and plane waves approaches GPW and GAPW. Supported theory levels include DFTB, LDA, GGA, MP2, RPA, semi-empirical methods and classical force fields. CP2K can do simulations of molecular dynamics, metadynamics, Monte Carlo, Ehrenfest dynamics, vibrational analysis, core level spectroscopy, energy minimization, and transition state optimization using NEB or dimer method.

Availability and Restrictions

Versions

CP2K is available on the OSC clusters. These are the versions currently available:

VERSION Owens Pitzer Cardinal Notes
6.1* X X     (owens) gnu/7.3.0 intelmpi/2018.3
  (pitzer) gnu/4.8.5 openmpi/3.1.6-hpcx
  (pitzer) gnu/7.3.0 intelmpi/2018.3
  (pitzer) gnu/7.3.0 openmpi/3.1.4-hpcx
7.1 X X     gnu/8.4.0 intelmpi/2019.7
2022.2   X     gnu/11.2.0 openmpi/4.1.4-hpcx
2023.2     X   gcc/12.3.0 openmpi/5.0.2

You can use module spider cp2k to view available modules for a given machine. Feel free to contact OSC Help if you need other versions for your work.

Access

CP2K is available to all OSC users.

Publisher/Vendor/Repository and License Type

CP2K, GNU General Public License

Usage

IMPORTANT NOTE: You need to load the prerequisite compiler and MPI modules before you can load CP2K. To determine those modules, use module spider cp2k/{version}.
We have found some types of CP2K jobs would fail or crash nodes using cp2k.popt and cp2k.psmp from MVAPICH2 and OpenMPI builds due to unstable numerical issues. It is recommended to use Intel MPI, which is more stable unless you experience any other issue.

Usage

Set-up

CP2K usage is controlled via modules. Load one of the CP2K modulefiles at the command line, in your shell initialization script, or in your batch scripts. You need to load the prerequisite compiler and MPI modules before you can load CP2K. To determine those modules, use module spider cp2k/7.1

Batch Usage

When you log into pitzer.osc.edu you are actually logged into the login node. To gain access to the vast resources in the computing environment, you must submit your job to the batch system for execution. Batch jobs can request mutiple nodes/cores and compute time up to the limits of the OSC systems. Refer to Queues and Reservations and Batch Limit Rules for more info.  Batch jobs run on the compute nodes of the system and not on the login node. It is desirable for big problems since more resources can be used.

Interactive Batch Session

For an interactive batch session one can run the following command:

sinteractive -A <project-account> -n 1 -t 00:20:00

which requests one core (-n 1), for a walltime of 20 minutes (-t 00:20:00). You may adjust the numbers per your need.

Non-interactive Batch Job

batch script can be created and submitted for a serial or parallel run. You can create the batch script using any text editor you like in a working directory on the system of your choice. Below is the example batch script for a parallel run:

#!/bin/bash 
#SBATCH --nodes=2
#SBATCH --time=1:00:0
#SBATCH --account=<project-account>
#SBATCH --gres=pfsdir

module load  gnu/8.4.0 intelmpi/2019.7
module load cp2k/7.1
module list


cp job.inp $PFSDIR/job.inp
cd $PFSDIR
srun cp2k.popt -i job.inp -o job.out.$SLURM_JOB_ID 
cp job.out.$SLURM_JOB_ID $SLURM_SUBMIT_DIR/job.out.$SLURM_JOB_ID

This script uses the Scratch storage system, which is designed to synchronize storage across nodes temporarily, more information is available under the storage documentation in the "Further reading" section.

Known Issues

Update: 06/10/2021 
Version: 6.1

CP2K 6.1 Floating-point exception on Pitzer Cascade Lakes (48-core) node:

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:

Thid could be a bug in libxsmm 1.9.0 which is released on Mar 15, 2018 (Cascade Lake is launched in 2019). The bug has been fixed in cp2k/7.1.

Further Reading

General documentation is available from the CP2K website.
Scratch Storage documentation is available from the Storage Guide

 
Supercomputer: 
Service: