Benchmark TRACE and other programs¶
benchTRACE¶
This module aims to offer a consistent benchmark for TRACE or other CGNS processing programs.
It executes test cases in a consistent matter multiple times. Only one test case is executed at a time. Every test case is executed in a unique directory which will persist after the run. The CGNS files in this folder will be deleted after the run.
Therefore make sure all tested programs create the output CGNS file in the folder the test case is executed. Otherwise you will flood your hard disk.
The folder hierarchy top down: name of the executable - name of the cgns file - number of processes used - repetition counter
benchTRACE only executes the program and does not do any recordings by itself. To map the output files to the runs write any performance data in the working directory.
Command line options:
$ ./contrib/benchTRACE.py -h
╔═══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ benchTRACE ║
║ Benchmark TRACE or another CGNS processing program ║
║ ║
║ 3.3.30 ║
║ ║
╚═══════════════════════════════════════════════════════════════════════════════╝
usage: benchTRACE.py [-h] -e EXECUTABLE [-r REPETITIONS] [-p N [N ...]]
[-c CGNSPATH]
Execute a IO benchmark of TRACE or another CGNS processing program
optional arguments:
-h, --help show this help message and exit
-e EXECUTABLE, --executable EXECUTABLE
path to a executable including all params
-r REPETITIONS, --repetitions REPETITIONS
number of repetitions for every test case (default: 5)
-p N [N ...], --proc N [N ...]
number of procs to use for the benchmark (default: 1,
2, 4, 8, 16, 24)
-c CGNSPATH, --CGNSPath CGNSPATH
path to the CGNS file folder (default: .)
When the benchmarked program is TRACE, the ‘-cgns’ option is added automatically. .. You can use any other option this way:
benchTRACE.py -e "/path/to/my/TRACE -cntl controlFile.cntl" -r -p 1 2
For every executable a own folder is created in which the benchmarks will be executed. The name of the folder is the name of the executable (TRACE for any TRACE executable).
Danger
When you execute the benchmark with different verions or branches of TRACE in the same folder, the results will become mixed up.
-
createBenchJobList
(executables, nReps, procs, testCases)[source]¶ Creates the job list for the benchmark.
- Parameters
executables (list of strings) – list of the executables to benchmark
nReps (int) – number of the repetitions for every test case
procs (list of int) – list with the number of procs to use for the benchmark
testCases (list of string) – list of the test cases
- Returns
the benchmark job list
- Return type
a Joblist instance
-
getCalcJob
(execPath, nProcs, args, workingDir, name)[source]¶ Creates the job executing the programs to benchmark from the parameters. Forces the program to be executed with MPI, when using more than one process.
- Parameters
execPath (string) – the path to the benchmarked program
nProcs (integer) – number of processes to use
args (list) – the arguments, therefore the input file
workingDir (string) – the working directory for the test case
name (string) – name of the job
- Returns
the job
- Return type
Job instance
-
getCleanJob
(workingDir, name)[source]¶ Creates a job which deletes all CGNS files in the working directory.
- Parameters
workingDir (string) – path to the working directory
name (string) – name of the job
- Returns
the job
- Return type
Job instance
-
getSingleTestcase
(curRep, nProcs, executable, tcPath)[source]¶ Creates a job list for a single test case. Creates the directories for the test case.
-
getTCList
(tcPath)[source]¶ Searches for CGNS files in the test case path.
- Parameters
tcPath (string) – path to the test case folder
- Returns
list of test case paths
- Return type
list of string
-
main
()[source]¶ Calls the sub routines to create a job list containing the benchmark. Executes the job list and cleans the output files afterwards.