ATLAS Offline Software
Loading...
Searching...
No Matches
python.TrigValSteering.CheckSteps Namespace Reference

Classes

class  RefComparisonStep
class  InputDependentStep
class  LogMergeStep
class  RootMergeStep
class  ZipStep
class  CheckLogStep
class  RegTestStep
class  RootCompStep
class  TailStep
class  DownloadRefStep
class  HistCountStep
class  ChainDumpStep
class  ChainCompStep
class  TrigTestJsonStep
class  CheckFileStep
class  ZeroCountsStep
class  MessageCountStep

Functions

 produces_log (step)
 default_check_steps (test, checkfile_input='AOD.pool.root, ESD.pool.root, RDO_TRIG.pool.root, DAOD_PHYS.DAOD.pool.root')
 add_step_after_type (step_list, ref_type, step_to_add)

Detailed Description

Definitions of post-exec check steps in Trigger ART tests

Function Documentation

◆ add_step_after_type()

add_step_after_type ( step_list,
ref_type,
step_to_add )
Insert step_to_add into step_list after the last step of type ref_type.
If the list has no steps of type ref_type, append step_to_add at the end of the list.

Definition at line 802 of file CheckSteps.py.

802def add_step_after_type(step_list, ref_type, step_to_add):
803 '''
804 Insert step_to_add into step_list after the last step of type ref_type.
805 If the list has no steps of type ref_type, append step_to_add at the end of the list.
806 '''
807 index_to_add = -1
808 for index, step in enumerate(step_list):
809 if isinstance(step, ref_type):
810 index_to_add = index+1
811 if index_to_add > 0:
812 step_list.insert(index_to_add, step_to_add)
813 else:
814 step_list.append(step_to_add)

◆ default_check_steps()

default_check_steps ( test,
checkfile_input = 'AOD.pool.root,ESD.pool.root,RDO_TRIG.pool.root,DAOD_PHYS.DAOD.pool.root' )
Create the default list of check steps for a test. The configuration
depends on the package name and the type of exec steps.

Definition at line 693 of file CheckSteps.py.

693def default_check_steps(test, checkfile_input='AOD.pool.root,ESD.pool.root,RDO_TRIG.pool.root,DAOD_PHYS.DAOD.pool.root'):
694 '''
695 Create the default list of check steps for a test. The configuration
696 depends on the package name and the type of exec steps.
697 '''
698
699 check_steps = []
700 log_to_check = None
701 log_to_zip = None
702
703 # Log merging
704 if len(test.exec_steps) == 1:
705 exec_step = test.exec_steps[0]
706 if exec_step.type == 'athenaEF' and produces_log(exec_step):
707 log_to_check = exec_step.get_log_file_name()
708 else:
709 logmerge = LogMergeStep()
710 logmerge.merged_name = 'athena.log'
711 logmerge.log_files = []
712 for exec_step in test.exec_steps:
713 if not produces_log(exec_step):
714 continue
715 logmerge.log_files.append(exec_step.get_log_file_name())
716 check_steps.append(logmerge)
717
718 if len(check_steps) > 0 and isinstance(check_steps[-1], LogMergeStep):
719 log_to_check = check_steps[-1].merged_name
720 log_to_zip = check_steps[-1].merged_name
721
722 # Reco_tf log merging
723 reco_tf_steps = [step for step in test.exec_steps if step.type in ['Reco_tf', 'Trig_reco_tf', 'Derivation_tf']]
724 if len(reco_tf_steps) > 0:
725 reco_tf_logmerge = LogMergeStep('LogMerge_Reco_tf')
726 reco_tf_logmerge.warn_if_missing = False
727 # FIXME: drop AODtoDAOD once test_trigAna_AODtoDAOD_run2_build.py is migrated to Derivation_tf
728 tf_names = ['HITtoRDO', 'Overlay', 'RDOtoRDOTrigger', 'RAWtoESD', 'ESDtoAOD',
729 'PhysicsValidation', 'RAWtoALL',
730 'BSRDOtoRAW', 'DRAWCOSTtoNTUPCOST', 'AODtoNTUPRATE', 'Derivation', 'AODtoDAOD']
731 reco_tf_logmerge.log_files = ['log.'+tf_name for tf_name in tf_names]
732 if not get_step_from_list('LogMerge', check_steps):
733 for step in reco_tf_steps:
734 reco_tf_logmerge.log_files.append(step.get_log_file_name())
735 reco_tf_logmerge.merged_name = 'athena.merged.log'
736 log_to_zip = reco_tf_logmerge.merged_name
737 if log_to_check is not None:
738 reco_tf_logmerge.log_files.append(log_to_check)
739 log_to_check = reco_tf_logmerge.merged_name
740 log_to_check = reco_tf_logmerge.merged_name
741 check_steps.append(reco_tf_logmerge)
742
743 # Histogram merging for athenaEF
744 if any(step.type == 'athenaEF' for step in test.exec_steps):
745 histmerge = RootMergeStep('HistMerge')
746 histmerge.merged_file = 'expert-monitoring.root'
747 histmerge.input_file = 'athenaHLT_workers/*/expert-monitoring.root expert-monitoring-mother.root'
748 histmerge.rename_suffix = '-mother'
749 check_steps.append(histmerge)
750
751 # CheckLog for errors
752 checklog = CheckLogStep('CheckLog')
753 if log_to_check is not None:
754 checklog.log_file = log_to_check
755 check_steps.append(checklog)
756
757 # CheckLog for warnings
758 checkwarn = CheckLogStep('Warnings')
759 checkwarn.check_errors = False
760 checkwarn.check_warnings = True
761 if log_to_check is not None:
762 checkwarn.log_file = log_to_check
763 check_steps.append(checkwarn)
764
765 # MessageCount
766 msgcount = MessageCountStep('MessageCount')
767 for logmerge in [step for step in check_steps if isinstance(step, LogMergeStep)]:
768 msgcount.skip_logs.append(logmerge.merged_name)
769 check_steps.append(msgcount)
770
771 # Tail (probably not so useful these days)
772 tail = TailStep()
773 if log_to_check is not None:
774 tail.log_file = log_to_check
775 check_steps.append(tail)
776
777 # Histogram-based steps
778 check_steps.append(RootCompStep())
779 check_steps.append(ChainDumpStep())
780 check_steps.append(HistCountStep())
781
782 # ZeroCounts
783 check_steps.append(ZeroCountsStep())
784
785 # Extra JSON
786 check_steps.append(TrigTestJsonStep())
787
788 # CheckFile
789 check_steps.append(CheckFileStep(input_file=checkfile_input))
790
791 # Zip the merged log (can be large and duplicates information)
792 if log_to_zip is not None:
793 zip_step = ZipStep()
794 zip_step.zip_input = log_to_zip
795 zip_step.zip_output = log_to_zip+'.tar.gz'
796 check_steps.append(zip_step)
797
798 # return the steps
799 return check_steps
800
801

◆ produces_log()

produces_log ( step)
Helper function checking whether a Step output_stream value
indicates that it will produce a log file

Definition at line 684 of file CheckSteps.py.

684def produces_log(step):
685 '''
686 Helper function checking whether a Step output_stream value
687 indicates that it will produce a log file
688 '''
689 return step.output_stream == Step.OutputStream.FILE_ONLY or \
690 step.output_stream == Step.OutputStream.FILE_AND_STDOUT
691
692