Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hltIntegrationTests: run the whole HLT job with multithreading #6461

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
77 changes: 55 additions & 22 deletions HLTrigger/Configuration/scripts/hltIntegrationTests
Expand Up @@ -15,34 +15,39 @@ HELP="Run the integration tests over all paths in a given HLT menu.

Usage:
$NAME -h|--help
$NAME [-d|--dir WORKDIR] [-s|--setup SETUP] [-i|--input RAW] [-j|--jobs JOBS] [-x|--extra OPTIONS] [--mc]
$NAME [-d|--dir WORKDIR] [-s|--setup SETUP] [-i|--input RAW] [-j|--jobs JOBS]
[--streams STREAMS] [--threads THREADS] [-x|--extra OPTIONS] [--mc]
[ [-n|--size EVENTS] [-k|--skip EVENTS] | [-e|--events EVENTS] ] MENU

MENU is the HLT menu to test.

-s | --setup SETUP Use the Services and EventSetup modules from a different menu
(usefull when testing a ConfDB area with only some new paths)
-d | --dir WORKDIR Create all files and run all tests inside WORKDIR (defauls: ./hltintegration)
-i | --input INPUT Use the specified RAW data file as input
-n | --size EVENTS Run on EVENTS events (-1 for all, default is 100)
-k | --skip EVENTS Skip the first EVENTS (default is 0)
-e | --events EVENTS Run on a comma-separated list of EVENTS, a VEventRange
-j | --jobs JOBS Run JOBS jobs in parallel (default is 4)
-x | --extra OPTIONS Pass OPTIONS directly to hltGetConfiguration
--mc Run over MC instead of data (the default)
-h | --help Print this help message and exit.
MENU is the HLT menu to test.

-s | --setup SETUP Use the Services and EventSetup modules from a different menu
(usefull when testing a ConfDB area with only some new paths)
-d | --dir WORKDIR Create all files and run all tests inside WORKDIR (defauls: ./hltintegration)
-i | --input INPUT Use the specified RAW data file as input
-n | --size EVENTS Run on EVENTS events (-1 for all, default is 100)
-k | --skip EVENTS Skip the first EVENTS (default is 0)
-e | --events EVENTS Run on a comma-separated list of EVENTS, a VEventRange
-j | --jobs JOBS Run JOBS single trigger jobs in parallel (default to the number of CPUs)
--streams STEAMS Run with STREAMS paralle streams (i.e. events) (default to the number of CPUs / 4)
Use 0 to disable this option entirely.
--threads THREADS Run with THEADS threads when running the whole HLT (default to the number of CPUs)
Use 0 to disable this option entirely.
-x | --extra OPTIONS Pass OPTIONS directly to hltGetConfiguration
--mc Run over MC instead of data (the default)
-h | --help Print this help message and exit.


The supported formats for both menu specifications are:
- [hltdev:]/path/to/configuration[/Vn]
- orcoff:/path/to/configuration[/Vn]
- run:runnumber
The possible databases are \"hltdev\" (default, used for offline development) and \"orcoff\"
The possible databases are \"hltdev\" (default, used for offline development) and \"orcoff\"
(used for online menus). If no version is specified, the latest one is automatically used.
If \"run:\" is used instead, the actual HLT menu for the given run number is looked up and used.

It's possible to pass arbitrary command line options to hltGetConfiguration, using \"-x --option\".
To pass multiple options, enclose them in quotes, or use \"-x\" more than once.
To pass multiple options, enclose them in quotes, or use \"-x\" more than once.

Note: '--events' is not supported together with '--size' or '--skip'.

Expand All @@ -61,29 +66,34 @@ Exmples:

$NAME /users/fwyzard/physics/HLT/V6 -s orcoff:/cdaq/physics/Run2011/1e33/v1.3/HLT/V6

will test the paths from /users/fwyzard/physics/HLT/V6, using the environment from the
will test the paths from /users/fwyzard/physics/HLT/V6, using the environment from the
online menu \"1e33\" v1.3 V6

"

# parse command line argument and options
OPTS=$(getopt -n "$NAME" -o "s:d:i:j:n:k:e:x:h" -l "setup:,dir:,input:,jobs:,size:,skip:,events:,mc,extra:,help" -- "$@")
OPTS=$(getopt -n "$NAME" -o "s:d:i:j:n:k:e:x:h" -l "setup:,dir:,input:,jobs:,size:,skip:,streams:,threads:,events:,mc,extra:,help" -- "$@")

# invalid options
if [ $? != 0 ]; then
if [ $? != 0 ]; then
exit 1
fi

# reload the parsed options into the environment
eval set -- "$OPTS"

# check how many CPUs are available
CPUS=`getconf _NPROCESSORS_ONLN`

MENU=""
SETUP=""
INPUT=""
SIZE=100
SKIP=0
EVENTS=""
JOBS=4
JOBS=$CPUS
THREADS=$CPUS
STREAMS=$((CPUS / 4))
WORKDIR="hltintegration"
EXTRA=""
DATA="--data"
Expand Down Expand Up @@ -156,6 +166,14 @@ while true; do
fi
shift 2
;;
"--streams" )
STREAMS=$2
shift 2
;;
"--threads" )
THREADS=$2
shift 2
;;
"-x" | "--extra" )
EXTRA="$EXTRA $2"
shift 2
Expand Down Expand Up @@ -217,7 +235,7 @@ process.hltTriggerSummaryAOD = cms.EDProducer( "TriggerSummaryProducerAOD",
process.hltTriggerSummaryRAW = cms.EDProducer( "TriggerSummaryProducerRAW",
processName = cms.string( "@" )
)
process.HLTriggerFinalPath = cms.Path( process.hltTriggerSummaryAOD + process.hltTriggerSummaryRAW )
process.HLTriggerFinalPath = cms.Path( process.hltTriggerSummaryAOD + process.hltTriggerSummaryRAW )

@EOF
fi
Expand All @@ -235,6 +253,14 @@ process.source.skipEvents = cms.untracked.uint32( $SKIP )
@EOF
fi

# if non-zero, set the number of threads and streams for the whole hlt job
if ((THREADS > 0)); then
echo "process.options.numberOfThreads = cms.untracked.uint32( $THREADS )" >> hlt.py
fi
if ((STREAMS > 0)); then
echo "process.options.numberOfStreams = cms.untracked.uint32( $STREAMS )" >> hlt.py
fi

# dump the menu name, and its release template
log "HLT menu: $(head -n1 hlt.py | cut -c 3-)"

Expand Down Expand Up @@ -297,7 +323,14 @@ hlt.done: hlt.py
@EOF

log "Running..."
make -f .makefile -j$JOBS -k
# if the whole hlt job runs with multithreading, run it by itself
# otherwise, run it in parallel with the single-trigger jobs
if ((THREADS > 0)); then
make -f .makefile hlt
make -f .makefile -j$JOBS -k $TRIGGERS
else
make -f .makefile -j$JOBS -k
fi


# compare HLT results
Expand Down