Difference between revisions of "Contrib/PyFoam/benchFoam"

From OpenFOAMWiki
m
m (A possible benchmark suite)
Line 118: Line 118:
 
! dnsFoam
 
! dnsFoam
 
| boxTurb16
 
| boxTurb16
| Splitting grid
+
| Splitting the grid
 
| DNS
 
| DNS
 
| Parallel run fails
 
| Parallel run fails

Revision as of 12:45, 16 January 2006

UNDER CONSTRUCTION

This script can be found in the examples-directory of the PyFoam-distribution.

1 Usage

From the example-directory of the PyFoam distribution copy the benchFoam.py-script and a configuration File (for instance data/default.cfg to a local directory. The benchmark can then be run with the command

./benchFoam.py default.cfg

An arbitrary number of configuration files can be specified.

The script then copies the specified cases from the $FOAM_TUTORIAL-directory to the local directory, modifies them and then runs the solver on them. It records the wallClock- and the CPU-time and writes the information to a file. The speedup is calculated by comparing the wallClock-time to a reference time.

If the benchmark is specified to be parallel, the specified LAM-machine is automatically booted and shutdown after running the benchmark.

The script tries to determine the maximum memory used. Because the getrusage-system call is not correctly implemented on Linux-machines (and on Mac OS X, too) this feature is untested.

1.1 Format of the config File

An example for a config-file is given below:

[General]
name: default
parallel: no
nProcs: 2
machines: benchMachines

[Incompressible driven cavity]
nr: 1
solver: icoFoam
case: cavity
prepare: [("blockMesh","")]
controlDict: [("endTime",2),("writeInterval",50)]
blockSplit: (2,2,1)
baseline: 4.013
weight: 1

[Dam-break tutorial case]
solver: interFoam
case: damBreak
prepare: [("blockMesh",""),("setFields","")]
controlDict: [("endTime",0.5),("writeInterval",0.1)]
baseline: 106.38
weight: 3
blockSplit: (2,2,1)

[HotRoom with buoyantFoam]
solver: buoyantFoam
case: hotRoom
utilities: ["setHotRoom"]
prepare: [("blockMesh",""),("setHotRoom","")]
controlDict: [("endTime",10),("deltaT",0.05),("writeInterval",100),("writeCompression","compressed")]
baseline: 826.375
weight: 1
blockSplit: 2

The file is split into sections. Each section starts with a section name given in square brackets. The General-section has to be present. It specifies some general information about the benchmark:

  • name: the name of the benchmark. This is used in the names of the output-files and directories
  • parallel: whether or not it is a parallel benchmark
  • nProcs: the number of CPUs used for the parallel benchmark
  • machines: name of the file used to boot the LAM-machine

Each of the other sections specifies a different benchmark case. The name of the Section is the name under which the benchmark will be known for screen-output. The options in the section are:

  • nr: the order in which the benchmarks will be executed. If unspecified or two numbers are the same the order will be unspecified
  • solver: name of the solver to execute
  • case: name of the tutorial case for that solver
  • prepare: a list of commands to execute in order to prepare the case for running the benchmark. Each command is given by a pair: the first value is the name of the command, the second value are the additional options that are inserted after the working directory and the casename (the usual calling convention for OpenFOAM-utilities)
  • utilities: an optional list of utilities that have to be compiled in order to run the case. It is assumed that the sources of the utilities reside in the directory of the case (usually the case for the tutorial cases)
  • controlDict: values that are to be changed in the standard controlDict of the tutorial case in order to change the running time of the case
  • baseline: time it takes for the case to run on a reference machine
  • weight: weight with which this case contributes to the overall-speedup of the benchmark suite
  • blockSplit: optional value that is used to resize the mesh size in a blockMesh. If a scalar each number of cells is multiplied with that value. If a triple, then each direction is multiplied with the corresponding value.

1.2 Warning

Because the script measures the wall-clock-time no other activity (users, server tasks) should take place on that machine.

2 Discussion

This describes the benchmark suite in the file standard.cfg distributed with PyFoam.

2.1 Choice of benchmark cases

The first criteria for the selection of the cases was that only standard tutorial cases are selected.

The next criterium was that the complete suite should run on the reference machine in one night. Because of this criterium most cases are not calculated for their whole duration. In addition to this the cases should comfortably fit into a machine with 0.5 Gigabytes of memory.

The running time of the individual cases was adjusted to be

  • more than a quarter of an hour (in order to keep the influence of the startup-procedure low)
  • less than an hour (to meet the overall-time requirement)

For small cases the blockMesh is refined for the case to have at least 10k cells. (this is still to small to produce reasonable results for parallel benchmarks but should assure that not the whole simulation fits into the cache of the processor)

2.2 The reference machine

Currently the reference machine in the distributed config-files is a Fedora 4 machine with a 1.8 GHz Pentium 4 and 1 Gigabyte of RAM. The installed OpenFOAM is version 1.2.

This machine was choosen because it is the slowest machine I have currently available.

3 A possible benchmark suite

The simulations in this suite were chosen to fit with the above requirements and give a cross-section of the available solvers in OpenFOAM:

Benchmark suite
solver case-name Modification to original case features benched Remarks/Problems
dieselFoam aachenBomb Lagrangian particles, chemical reactions with ChemKin Decompose fails for parallel
dnsFoam boxTurb16 Splitting the grid DNS Parallel run fails
bubbleFoam bubbleColumn Two-phase solver
interFoam damBreak Splitting the grid Two-phase solver
rhoSonicFoam forwardStep Splitting the grid Super-sonic solver
buoyantFoam hotRoom Splitting the grid Heat transfer Decompose fails for parallel
engineFoam kivaTest Mesh motion, combustion
Xoodles pitzDaily3D Combustion, LES Decompose fails for parallel
oodles pitzDaily LES
simpleFoam pitzDaily Steady-state solver
sonicTurbFoam prism Super-sonic, turbulent Decompose fails for parallel