Skip to content

LAMMPS

LAMMPS is a molecular dynamics application for large-scale atomic/molecular parallel simulations of solid-state materials, soft matter and mesoscopic systems.

LAMMPS is available as a module on Apocrita.

Versions

Regular and GPU accelerated versions have been installed on Apocrita.

Load the GPU accelerated module which matches the GPU type

As the lmp_gpu binary was compiled against a specific GPU card type, ensure a compatible gpu type is requested and the matching module loaded otherwise you will see a CUDA error when running your code. See the example jobs below for further information.

Parallel support

Non-GPU versions of LAMMPS will only run on parallel nodes using the parallel environment.

Usage

To run the required version, load one of the following modules:

  • For LAMMPS (non-GPU), load lammps/<version>
  • For GPU accelerated LAMMPS versions, load lammps-gpu/<version>

To run the default installed version of LAMMPS, simply load the lammps module:

$ module load lammps
$ mpirun -np ${NSLOTS} lmp_intel_cpu_intelmpi --help

Usage example: lmp_intel_cpu_intelmpi -var t 300 -echo screen -in in.alloy
...

For full usage documentation, pass the --help option.

Example jobs

Parallel job

Here is an example job running on 48 cores across 2 sdv nodes with MPI:

#!/bin/bash
#$ -cwd
#$ -j y
#$ -pe parallel 48
#$ -l infiniband=sdv-i
#$ -l h_rt=240:0:0

module load lammps

mpirun -np ${NSLOTS} lmp_intel_cpu_intelmpi \
       -in in.reax.rdx \
       -log output.log

GPU jobs

Here is an example job running on 1 GPU on the SBG (Volta) nodes:

#!/bin/bash
#$ -cwd
#$ -j y
#$ -pe smp 8
#$ -l h_rt=240:0:0
#$ -l h_vmem=11G
#$ -l gpu=1
#$ -l gpu_type=volta

# Load the GPU-accelerated version which has been compiled
# for the Volta GPU type (installed in sbg1-3)
module load lammps-gpu/<version>-volta

mpirun -np ${NSLOTS} lmp_gpu \
       -sf gpu \
       -pk gpu 1 \
       -in in.lc \
       -log in.lc.log

Here is an example job running on 2 GPUs on the SBG (Volta) nodes:

#!/bin/bash
#$ -cwd
#$ -j y
#$ -pe smp 16
#$ -l h_rt=240:0:0
#$ -l h_vmem=11G
#$ -l gpu=2
#$ -l gpu_type=volta

# Load the GPU-accelerated version which has been compiled
# for the Volta GPU type (installed in sbg1-3)
module load lammps-gpu/<version>-volta

mpirun -np ${NSLOTS} lmp_gpu \
       -sf gpu \
       -pk gpu 2 \
       -in in.lc \
       -log in.lc.log

References