Difference between revisions of "Contrib/PyFoam/benchFoam"

From OpenFOAMWiki
m
(Usage)
Line 10: Line 10:
  
 
An arbitrary number of configuration files can be specified.
 
An arbitrary number of configuration files can be specified.
 +
 +
The script then copies the specified cases from the <tt>$FOAM_TUTORIAL</tt>-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.
  
 
=== Format of the config File ===
 
=== 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 <tt>General</tt>-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 <tt>controlDict</tt> 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 <tt>blockMesh</tt>. If a scalar each number of cells is multiplied with that value. If a triple, then each direction is multiplied with the corresponding value.
  
 
== Discussion ==
 
== Discussion ==

Revision as of 15:12, 13 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.

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.

2 Discussion