Navigation

Spack

AMD Toolchain with SPACK

Micro Benchmarks/Synthetic

SPACK HPC Applications

Introduction

Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS) is a classical molecular dynamics code.  LAMMPS can be used to simulate solid-state materials (metals, semiconductors), soft matter (biomolecules, polymers), and coarse-grained or mesoscopic systems.  LAMMPS can be used to model atoms, or, more generically, as a parallel particle simulator at the atomic, meso, or continuum scale.  LAMMPS runs on single processors or in parallel using message-passing techniques with a spatial-decomposition of the simulation domain.  The code is designed to be easy to modify or extend with new functionality.

LAMMPS official website:  http://lammps.sandia.gov

Build LAMMPS using Spack

Reference to add external packages to Spack: Build Customization (Adding external packages to Spack)

# Format For Building LAMMPS with AOCC
$ spack -d install -v lammps@<Version Number> %aocc@<Version Number> target=<zen2/zen3> ~kim +asphere +class2 +kspace +manybody +molecule +mpiio +opt +replica +rigid +granular +user-omp +openmp ^amdfftw@<Version Number> ^openmpi@<Version Number>
# Example: For building LAMMPS-20210310 with AOCC-3.1.0 AOCL-3.0 and OpenMPI-4.0.5
$ spack -d install -v lammps@20210310 build_type=Release %aocc@3.1.0 target=zen3 ~kim +asphere +class2 +kspace +manybody +molecule +mpiio +opt +replica +rigid +granular +user-omp +openmp ^amdfftw@3.0 ^openmpi@4.0.5
# Example: For building LAMMPS-20200721 with AOCC-3.0 AOCL-3.0 and OpenMPI-4.0.3
$ spack -d install -v lammps@20200721 build_type=Release %aocc@3.0.0 target=zen3 ~kim +asphere +class2 +kspace +manybody +molecule +mpiio +opt +replica +rigid +granular +user-omp +openmp ^amdfftw@3.0 ^openmpi@4.0.3
# Example: For building LAMMPS-20200721 with AOCC-2.3.0 AOCL-2.2 and OpenMPI-4.0.3
$ spack -d install -v lammps@20200721 build_type=Release %aocc@2.3.0 target=zen2 ~kim +asphere +class2 +kspace +manybody +molecule +mpiio +opt +replica +rigid +granular +user-omp +openmp ^amdfftw@2.2 ^openmpi@4.0.3
# Example: For building LAMMPS 20200721 with AOCC-2.2.0 AOCL-2.2 and OpenMPI-4.0.3
$ spack -d install -v lammps@20200721 build_type=Release %aocc@2.2.0 target=zen2 ~kim +asphere +class2 +kspace +manybody +molecule +mpiio +opt +replica +rigid +granular +user-omp +openmp ^amdfftw@2.2 ^openmpi@4.0.3

Please use any combination of below components/Applications and its versions.

Component/Application Versions Applicable
LAMMPS 20210310, 20200721
AOCC 3.1.0, 3.0.0, 2.3.0, 2.2.0
AOCL 3.0, 2.2

Specifications and Dependencies

Symbol Meaning
-d To enable debug
-v To enable verbose
@ To Specify Version number
% To change compiler for its build (ex. %aocc for using AOCC compiler for its build)
build_type=Release To set build type to Release
target=zen2/ target=zen3 To enable target zen2 or zen3 architecture
+asphere ,+class2, +kspace,+manybody +molecule +mpiio +opt +replica +rigid +granular +user-omp Lammps specific packages (Please add it as per user requirement)
+openmp Build with openmp variant
^amdfftw target=zen2/zen3 Build with amdfftw with target=zen2 or target=zen3
^openmpi@4.0.3 Build with Open MPI 4.0.3

Running LAMMPS

While LAMMPS can be used for a big variety of workloads. Here we have added the steps to download and run the sample data sets available in LAMMPS directory.

Note: By default LAMMPS comes with 5 sample data sets in its tar package which is available in <LAMMPSROOT>/bench directory.

Examples for running LAMMPS on AMD 2nd and 3rd Gen EPYC processors are presented below.

Running LAMMPS on AMD 2nd Gen EPYC Processors

The following example steps are for running LAMMPS with Rhodo dataset on AMD EPYC 7742 Series Processor with SMT ON and with the “USER-OMP” package.
Setting Environmennt
# Format for loading LAMMPS build with AOCC
$ spack load lammps@<Version Number> %aocc@<Version Number>
# Example : Load LAMMPS-20200721 build with AOCC-2.2.0 module into environment
$ spack load lammps@20200721 %aocc@2.2.0

 

Obtaining Benchmarks
# Download the Lammps source file which has the input datasets as part of it.
$ wget https://lammps.sandia.gov/tars/lammps-21Jul20.tar.gz
$ tar -xvf lammps-21Jul20.tar.gz
cd lammps-21Jul20/bench/

Run command

Use proper binding with mpirun command. Below command and binding work with “SMT ON” for AMD EPYC 7742 Series Processors.

RHODO: Single Node
export LMP_MPI=/path_to_lammps_installed_folder/bin/lmp
$ mpirun -np 256 --oversubscribe --use-hwthread-cpus --map-by hwthread --bind-to core $LMP_MPI -var x 8 -var y 8 -var z 8 -var r 1000 -sf omp -in in.rhodo

Running LAMMPS on AMD 3rd Gen EPYC Processors

Following steps and files are for two AMD EPYC 7763 Series Processors with 512 GB of Memory with SMT ON and with the “USER-OMP” package.
Setting Environmennt
# Format for loading LAMMPS build with AOCC
$ spack load lammps@<Version Number> %aocc@<Version Number>
# Example : Load lammps build with AOCC-3.1.0 module into environment
$ spack load lammps@20210310 %aocc@3.1.0

 

Obtaining Benchmarks
# Download the Lammps source file which has the input datasets as part of it.
$ wget https://download.lammps.org/tars/lammps-10Mar2021.tar.gz
$ tar -xvf lammps-10Mar2021.tar.gz
$ cd lammps-10Mar2021/bench/

Run command

Use proper binding with mpirun command. Below command and binding work with “SMT ON” for AMD EPYC 7763 Series Processors.

RHODO: Single Node
export LMP_MPI=/path_to_lammps_installed_folder/bin/lmp
$ mpirun -np 256 --oversubscribe --use-hwthread-cpus --map-by hwthread --bind-to core $LMP_MPI -var x 8 -var y 8 -var z 8 -var r 1000 -sf omp -in in.rhodo