Skip to content
Snippets Groups Projects
Commit 01ff9c2a authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'athenaHLT_cli' into 'master'

athenaHLT.py: Add --concurrent-events arg and use DFDcmEmuBackend

See merge request atlas/athena!16760
parents 3900b00a 05df8bde
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
# -*- mode: python -*-
# #
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
# #
...@@ -71,7 +72,6 @@ def arg_eval(s): ...@@ -71,7 +72,6 @@ def arg_eval(s):
"""Argument handler for pyton types (list, dict, ...)""" """Argument handler for pyton types (list, dict, ...)"""
return ast.literal_eval(s) return ast.literal_eval(s)
def update_pcommands(args, cdict): def update_pcommands(args, cdict):
"""Apply modifications to pre/postcommands""" """Apply modifications to pre/postcommands"""
...@@ -107,7 +107,6 @@ def update_run_params(args): ...@@ -107,7 +107,6 @@ def update_run_params(args):
dmask = hex(dmask) dmask = hex(dmask)
args.detector_mask = arg_detector_mask(dmask) args.detector_mask = arg_detector_mask(dmask)
def update_nested_dict(d, u): def update_nested_dict(d, u):
"""Update nested dictionary (https://stackoverflow.com/q/3232943)""" """Update nested dictionary (https://stackoverflow.com/q/3232943)"""
for k, v in u.iteritems(): for k, v in u.iteritems():
...@@ -117,6 +116,13 @@ def update_nested_dict(d, u): ...@@ -117,6 +116,13 @@ def update_nested_dict(d, u):
d[k] = v d[k] = v
return d return d
def set_athena_flags(args):
"""Set athena flags based on command line args"""
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
jp.ConcurrencyFlags.NumThreads = args.threads
jp.ConcurrencyFlags.NumConcurrentEvents = args.concurrent_events
jp.ConcurrencyFlags.NumProcs = args.nprocs
def HLTMPPy_cfgdict(args): def HLTMPPy_cfgdict(args):
""" """
...@@ -133,7 +139,7 @@ def HLTMPPy_cfgdict(args): ...@@ -133,7 +139,7 @@ def HLTMPPy_cfgdict(args):
'module' : 'HLTMPPU', 'module' : 'HLTMPPU',
'num_forks' : args.nprocs, 'num_forks' : args.nprocs,
'num_threads' : args.threads, 'num_threads' : args.threads,
'num_slots' : args.threads, 'num_slots' : args.concurrent_events,
'partition_name' : args.partition, 'partition_name' : args.partition,
'hard_timeout' : args.timeout, 'hard_timeout' : args.timeout,
'soft_timeout_fraction' : 0.9 'soft_timeout_fraction' : 0.9
...@@ -141,7 +147,7 @@ def HLTMPPy_cfgdict(args): ...@@ -141,7 +147,7 @@ def HLTMPPy_cfgdict(args):
cdict['datasource'] = { cdict['datasource'] = {
'module': 'dffileds', 'module': 'dffileds',
'dslibrary': 'DFFileBackend', 'dslibrary': 'DFDcmEmuBackend',
'compressionFormat': 'ZLIB', 'compressionFormat': 'ZLIB',
'compressionLevel': 2, 'compressionLevel': 2,
'file': args.file, 'file': args.file,
...@@ -257,6 +263,7 @@ def main(): ...@@ -257,6 +263,7 @@ def main():
g.add_argument('--skip-events', '-k', metavar='N', default=0, help='skip N first events') g.add_argument('--skip-events', '-k', metavar='N', default=0, help='skip N first events')
g.add_argument('--threads', metavar='N', type=int, default=1, help='number of threads') g.add_argument('--threads', metavar='N', type=int, default=1, help='number of threads')
g.add_argument('--nprocs', metavar='N', type=int, default=1, help='number of children to fork') g.add_argument('--nprocs', metavar='N', type=int, default=1, help='number of children to fork')
g.add_argument('--concurrent-events', metavar='N', type=int, help='number of concurrent events if different from --threads')
g.add_argument('--log-level', '-l', metavar='LVL', type=arg_log_level, default='INFO,ERROR', help='OutputLevel of athena,POOL') g.add_argument('--log-level', '-l', metavar='LVL', type=arg_log_level, default='INFO,ERROR', help='OutputLevel of athena,POOL')
g.add_argument('--precommand', '-c', metavar='CMD', action='append', default=[], g.add_argument('--precommand', '-c', metavar='CMD', action='append', default=[],
help='Python commands executed before job options or database configuration') help='Python commands executed before job options or database configuration')
...@@ -329,8 +336,13 @@ def main(): ...@@ -329,8 +336,13 @@ def main():
from AthenaCommon.Include import include from AthenaCommon.Include import include
include.setShowIncludes( args.show_includes ) include.setShowIncludes( args.show_includes )
# update parameters based on SOR # consistency checks for arguments
if not args.concurrent_events:
args.concurrent_events = args.threads
# Update args and set athena flags
update_run_params(args) update_run_params(args)
set_athena_flags(args)
# get HLTMPPY config dictionary # get HLTMPPY config dictionary
cdict = HLTMPPy_cfgdict(args) cdict = HLTMPPy_cfgdict(args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment