SPEC CPU2017 Benchmark Description

519.lbm_r

Thomas Pohl <thomas.pohl [at] gmail.com>

Computational Fluid Dynmaics, Lattice Boltzmann Method

This program implements the so-called "Lattice Boltzmann Method" (LBM) to simulate incompressible fluids in 3D as described in [1]. It is the computationally most important part of a larger code which is used in the field of material science to simulate the behavior of fluids with free surfaces, in particular the formation and movement of gas bubbles in metal foams (see the FreeWiHR homepage for animations of the results). For benchmarking purposes and easy optimization for different architectures, the code makes extensive use of macros which hide the details of the data access. A visualization of the results of the submitted code can be seen below (flow through a porous medium, grid size 150x150x150, 1000 time steps).

Flow of a fluid through an array of spheres

The `lbm` program requires several command line
arguments:

lbm <time steps> <result file> <0: nil, 1: cmp, 2: str> <0: ldc, 1: channel flow> [<obstacle file>]

Description of the arguments:

- <time steps>
- number of time steps that should be performed before storing the results
- <result file>
- name of the result file
- <0: nil, 1: cmp, 2: str>
- determines what should be done with the specified result file: action '0' does nothing; with action '1' the computed results are compared with the results stored in the specified file; action '2' stores the computed results (if the file already exists, it will be overwritten)
- <0: ldc, 1: channel flow>
- chooses among two basic simulation setups, lid-driven cavity (shear flow driven by a "sliding wall" boundary condition) and channel flow (flow driven by inflow/outflow boundary conditions)
- [<obstacle file>]
- optional argument that specifies the obstacle file which is loaded before the simulation is run

The basic steps of the simulation code are as follows:

- If an obstacle file was specified it is read and the obstacle cells are set accordingly.
- The specified number of time steps are calculated in the selected simulation setup (lid-driven cavity or channel flow).
- Depending on the action chosen the result is either stored, compared to an existing result file, or thrown away.

For benchmarking purposes, where the SPEC tools are used to validate the solution, the computed results are only stored.

In the Lattice Boltzmann Method, a steady state solution is achieved by running a sufficient number of model time steps. For the refrate workload, 3000 time steps are computed for an obstacle file. The simulation domain is x=100, y=100 and z=130. For the refspeed workload 2000 time steps are computed for the obstacle file. The simulation domain is 200x200x260. For the test and training workloads, a smaller number of time steps are computed.

The geometry used in the training workload is different from the geometry used in the reference benchmark workload. Also, the reference workload uses a shear flow boundary condition, whereas the training workload does not. Nevertheless, the computational steps stressed by the training workload are the same as those stressed in the reference run.

The file format which specifies the location of obstacle and fluid cells is a simple ASCII format. The dot character '.' stands for a fluid cell, while all other characters (here '#') denote an obstacle cell. Each line represents the cells along the x axis. After each line a newline has to be included. After a complete x/y plane another newline has to be included.

Below you see an example of an obstacle file for the simulation domain x = 6, y = 5, and z = 3. The red comments just show the corresponding coordinates for each line and must not be included in the obstacle file itself.

...... (y = 0, z = 0) ...#.. (y = 1, z = 0) ..##.. (y = 2, z = 0) .###.. (y = 3, z = 0) ...... (y = 4, z = 0) ...... (y = 0, z = 1) ...... (y = 1, z = 1) ...#.. (y = 2, z = 1) ..##.. (y = 3, z = 1) ...... (y = 4, z = 1) ...... (y = 0, z = 2) ...... (y = 1, z = 2) ...... (y = 2, z = 2) ...#.. (y = 3, z = 2) ...... (y = 4, z = 2)

If the store action '2' has been specified in the command line arguments, a result file containing the 3D velocity vector for each cell is stored.

The default file format is a sequence of binary single precision values (little endian) with the following ordering:

v_{x}(0,0,0), v_{y}(0,0,0),
v_{z}(0,0,0), v_{x}(1,0,0),
v_{y}(1,0,0), v_{z}(1,0,0),
v_{x}(2,0,0), v_{y}(2,0,0),
v_{z}(2,0,0),
...,
v_{x}(X,0,0) v_{y}(X,0,0) v_{z}(X,0,0),

v_{x}(0,1,0), v_{y}(0,1,0),
v_{z}(0,1,0), v_{x}(1,1,0),
v_{y}(1,1,0), v_{z}(1,1,0),
v_{x}(2,1,0), v_{y}(2,1,0),
v_{z}(2,1,0),
...,
v_{x}(X,1,0) v_{y}(X,1,0) v_{z}(X,1,0),

...

v_{x}(0,Y,0), v_{y}(0,Y,0),
v_{z}(0,Y,0), v_{x}(1,Y,0),
v_{y}(1,Y,0), v_{z}(1,Y,0),
v_{x}(2,Y,0), v_{y}(2,Y,0),
v_{z}(2,Y,0),
...,
v_{x}(X,Y,0) v_{y}(X,Y,0) v_{z}(X,Y,0),

...

v_{x}(0,Y,Z), v_{y}(0,Y,Z),
v_{z}(0,Y,Z), v_{x}(1,Y,Z),
v_{y}(1,Y,Z), v_{z}(1,Y,Z),
v_{x}(2,Y,Z), v_{y}(2,Y,Z),
v_{z}(2,Y,Z),
...,
v_{x}(X,Y,Z) v_{y}(X,Y,Z) v_{z}(X,Y,Z)

Although the default format cannot be altered via command line
arguments, it is possible to change the output precision to double
precision in `config.h`.

If the computed result should be compared to an existing result (action '1'), the program returns the maximum absolute difference of the velocity comparing each cell individually. If the difference is smaller than a certain threshold, the two results are considered to be equal.

ANSI C

None

LBM is licensed directly to SPEC by the author, Thomas Pohl.

- Y.-H. Qian, D. d'Humieres, and P.
Lallemand:
*Lattice BGK models for Navier-Stokes equation*. Europhys. Lett. 17(6): 479-484, 1992 - Thomas Pohl, Markus Kowarschik, Jens Wilke, Klaus Iglberger,
and Ulrich Rüde:
*Optimization and Profiling of the Cache Performance of Parallel Lattice Boltzmann Codes*. Parallel Processing Letter 13(4) 549-560, 2003, postscript copy available here

Last updated: $Date: 2018-07-24 06:24:09 -0700 (Tue, 24 Jul 2018) $