AMD Zen Software Studio with Spack
- AMD Optimizing C/C++ Compiler (AOCC)
- AMD Optimizing CPU Libraries (AOCL)
- AMD uProf
- Setting Preference for AMD Zen Software Studio
Open MPI with AMD Zen Software Studio
Micro Benchmarks/Synthetic Benchmarks
Spack HPC Applications
Introduction
OpenFOAM® is a C++ toolbox for developing customized numerical solvers and pre- and post-processing utilities to solve continuum mechanics problems, including computational fluid dynamics (CFD). OpenFOAM is one of the leading CFD applications and is increasingly popular due to its extensive capabilities and open-source availability.
Official website for OpenFOAM: https://www.openfoam.com
Build OpenFOAM using Spack
Please refer to this link for getting started with Spack using AMD Zen Software Studio.
# Example for building OpenFOAM with AOCC and AOCL.
$ spack install openfoam %aocc ^amdfftw ^openmpi fabrics=cma,ucx ^boost@1.87.0
Explanation of the command options:
Symbol | Meaning |
---|---|
%aocc | Build OpenFOAM with AOCC compiler. |
^amdfftw | Use amdfftw as the FFTW implementation. This dependency is required to build a few solvers and utilities. Since FFT is not heavily used by OpenFOAM, any performance gains from using a vendor library are expected to be minimal. |
^openmpi fabrics=cma,ucx | Use OpenMPI as the MPI provider and use the CMA network for efficient intra-node communication, falling back to the UCX network fabric, if required. Note: It is advised to specifically set the appropriate fabric for the host system if possible. Refer to Open MPI with AMD Zen Software Studio for more guidance. |
^boost@1.87.0 | Pin to a specific Boost version. Version v1.88.0 introduces incompatibilities that cause build failures in OpenFOAM. This issue is expected to be temporary and will be resolved by the community soon. |
Running OpenFOAM®
OpenFOAM is a comprehensive and complex CFD toolkit and the specific steps to run simulations will vary depending on the dataset being used. OpenFOAM includes sample input files located in its tutorial directory. A widely used benchmark and example within OpenFOAM is the motorbike model.
Run Script for AMD EPYC Processors
#!/bin/bash
# Load OpenFOAM (if there're multiple installations, append to the command a hash to identify the installation e.g. /xxxxxxx)
spack load openfoam %aocc
# Copy the Motorbike dataset from the official tutorials
cp -r $(spack location -i openfoam %aocc)/tutorials/incompressible/simpleFoam/motorBike .
cd motorBike
# Patch input files for system settings, for a dual socket AMD 5th Gen EPYC™ 9755 Processor with 256 (128x2) cores
sed -i "s/numberOfSubdomains.*/numberOfSubdomains 256;/" system/decomposeParDict.6 # number of cores to use
sed -i "s/ n (3 2 1)/ n (64 4 1);/" system/decomposeParDict.6 # decompose for all cores
sed -i "s/(20 8 8)/(100 40 40)/" system/blockMeshDict # increase problem size
# Run the benchmark
./Allrun
Note: The above build and run steps apply to OpenFOAM-2412, AOCC-5.0.0, AOCL-5.1.0, and OpenMPI-5.0.8 on Rocky Linux 9.5 (Blue Onyx) using Spack v1.1.0.dev0 and the builtin repo from spack-packages (commit id: 7824c23443).
For technical support on the tools, benchmarks and applications that AMD offers on this page and related inquiries, reach out to us at toolchainsupport@amd.com.