File: BatchBenchmarker.sh

package info (click to toggle)
vecgeom 1.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,928 kB
  • sloc: cpp: 88,717; ansic: 6,894; python: 1,035; sh: 582; sql: 538; makefile: 29
file content (30 lines) | stat: -rwxr-xr-x 733 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# A script to batch-test a list of volumes using the Benchmarker tool "BenchmarkShapeFromROOTFile"
# uses GNU parallel in order to run multiple tasks concurrently

detector=$1
filewithvolumelist=$2

function BenchTask(){
  NC='\033[0m' # no color
  GREEN='\033[1;32m'
  RED='\033[0;31m'
  errlog="BenchBatchErrlog"
  log="BenchBatchLog"
  detector=$1
  v=$2
  timeout 30m ./BenchmarkShapeFromROOTFile ${detector} ${v} 2> ${errlog}${v} > ${log}${v}
  rc=$?
  if [[ $rc == 0 ]]; then
   printf "${v} ${GREEN}passes${NC}\n"
   # if pass cleanup file
   rm ${errlog}${v}
  else
   printf "${v} ${RED}fails${NC}\n"
  fi
}
export -f BenchTask

for v in `cat ${filewithvolumelist}`; do
    sem -j+0 BenchTask $detector ${v}
done
sem --wait