Skip to content

Submitting LAMMPS Jobs With Slurm

This script is an example of launching individual LAMMPS jobs on the Kennesaw State VHPC Cluster.

Slurm Shell Script

In our example, we saved the following Slurm script as run_lammps.pbs (making sure to change netid@kennesaw.edu and account_name in the script to the correct values for your job):

run_lammps.pbs
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=32
#SBATCH --time=2-12:00:00
#SBATCH --mail-type="BEGIN,END,FAIL"
#SBATCH --mail-user="netid@kennesaw.edu" (1)
#SBATCH --account="account_name" (2)

cd ${SLURM_SUBMIT_DIR}

# Load the modules we need
module load LAMMPS

# You may (or may not) need to adjust this value
export OMP_NUM_THREADS=1

LAMMPS_EXE=${EBROOTLAMMPS}/bin/lmp

mpirun -np 16 ${LAMMPS_EXE} -in ${FILE} > ${FILE}.${SLURM_JOBID}
  1. 🙋‍♂️ Make sure to change netid@kennesaw.edu on this line to your KSU email address or you won't receive emails when the job starts and stops.
  2. 🙋‍♂️ Make sure to change account_name on this line to the VHPC billing account your job should be charged to.

Usage

Assuming you saved the Slurm script from above as run_lammps.pbs, and the name of your LAMMPS script is mpi_script.R, you can submit your LAMMPS job with the following command:

[barney@vhpc ~]$ sbatch --export=ALL,FILE=${PWD}/lammps_script.in run_lammps.slurm