16.6.1. Advection-Reaction Benchmark
This benchmark problem implements a 3D advection-reaction equation using the RAJA performance portability layer with serial, CUDA, or HIP backends.
16.6.1.1. Problem description
This code simulates the advection and reaction of three chemical species where the reaction mechanism is a variation of the Brusselator problem from chemical kinetics. The PDE system is given by
where \(u\), \(v\), and \(w\) are chemical concentrations, \(c\) is the advection speed, \(A\) and \(B\) are the concentrations of chemical species that remain constant over space and time, and \(\epsilon\) is a parameter that varies the stiffness of the system. The problem is solved on the domain \((x,y,z) \equiv \mathbf{x} \in [\mathbf{0}, \mathbf{x_{\text{max}}}]^3\), for times \(t \in [0,t_f]\). The initial condition is
where the perturbation function is
with \(\alpha = 0.1\), \(\mu = 0.5\, \textbf{x}_\text{max}\), and \(\sigma\) is a diagonal matrix with entries \(0.25\, \mathbf{x}_\text{max}\).
Spatial derivatives are discretized with first-order upwind finite differences on a uniform spatial grid. The system can be evolved in time using explicit, implicit, or IMEX methods from ARKODE, Adams or BDF methods from CVODE, or BDF methods from IDA. When using an IMEX method, advection is treated explicitly and reactions implicitly.
The nonlinear system(s) that arise in each time step may be solved using a global Newton method with a matrix-free GMRES linear solver or an Anderson accelerated fixed-point method. When using an IMEX method, a custom task-local nonlinear solver that leverages the locality of the reaction systems may also be used.
16.6.1.2. Options
Several command line options are available to change the problem parameters as well as the integrator and solver options. A summary of the options are listed in Table 16.5.
Option |
Description |
Default |
---|---|---|
|
Print the command line options and description |
– |
|
Print solution information to the screen (slower) |
Off |
|
Number of output times |
40 |
|
Directory where all output files will be written |
|
|
Number of mesh points in each direction |
100 |
|
Number of MPI tasks in each direction (0 forces MPI to decide) |
0 0 0 |
|
Maximum value of \(x\), \(y\), and \(z\) in \(\textbf{x}_{\text{max}}\) |
1.0 |
|
Constant concentration of species \(A\) |
1.0 |
|
Constant concentration of species \(B\) |
3.5 |
|
Advection speed \(c\) |
0.01 |
|
Integration method order |
3 |
|
Integrator to use: |
|
|
Number of fixed point acceleration vectors |
3 |
|
Nonlinear Solver Method:
|
|
|
Enabled fused operations |
Off |
|
Final integration time \(t_f\) |
10.0 |
|
Relative tolerance |
1.0e-6 |
|
Absolute tolerance |
1.0e-9 |
16.6.1.3. Building and Running
To build the benchmark executables SUNDIALS must be configured with ARKODE, CVODE, and IDA enabled and with MPI and RAJA support on. Additionally, either CUDA or HIP support must be on to build executables utilizing NVIDIA or AMD GPUs. See the installation guide for more details on configuring, building, and installing SUNDIALS.
Based on the configuration the following executables will be built and installed
in the <install prefix>/bin/benchmarks/advection_reaction_3D
directory:
advection_reaction_3D
– MPI parallelismadvection_reaction_3D_mpicuda
– MPI + CUDA parallelismadvection_reaction_3D_mpihip
– MPI + HIP parallelism
On Summit, with the default environment
Compiler: xl/16.1.1-5
MPI: spectrum-mpi/10.3.1.2-20200121
CUDA: cuda/10.1.243
an example jsrun
command is
jsrun -n 2 -a 1 -c 1 -g 1 ./advection_reaction_3D_mpicuda
On Lassen, with the environment
Compiler: gcc/8.3.1
MPI: mvapich2/2021.05.28-cuda-11.1.1
CUDA: cuda/11.1.1
an example jsrun
command is
jsrun -n 2 -a 1 -c 1 -g 1 ./advection_reaction_3D_mpicuda