diff --git a/Hlt/Hlt1Conf/options/hlt1_example.py b/Hlt/Hlt1Conf/options/hlt1_example.py index d1af2554886f12bea75d6aca33ef81aede09ad87..2bd92eee66134619f2d57673c5e31d15a5497037 100644 --- a/Hlt/Hlt1Conf/options/hlt1_example.py +++ b/Hlt/Hlt1Conf/options/hlt1_example.py @@ -20,8 +20,11 @@ options.set_conds_from_testfiledb('MiniBrunel_2018_MinBias_FTv4_DIGI') def make_lines(): - return all_lines() + [ - debug_two_track_mva_line(), +# return [one_track_muon_highpt_line()] + + #return all_lines() + [ + return [ + # debug_two_track_mva_line(), one_track_muon_highpt_line(), ] diff --git a/Hlt/Moore/python/Moore/config.py b/Hlt/Moore/python/Moore/config.py index a45613a638fd7460822a928e968466d263283be2..bed7617ce924d0ef912f63fd5bb2a9c0ebbab42c 100644 --- a/Hlt/Moore/python/Moore/config.py +++ b/Hlt/Moore/python/Moore/config.py @@ -221,8 +221,8 @@ def report_writers_node(lines, hlt2 = all(l.name.startswith('Hlt2') for l in lines) assert hlt1 ^ hlt2, 'Expected exclusively all Hlt1 or all Hlt2 lines' if hlt1: - srm = make_selreports(physics_lines, erw) - algs.append(srm) + srm_node, srm = make_selreports(physics_lines, erw) + algs.append(srm_node) srw = HltSelReportsWriter( DecReports=erw.DecReportsLocation, SelReports=srm.SelReports, @@ -322,7 +322,7 @@ def run_moore(options, make_lines, public_tools=[]): config = configure_input(options) lines = make_lines() top_cf_node = moore_control_flow(options, lines) - config.update(configure(options, top_cf_node, public_tools=public_tools)) + config.update(configure(options, top_cf_node, public_tools=public_tools, barrier_algs=['SelReportsMaker'] )) # TODO pass config to gaudi explicitly when that is supported return config diff --git a/Hlt/Moore/python/Moore/selreports.py b/Hlt/Moore/python/Moore/selreports.py index c9df0d47cb8cbdf1b0b5cc1d6621d089cff88839..69cee5241baf5429302d1d53f2f073c2ba893e08 100644 --- a/Hlt/Moore/python/Moore/selreports.py +++ b/Hlt/Moore/python/Moore/selreports.py @@ -49,6 +49,14 @@ from PyConf.Algorithms import ( SelReportsMaker, ) +from PyConf.control_flow import ( + CompositeNode, + NodeLogic, +) + +from PyConf.application import plot_data_flow, plot_control_flow + + __all__ = ["make_selreports"] log = logging.getLogger(__name__) @@ -195,7 +203,8 @@ def line_outputs_for_selreports(line): def make_selreports(lines, decreports, **kwargs): - """Return a SelReportsMaker instance configured for the given lines. + """Return a tuple of a smart SelReportsMaker node plus + a SelReportsMaker instance configured for the given lines. Args: lines (list of HltLine): The lines to create SelReport objects @@ -203,6 +212,11 @@ def make_selreports(lines, decreports, **kwargs): decreports: DecReports data used as input to the SelReports maker. kwargs: Passed to the SelReportsMaker. """ + + print('Called make_selreports') + + + # Gather all outputs along with their type and decision names info = [(line.decision_name, output, output.type) for line in lines for output in line_outputs_for_selreports(line)] @@ -217,9 +231,44 @@ def make_selreports(lines, decreports, **kwargs): assert len(outputs) == len( set(outputs)), "multiple lines with identical output" - return SelReportsMaker( + srm = SelReportsMaker( DecReports=decreports, SelectionNames=names, CandidateTypes=types, Inputs=outputs, **kwargs) + + def wrap(line): + print('called wrap_line') + + return CompositeNode( + 'dummy_LAZY_AND_' + line.name, + combineLogic=NodeLogic.LAZY_AND, + children=[ child for child in line.node.children if not child.name.endswith('Prescaler') ] + line_outputs_for_selreports(line), + forceOrder=True) + + def has_output(line): + return line_outputs_for_selreports(line) + + + #from Hlt1Conf.lines.high_pt_muon import one_track_muon_highpt_line_TEST + #new_line = one_track_muon_highpt_line_TEST(name='COPY_Hlt1SingleHighPtMuonLine').node.children[-1] + #wrapped_lines = [ new_line ] + line_outputs_for_selreports(new_line) + + #wrapped_lines = [wrap_line(line) for line in lines if wrap_line(line)] + #wrapped_lines = [wrap(line) for line in lines if has_output(line) ] + #print ('AAAAAAAAAAAAAAAAAAAA' , lines[1]) + wrapped_lines = [ wrap(line) for line in lines ] + + srm_node = CompositeNode( + 'selreports_maker', + combineLogic=NodeLogic.NONLAZY_AND, + #children=wrapped_lines + [srm], + children= wrapped_lines + [srm], + forceOrder=True) + + + plot_control_flow(srm_node, "TESTCONTROL_SRM") + plot_data_flow([srm_node], "TESTDATA_SRM") + + return srm_node, srm diff --git a/PyConf/python/PyConf/application.py b/PyConf/python/PyConf/application.py index cfbb93cb40c443a98cfde6be8f72ec5f5dfa09e7..9be03eab4530879032a234497ef5756995882154 100644 --- a/PyConf/python/PyConf/application.py +++ b/PyConf/python/PyConf/application.py @@ -18,7 +18,7 @@ from six import string_types import pydot import six -from Gaudi.Configuration import appendPostConfigAction, ConfigurableUser, INFO +from Gaudi.Configuration import appendPostConfigAction, ConfigurableUser, INFO, DEBUG import GaudiKernel.ProcessJobOptions from GaudiConf import IOHelper from RawEventFormat import Raw_location_db @@ -470,7 +470,7 @@ def assert_empty_dataondemand_service(): assert DataOnDemandSvc().NodeMap == {}, DataOnDemandSvc().NodeMap -def configure(options, control_flow_node, public_tools=[]): +def configure(options, control_flow_node, public_tools=[], barrier_algs=[]): # TODO get rid of magic initial time (must go to configure_input) INITIAL_TIME = 1433509200 @@ -522,7 +522,9 @@ def configure(options, control_flow_node, public_tools=[]): CompositeCFNodes=[node.represent() for node in nodes], MemoryPoolSize=options.memory_pool_size, ThreadPoolSize=options.n_threads, - EnableLegacyMode=options.scheduler_legacy_mode)) + EnableLegacyMode=options.scheduler_legacy_mode, + BarrierAlgNames=barrier_algs, + OutputLevel=DEBUG)) appMgr = config.add( ApplicationMgr(OutputLevel=options.output_level, EventLoop=scheduler)) appMgr.ExtSvc.insert(