Skip to main content
Texas Tech University

CP2K

Introduction

CP2K is a free, open-source (GPL) Fortran 2008 software package for quantum chemistry and solid-state physics simulations. It specializes in massively parallel, linear-scaling electronic structure calculations and ab initio molecular dynamics (AIMD).

Running CP2K in HPCC

Create a job submission script with the following content as a reference:

#!/bin/bash 
#SBATCH --job-name=cp2k_nocona
#SBATCH --output=%x.o%j 
#SBATCB --error=%x.e%j 
#SBATCH --partition=nocona 
#SBATCH --nodes=1 
#SBATCH --ntasks-per-node=128
#SBATCH --time=10:00:00 

module load gcc/14.2.0 openmpi/5.0.5 cp2k/2024.3-mpi-omp

mpirun -np $SLURM_NTASKS --bind-to core --map-by core cp2k.psmp input.inp
#!/bin/bash 
#SBATCH --job-name=cp2k_quanah 
#SBATCH --output=%x.o%j 
#SBATCB --error=%x.e%j 
#SBATCH --partition=quanah
#SBATCH --nodes=1 
#SBATCH --ntasks-per-node=36
#SBATCH --time=10:00:00 

module load gcc/14.2.0 openmpi/4.1.6 cp2k/2024.3-mpi-omp

mpirun -np $SLURM_NTASKS --bind-to core --map-by socket cp2k.psmp input.inp

Then submit this job using the sbatch command. Please make sure to edit the following Slurm parameters as needed:

Number of nodes (--nodes): If you want to scale out your job to run across multiple worker nodes.

Number of MPI tasks (--ntasks-per-node): We recommend setting this parameter to the maximum number of available CPU cores per node on each partition.

Wall time (--time): If your job won’t take longer than 10 hours, leave it as it is. Adjust the wall time based on how long you estimate your job will take.


Please contact HPCC support at hpccsupport@ttu.edu if you have any questions.