Run a GROMACS molecular dynamics simulation
The E-HPC client offers a graphical interface for configuring GROMACS and quickly submitting jobs for molecular dynamics simulations.
Background
GROMACS (GROningen MAchine for Chemical Simulations) is a versatile software package for performing molecular dynamics simulations based on Newton's equations of motion. It is designed for systems with millions of particles and is primarily used to analyze biochemical molecules, such as proteins, lipids, and nucleic acids, which involve complex bonded interactions.
This tutorial demonstrates how to run an application on the E-HPC client, using GROMACS as an example. The process includes the following steps:
-
Connect to the cluster through a terminal to download and decompress a sample dataset.
-
Configure the GROMACS application and submit a job.
-
Check the job state.
-
Log on to the remote desktop using VNC and view the job results in VMD.
Prerequisites
Before you submit a job using the E-HPC client, ensure your cluster meets the following requirements:
-
The following software is installed on the cluster. For more information, see Install software.
-
vmd 1.9.3
-
openmpi 3.0.0
-
-
GROMACS is installed on each compute node in the cluster.
You can run the following commands:
sudo yum install -y gromacs sudo cp /usr/bin/gmx /usr/bin/gmx_mpi -
tmux is installed on the management node of a Tiny mode cluster or on the logon node of a Standard mode cluster.
You can run the following command:
sudo yum install -y tmux -
VNC is enabled for the cluster. For more information, see Use VNC for remote visualization.
-
The required ports are open in the cluster's security group.
-
Client logon port: 12011.
-
Ports required for VNC: The first VNC session uses port 12017. The port number increments for each subsequent session. For example, if three users need to use VNC, you must open ports 12017, 12018, and 12019.
For more information, see Add a security group rule.
-
Procedure
-
Log on to the E-HPC client.
For more information, see Log on to the client.
-
Connect to the cluster using the terminal to download and decompress the sample dataset.
-
In the left-side navigation pane, click Session Management, and then click terminal to open a terminal window.
-
Run the following commands to download and decompress the sample dataset.
This tutorial uses a water molecule motion simulation as an example. The simulation models the motion of a large number of water molecules within a given space and at a specific temperature.
wget https://public-ehpc-package.oss-cn-hangzhou.aliyuncs.com/water_GMX50_bare.tar.gz tar xzvf water_GMX50_bare.tar.gz -
Use an SSH command to switch to a compute node, and then run the following commands to preprocess the sample dataset file.
cd water-cut1.0_GMX50_bare/0012/ gmx_mpi grompp -f pme.mdp -c conf.gro -p topol.top -o topol_pme.tpr
-
-
Verify that VNC is available.
In the upper-right corner of the Session Management page, click VNC to test the VNC connection.
-
If the connection is successful, VNC is available.
-
If the connection fails, check whether the VNC service is installed and the required VNC ports are open.
-
-
Configure the GROMACS application and submit the job.
-
In the left-side navigation pane, choose Application Center.
-
Click gromacs.
-
In the panel that appears, configure the job parameters and click Submit.
Parameter type
Parameter
Example value
Description
Basic parameters
Job name
gromacstest
A custom name to identify the job.
Queue
workq
The queue where the job will run.
CPU cores
16
The number of CPU cores per node.
Number of nodes
3
The number of compute nodes to use for the job.
Log output
gromacs.log
The output path for the job log.
Application parameters
Preprocessed file (.tpr)
/home/user***/water-cut1.0_GMX50_bare/0012/topol_pme.tpr
The path to the preprocessed sample dataset file.
Number of simulation steps
1000
The maximum number of simulation steps. This corresponds to the
nstepsparameter.
-
-
Monitor the job.
-
In the left-side navigation pane, choose Job List.
-
Set query conditions to check the job state.
From the Current Scheduler Queue drop-down list, select the target queue, such as
workq. The top of the page displays ring charts for node, core, memory, and GPU utilization. The job list at the bottom displays fields such as job ID, job name, job state, submit time, start time, end time, and priority.When the job state changes to FINISHED, click Details to view more information.
The Job Details panel displays job information as key-value pairs. This includes Job ID, Job Name, Job Priority, User, Queue, Job State, Submit Time, Start Time, End Time, Command (which includes PBS submission parameters and the script path), Working Directory, Output File, and Error File (click View to see its content), Execution Hosts, CPU Cores, Number of Nodes, Memory Used, Virtual Memory Used, and Wall Time.
-
-
After the job completes, configure VNC to view the results.
-
In the left-side navigation pane, choose Application Center.
-
Click gromacs-vnc.
-
In the panel that appears, specify which job output you want to view, and click Submit.
In the Preprocessed file (.tpr) field, specify the path to the .tpr file that corresponds to your job output. Click Select File to select the file.
-
-
In the upper-right corner of the Session Management page, click VNC to open the VNC window. You can view the job results in the VMD window that appears.
In the VMD Main window, the molecule list shows that the
confout.grofile (96,000 atoms, 1 frame) is loaded. The VMD OpenGL Display window renders the 3D structure of the molecular system.