跳到主要内容

TBPLaS

This article introduces how to submit TBPLaS jobs in Bohrium.

Introduction

TBPLaS is a computational physics software for studying large-scale condensed matter physics systems based on the tight-binding approximation, developed by Professor Yuan Shengjun's research group at Wuhan University. The software mainly relies on the linear-scaling TBPM method developed by the research group, which calculates the electrical, optical, transport, and plasmonic properties of solid-state electronic systems by simulating the time evolution of wave functions. The TBPM method bypasses the diagonalization process in traditional property calculations, and its resource consumption is linearly related to the system size. The simulation scales up to nearly 10 orders of magnitude, reaching billions of atoms or even larger complex quantum systems, which is an improvement of at least 5-6 orders of magnitude compared to traditional methods.

For more information, please refer to the TBPLaS paper and the official documentation.

How to run TBPLaS jobs on Bohrium

Step 1: Prepare input data

First, you need to start the management node. In this case, the image selected is tbplas:1.4-py3.10-intel2022-ilp64. After connecting to the management node through Web Shell, you can proceed with the preparation of the input file.

Note: The reason for using this image as the management node is that it already contains the TBPLaS software and related example scripts. In practice, if the calculation scripts is already prepared in advance, any image can be used as the management node.

After the management node is created, connect to it through Web Shell, navigate to the ~/src directory, and unzip the downloaded TBPLaS source code:

cd ~/src; tar -xvf tbplas.tar.bz2

Navigate to the unzipped directory examples/sample/tbpm folder:

cd tbplas/examples/sample/tbpm
tree
.
|-- diffusion_coeff.py
|-- graphene.py
`-- graphene_mpi.py

This folder contains three scripts. Taking graphene_mpi.py as an example, this script includes how to build the structure, construct the tight-binding Hamiltonian, and how to calculate DOS, AC/DC conductivity, and dynamic polarizability based on the TBPM method using the tight-binding model. In this case, we will use this script as the calculation script.

Step 2: Prepare configuration file

Create and edit the job configuration file:

touch job.json
vim job.json

Enter the following content in the editor:

{
"job_name": "TBPLaS example",
"command": "OMP_NUM_THREADS=4 mpirun -np 4 python -u graphene_mpi.py > log",
"log_file": "log",
"backward_files": [],
"project_id": 0000,
"platform": "ali",
"job_type": "container",
"machine_type": "c16_m32_cpu",
"image_address": "registry.dp.tech/dptech/tbplas:1.4-py3.10-intel2022-ilp64"
}

Notice: Replace the 0000 after "project_id": with your own project ID, which can be viewed on the "Project Management" page. It is recommended to set the number of MPI processes to the number of CPU cores / 2. For example, if the selected machine type has a 16-core 32GB memory CPU, you can use mpirun -np 8 to submit the job.

Please note that the number of MPI processes is a factor of the number of random samples calculated in the script: for example, in this script, the number of samples is 4.

config.generic['nr_random_samples'] = 4

Therefore, the number of MPI processes should be a multiple of 4, such as 2, 4, etc. At the same time, to ensure the efficiency of a single sample, OMP parallelism should also be provided.

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.