Navigation

Spack

AMD Toolchain with SPACK

Micro Benchmarks/Synthetic

SPACK HPC Applications

Introduction

CloverLeaf® is a mini-app that solves the compressible Euler equations on a Cartesian grid, using an explicit, second-order accurate method. Each cell stores three values: energy, density, and pressure. A velocity vector is stored at each cell corner. This arrangement of data, with some quantities at cell centers, and others at cell corners is known as a staggered grid.

The CloverLeaf official website: https://uk-mac.github.io/CloverLeaf/

Note: CloverLeaf master consists of various build types such as Reference, Serial, MPI, OpenMP etc., here we have covered only Reference build type which features both MPI and OpenMP as default.

Build CloverLeaf using Spack

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

# Format For Building CloverLeaf_ref with AOCC
$ spack install -v cloverleaf@<Version> build=<build_type> %aocc@<Version> target=<zen2/zen3> ^openmpi@<Version>
# Example: For Building CloverLeaf_ref v.1.3 with AOCC 3.1 and AOCL 3.0
$ spack -d install -v cloverleaf@master build=ref %aocc@3.1.0 target=zen3 ^openmpi@4.0.5 fabrics=auto
# Example: For Building CloverLeaf_ref v.1.3 with AOCC 3.0 and AOCL 3.0
$ spack -d install -v cloverleaf@master build=ref %aocc@3.0.0 target=zen3 ^openmpi@4.0.5 fabrics=auto

Versions supported and compatibility:

Component/Application Versions Applicable
CloverLeaf_ref 1.3
AOCC 3.1.0,3.0.0
AOCL 3.0

Specifications and Dependencies

Symbol Meaning
-d To enable debug output
-v To enable verbose
@ To specify version number
% To specify compiler
+debug Build with DEBUG flags
^ieee To build with IEEE standards
^open­mpi­ fabri­cs=­auto To build with Open MPI and using fabrics=auto

Running  CloverLeaf

CloverLeaf takes no command line arguments. It expects to find a file called clover.in in the directory it is running in.

There are a number of input files that come with the code. To use any of these they simply need to be copied to clover.in in the run directory and CloverLeaf invoked.

Setting Environment
# Format to load CloverLeaf_ref build with AOCC
$ spack load cloverleaf@<Version Number> %aocc@<Version Number>
# Example: Load CloverLeaf_ref-v.1.3 build with AOCC-3.1 module into environment
$ spack load cloverleaf@master %aocc@3.1.0
# Example: Load CloverLeaf_ref-v.1.3 build with AOCC-3.0 module into environment
$ spack load cloverleaf@master %aocc@3.0.0

 

Run command
# Locate installation of binaries
$ spack cd -i cloverleaf@master
$ cd bin/
# for a hybrid run
$ export OMP_NUM_THREADS=1
$ mpirun -np 128 clover_leaf