Skip to main content

Gromacs

GROMACS is a versatile software package for performing molecular dynamics, i.e., simulating the Newtonian equations of motion for systems with hundreds to millions of particles, and is a community-driven project.


1. Script Template

submit.sh
#!/bin/bash
#SBATCH --nodes=1 # Number of nodes
#SBATCH --ntasks-per-node=56 # Number of cores per node
#SBATCH --ntasks=56 # Total number of cores
#SBATCH --partition=g1_share # Queue partition; must specify the correct partition
#SBATCH --job-name=hello # Job name
#SBATCH --output=hello.%j.out # Normal log output (%j parameter value is jobId)
#SBATCH --error=hello.%j.err # Error log output (%j parameter value is jobId)

##############################################
# Software Envrironment #
##############################################
unset I_MPI_PMI_LIBRARY # Unset default MPI library, use Intel's built-in
export I_MPI_JOB_RESPECT_PROCESS_PLACEMENT=0 # Parameter modification required for Intel multi-node jobs
module load gcc/12.1.0 openmpi/4.1.2 # Load Intel environment
module load gromacs/2022.2 # Load software (refer to module usage instructions to select the specific version)
export CMX_MAXBACKUP=-1
##############################################
# Run job #
##############################################
export GMX_MAXBACKUP=-1
mpirun gmx grompp -f minimization.mdp -c input.gro -r input.gro -n index.ndx -p topol.top -o input.tpr -maxwarn 99
mpirun gmx mdrun -s input.tpr -deffnm step -v

2. The following describes the meaning of each parameter in the command:

  • mpirun: Runs the gmx grompp command across multiple processes.
  • gmx: Command prefix for the GROMACS software package.
  • grompp: Program in GROMACS used to prepare simulations.
  • -f minimization.mdp: Specifies the name of the simulation parameter file.
  • -c input.gro: Specifies the name of the input structure file.
  • -r input.gro: Specifies the name of the reference structure file.
  • -n index.ndx: Specifies the name of the index file.
  • -p topol.top: Specifies the name of the topology file.
  • -o input.tpr: Specifies the name of the output simulation file.
  • -maxwarn 99: Sets the maximum number of warnings to 99.

  • mpirun: Runs the program in parallel using MPI.
  • gmx: Command prefix for GROMACS software.
  • mdrun: Runs molecular dynamics simulations.
  • -s input.tpr: Input file containing the topology and simulation parameters of the system.
  • -deffnm step: Specifies 'step' as the prefix for the output filename.
  • -v: Outputs detailed run log information.