LAMMPS Molecular Dynamics Simulator

LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale Atomic/Molecular Massively Parallel Simulator.

To use it, create a folder for the job and put all necessary input files in it.

Then, being logged in to one of the login nodes of zeus HPC, run in command line:

module load lammps

This will load all necessary paths to lammps executable, openmpi it was built with and cuda/6.5 libraries.

Then you can use the following slurm job submissions script:


#!/bin/bash
## Change how many nodes and CPUs per node you want to reserve:

#SBATCH --time=02:00:00
#SBATCH --nodes=2

## If you want GPU/CUDA nodes (zeus200-zeus217) use --partition=GPU below
#SBATCH --partition=all
#SBATCH --ntasks-per-node=8

#SBATCH --job-name="lammps_job"

WORKDIR=${SLURM_SUBMIT_DIR}

#change this to the name of your input file
INPUTFILE=in.lj

# add any additional parameters if needed:
ARGS=""

## Lets generate hosts file:
HOSTS=`srun /bin/hostname|sort`
echo ${HOSTS} | sed 's/ /n/g'>${WORKDIR}/hostsfile.txt

## Nr of CPU's in total we reserved
NPROCS=$(( $SLURM_JOB_NUM_NODES * $SLURM_NTASKS_PER_NODE ))

mpirun -np $NPROCS lmp_mpi ${ARGS} < ${INPUTFILE}

If you prefer you can use another pre-compiled binary from LAMMPS distribution (perhaps won't support cuda)

1. You have to source the file:

source /share/apps/lammps/lammps.sh

Executable resides at:

/share/apps/lammps/bin/lmp_g++

Just replace the last line in the above slurm script to be:

export OMP_NUM_THREADS=1
mpirun -np $NPROCS lmp_g++ ${ARGS} < ${INPUTFILE}

in order to use this executable.

Alex Pedcenko

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

css.php