All Products
Search
Document Center

:Use CP2K to perform an MD simulation

Last Updated:Oct 31, 2024

This topic takes CP2K as an example to show how to perform a molecular dynamics (MD) simulation by using an Elastic High Performance Computing (E-HPC) cluster.

Background information

CP2K is a software package that can perform atomistic and molecular simulations of solid state, liquid, molecular, and biological systems. CP2K provides a general framework for different modeling methods, such as DFT that uses the mixed Gaussian and plane waves approaches GPW and GAPW. For more information, see CP2K.

In this topic, a molecular dynamics as a service (MDaaS) cluster is created at low cost to run CP2K for an MD simulation. Cloud services such as Object Storage Service (OSS), Cloud Architect Design Tool (CADT), Elastic Compute Service (ECS), Elastic GPU Service, and File Storage NAS are used.

Before you begin

  • Log on to the Alibaba Cloud Management Console and activate the cloud services that are used in this topic, including E-HPC, File Storage NAS, ECS, OSS, CADT, and Resource Access Management (RAM).

  • Deploy the network environment and resources. The following network settings and resources are required:

    • Region: China (Beijing).

    • CIDR block of the virtual private cloud (VPC): 192.168.0.0/16. CIDR block of the vSwitch: 192.168.0.0/24. Zone: Beijing Zone H.

    • Deployment mode of the cluster: Standard (1 logon node, 2 management nodes, and 2 compute nodes).

Procedure

The procedure for using CP2K to perform an MD simulation contains the following steps:

Step 1: Build an environment

Step 2: Create a user

Step 3: Submit a job

Step 4: Configure auto scaling

Step 1: Build an environment

  1. Log on to the CADT console.

  2. In the top navigation bar, choose New > Official Template Library New.

  3. In the upper-right corner of the page, enter EHPC MD Simulation in the search box and click Based on application creation.

  4. Double-click the 2022-04-26_17-38-47 icon. In the panel that appears, select Custom Image from the Image Type drop-down list and cp2k-20210910 from the Image drop-down list.

  5. After you configure the application architecture, click Save. In the dialog box that appears, set ApplicationName and click Confirm.

  6. Click Deploy Application.

    Note

    If the Property verification error or Verification failed message appears, you need to modify the application as prompted, and then click Save and Deploy Application again.

  7. After the verification is complete and a price is generated, select Terms of Service for Cloud Speed and click Next: Pay and Create in the Confirm order step.

    If Successful Deployment appears in the Resource deployment status step, the environment is built.

Step 2: Create a user

  1. Log on to the CADT console.

  2. In the Resource List section, click ehpc.

  3. In the left-side navigation pane of the E-HPC console, choose Resource Management > User.

  4. On the Cluster User Management tab, click Add New User.

  5. In the panel that appears, set the username, user group, and password, and then click OK.

    Note

    In this example, a sudo user named user1 is created.

Step 3: Submit a job

  1. Log on to the E-HPC console.

  2. On the Cluster page, find the cluster and click Connect.

  3. Log on to the cluster as a root user.

  4. Run the following command to associate the job files with the root user and grant permissions to the root user:

    ln -sf /root/.local/ /home/user1/
  5. Log on to the cluster as user1. In the /home/user1 directory, copy the job files.

    cp -r /root/user1/* .
  6. Run the dpgen command to submit the job:

    cd dzh/CH4
    dpgen run param.json machine.json
    Note

    • The param.json file specifies some runtime parameters and directories. You need to modify the file based on your needs.

    • The machine.json file specifies some configuration parameters and the directories of compute nodes. You need to modify the file based on your needs.

    • The log files generated for the job are stored in the /home/user1/dpgen_work directory.

  7. In the left-side navigation pane, choose Job and Performance Management > Job. On the Job page, view the status of the job.

  8. In the left-side navigation pane, click E-HPC Tune. On the ClusterView page, view the metrics of the cluster.

Step 4: Configure auto scaling

  1. Log on to the E-HPC console.

  2. In the left-side navigation pane, choose Elasticity > Auto Scale.

  3. In the Global Configurations section, configure the following parameters:

    • Enable Autoscale: Turn on Auto Grow and Auto Shrink.

    • Scale-in Time (Minute): 6.

    • Image Type: Select Custom Image and cp2k-20210910.

  4. In the Queue Configuration section, perform the following steps:

    1. Click Edit.

    2. Set Queue Compute Nodes to 0 to 100.

    3. Click Add in the Configuration List section.

    4. Configure the following parameters and click OK:

      • Zone: Beijing Zone H

      • VSwitch ID: vsw-2*************khyl

      • Instance Type: ecs.gn6***********grge

      • Bid Strategy: Auto bidding until meeting the pay-as-you-go price

    5. In the Queue Configuration panel, click OK.

  5. On the Auto Scale page, click OK.

  6. In the Phone Verification dialog box, enter a verification code and click OK.

    Note

    After you configure auto scaling, the system automatically adds or removes compute nodes based on the job. You can view the scale-out or scale-out status of the cluster on the Nodes page.