Installing and Using GROMACS¶
GROMACS is a free and open-source software suite for high-performance molecular dynamics and output analysis.
You can learn about GROMACS here: https://www.gromacs.org/.
Install GROMACS with MPI¶
Select a version on the GROMACS website, then download and extract the tar ball.
cd ~
mkdir gromacs
cd gromacs
wget --no-check-certificate http://ftp.gromacs.org/pub/gromacs/gromacs-2019.6.tar.gz
tar xvfz gromacs-2019.6.tar.gz
Load MPI and Cmake modules,
Create build and install directories,
Use cmake to configure compiling options,
Compile, check and install,
Set up usage environment,
Run GROMACS¶
Firstly, prepare for an input file. Refer to file formats. Here shows an example with an input file named benchPEP-h.tpr downloaded from this page. In these examples we have saved the input files in the ~/gromacs/bench/ directory.
Secondly, create a batch job script, for example, named job.sh.
This job script requests 2 nodes with a total of 8 CPU cores and 50GB of memory.
#!/bin/bash
#SBATCH --job-name="production run"
#SBATCH --partition=sched_mit_hill
#SBATCH --constraint=centos7
#SBATCH --mem=50G
#SBATCH -N 2
#SBATCH --ntasks 8
#SBATCH --time=12:00:00
module purge
module load gromacs/2018.4
gmx_mpi=/home/software/gromacs/2018.4/bin/gmx_mpi
if [ -n "$SLURM_CPUS_PER_TASK" ]; then
ntomp="$SLURM_CPUS_PER_TASK"
else
ntomp="1"
fi
# setting OMP_NUM_THREADS to the value used for ntomp to avoid complaints from gromacs
export OMP_NUM_THREADS=$ntomp
mpirun -np $SLURM_NTASKS $gmx_mpi mdrun -ntomp $ntomp -deffnm ~/gromacs/bench/benchPEP-h -v
Finally, submit the job,
Refer to GROMACS user guide for more info.