跳到主要内容

CP2K

This article introduces how to run CP2K jobs on Bohrium.

Introduction

CP2K is the fastest open-source software for first-principles materials calculation and simulation. It can study large systems with thousands of atoms and is widely used in the simulation of solids, liquids, molecules, periodic, materials, crystals, and biological systems. It was initiated by the Max Planck Research Center in 2000 as a project for solid-state physics research, and all the code is written in Fortran 2003. It is now maintained by ETH Zurich and the University of Zurich as an open-source project that follows the GPL license. Users can download the source code from its official website. This tutorial mainly introduces how to run CP2K calculation jobs on the Bohrium platform.

How to run CP2K jobs on Bohrium

The running time of this case job is about 1 min 30 s.

Step 1: Prepare input data

First, you need to enable the management node, and select the ubuntu:20.04-py37 image in this case. After connecting to the management node through the Web Shell, you can start preparing the input files.

Take methane and the personal directory as an example. The input files of CP2K are all stored in the Bohrium_CP2K_example folder. After entering the data disk with the cd /personal command, execute the following commands in sequence to download and unzip the input files:

wget https://bohrium-example.oss-cn-zhangjiakou.aliyuncs.com/Bohrium_CP2K_example.zip
unzip Bohrium_CP2K_example.zip
cd Bohrium_CP2K_example

Step 2: Prepare configuration file

The configuration file job.json is already included in the folder. In the Files Management page , you can double-click the job.json file in the left file tree to edit and save it online. You can also edit it in the command-line window:

vi job.json

Enter i to enter edit mode, after completing the modification, press esc to exit edit mode and enter : to enter the command-line mode, then enter wq to save and exit. The content of the configuration file is as follows:

Note: Replace the 0000 after "project_id": with your own project ID, which can be viewed on the "Project Management" page.

{
"job_name": "CP2K_Si_opt",
"command": "source /cp2k-7.1/tools/toolchain/install/setup && mpirun -n 16 --allow-run-as-root --oversubscribe cp2k.popt -i input.inp -o output.log",
"log_file": "output.log",
"backward_files": ["output.log"],
"project_id": 0000,
"platform": "ali",
"job_type": "container",
"machine_type": "c16_m32_cpu",
"image_address": "registry.dp.tech/dptech/cp2k:7.1"
}

Step 3: Submit the job Submit the job using Bohrium CLI : Therefore, you first need to install the Bohrium CLI.

bohr job submit -i job.json -p ./

Where:

  • -i specifies the configuration file of the job, which is job.json in this case
  • -p specifies the directory where the input files are located, Bohrium will package and upload the specified directory, unzip it on the computing node, and switch the working directory to that directory. In this case, it is ./

If you see the following output in the command line, it means the submission is successful. You can also see the JOB ID of the job, which can be used to track the progress of the job later.

Submit job succeed. 
JobId: <JOB ID>
JobGroupId: <JOB GROUP ID>

Check the job

You can learn how to check the job status on the Bohrium platform in the Monitor jobs Documentation.

Download results

You can learn how to download job results on the Bohrium platform in the Results Download Documentation.