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.

Policy

CP2K is freely available to users at HPC2N under the GPL license.

Citations

When performing simulations with CP2K, the developer team kindly asks you to acknowledge their work by citing the articles in the “REFERENCES” section in the output. This section lists the scientific articles that describe the specific modules and methods used in the calculation.

In cases where a detailed list of references is not appropriate, we recommend citing the latest relevant CP2K review. As of May 2020, this is 10.1063/5.0007045.

Overview

CP2K is a freely available (GPL) program, written in Fortran 95, to perform atomistic and molecular simulations of solid state, liquid, molecular and biological systems. It provides a general framework for different methods such as e.g. density functional theory (DFT) using a mixed Gaussian and plane waves approach (GPW), and classical pair and many-body potentials.

CP2K provides state-of-the-art methods for efficient and accurate atomistic simulations, sources are freely available and actively improved.

It can be compiled for different platforms and compilers, and for serial, MPI, OpenMP, and hybrid MPI/OpenMP jobs.

Usage at HPC2N

On HPC2N we have CP2K available as a module.

Loading

To use the CP2K module, add it to your environment. You can find versions with

module spider CP2K

and you can then find how to load a specific version (including prerequisites), with

module spider CP2K/<VERSION>

Loading the module should set any needed environmental variables as well as the path.

Note

When the CP2K modules is loaded, you can see which executables are available by looking in the $EBROOTCP2K/bin directory, as it varies between versions what it has been compiled for.

Running

In order to run a case, you should stand inside the case directory in order to be able to read any data files (parameters etc.) associated with the input-file.

Examples can be found in $EBROOTCP2K/tests when the module has been loaded.

Examples - MPI

MPI-jobs should be run as batch-jobs. The executable is named

cp2k.popt

Make a batch-script similar to this example:

#!/bin/bash
# Project to run under
#SBATCH -A hpc2nXXXX-YYY
# Name of job script 
#SBATCH -J My_CP2K_job
# name of the output file
#SBATCH --output=My_CP2K_job.out
# name of the error file
#SBATCH --error=My_CP2K_job.err

# asking for 8 cores
#SBATCH -n 8
# the job may to use up to 30 minutes to run
#SBATCH --time=00:30:00

# Load the CP2K module - 7.1 in this example  
ml iccifort/2020.1.217  impi/2019.7.217
ml CP2K/7.1

# run the job
srun cp2k.popt <yourfile.inp>

Submit it with

sbatch <jobscript>

where <jobscript> is the name you give your batch-script. Remember to submit from your case-directory.

Note

You can get more information about various flags (for instances, setting input and output files), by running

cp2k.popt -help

when you have loaded the CP2K module.

Additional info

More information can be found