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.

Official website for LAMMPS:  https://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> %aocc@<Version> target=<zen2/zen3> ~kim +asphere +class2 +kspace +manybody +molecule +mpiio +opt +replica +rigid +granular +user-omp +openmp ^amdfftw@<Version> ^openmpi@<Version>
# Example: For building LAMMPS 20210310 with AOCC 3.2.0 and AOCL 3.1
$ spack -d install -v -j 16 lammps@20210310 build_type=Release %aocc@3.2.0 target=zen3 ~kim +asphere +class2 +kspace +manybody +molecule +mpiio +opt +replica +rigid +granular +user-omp +openmp ^amdfftw@3.1 ^openmpi@4.1.1 fabrics=auto
# Example: For building LAMMPS 20210310 with AOCC 3.1.0 and AOCL 3.0
$ spack -d install -v -j 16 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 fabrics=auto
# Example: For building LAMMPS-20200721 with AOCC 3.0 and AOCL 3.0
$ spack -d install -v -j 16 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 fabrics=auto
# Example: For building LAMMPS-20200721 with AOCC 2.3.0 and AOCL 2.2
$ spack -d install -v -j 16 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 fabrics=auto
# Example: For building LAMMPS 20200721 with AOCC 2.2.0 and AOCL 2.2
$ spack -d install -v -j 16 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 fabrics=auto

Use any combination of the following components/applications and their corresponding versions:

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

Specifications and Dependencies

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

Running LAMMPS

While LAMMPS can be used for a big variety of workloads. Following are 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 /bench directory.

Examples for running LAMMPS on AMD 2nd and 3rd Gen EPYCTM processors as follows:

Setting Environment
# Format for loading LAMMPS build with AOCC
$ spack load lammps@<Version> %aocc@<Version>
# Example : Load LAMMPS-20210310 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
# Run RHODO dataset with SMT ON

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