跳到主要内容

LAMMPS

This article introduces how to run LAMMPS jobs on the Bohrium platform.

Introduction

LAMMPS is a classical molecular dynamics (MD) code used for simulating collections of particles in liquid, solid, or gaseous states. It can model atoms, polymers, biomolecules, solids (metals, ceramics, oxides), particles, coarse-grained, or macroscopic systems using various interatomic potentials (force fields) and boundary conditions. It can model 2D or 3D systems containing only a few particles up to millions or even billions.

For more information about LAMMPS, please refer to https://docs.lammps.org/

How to run LAMMPS jobs on Bohrium

The job in this case takes approximately 1 minute to run

Step 1, prepare to input data

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

The input files for LAMMPS are stored in the Bohrium_LAMMPS_example folder. After entering the data disk using the cd /personal command, execute the following commands in sequence to download and extract the input files:

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

Step 2: Prepare the configuration file

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

vi job.json

Enter the edit mode by typing i, make the changes, then press esc to exit edit mode. Type : to enter command-line mode, and then type 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": "lammps_tutorial",
"job_type": "container",
"command": "mpirun -n 32 lmp_mpi -i in.shear > log",
"log_file": "log",
"backward_files": [],
"project_id": 0000,
"platform": "ali",
"machine_type": "c32_m64_cpu",
"image_address": "registry.dp.tech/dptech/lammps:29Sep2021"
}

Step 3, submit the job

To submit a job using the Lebesgue utility:

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

In this case:

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

If you see the following output in the command line, it means that 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. JOB GROUP ID: <JOB GROUP ID>, JOB ID: <JOB ID>

View Jobs

You can learn how to view job status on the Bohrium platform in the Monitoring Jobs Document.

Download Results

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