Skip to content
Snippets Groups Projects

Update packages needed to make ConfigFlag dual use in Athena and AnalysisBase

Merged Chris Meyer requested to merge cjmeyer/athena:dual-use-config-flags into master

Note: this is a second attemp at !54147 (merged) which was reverted since it removed athena.py from AthAnalysis. I incorrectly used XAOD_ANALYSIS assuming it only referred to AnalysisBase (not the case; it also includes AthAnalysis). Here I've changed it to XAOD_STANDALONE, and added the proper labels to do a full suite a build checks.

This MR includes 3 new packages in AnalysisBase:

Control/AthenaCommon
Control/AthenaConfiguration
Tools/PyUtils

While AthenaCommon isn't strictly necessary, it pulls in Logging, Constants and SystemOfUnits which reduces the number of try ... except statements in AthenaConfiguration. The compilation is updated to only pull in these three files when in AnalysisBase, otherwise try statements in AnaAlgorithm think it's running in Athena (since this package is available) and set things up incorrectly in AnalysisBase.

Checks for the Gaudi environment are added to MetaReader so it also works when running in AnalysisBase. The main difference is to rely on FileMetaData instead of EventStreamInfo for filling many of the basic properties, e.g., isMC.

AllConfigFlags is largely kept the same. This means AnalysisBase has many flags loaded that are not relevant. If some of the irrelevant (for AB) flags are called, they will cause a crash since this results in an import of modules only available in Athena. Since they are lazy loaded, things work fine as long as these flags aren't called by a user.

Finally, six is removed (dual compatability for python 2 and 3) since it is no longer needed in 22.*, and this keeps us from adding it as a dependency to AnalysisBase.

Edited by Chris Meyer

Merge request reports

Pipeline #4430358 passed

Pipeline passed for 34089288 on cjmeyer:dual-use-config-flags

Approval is optional

Merged by Frank WinklmeierFrank Winklmeier 2 years ago (Sep 2, 2022 3:39pm UTC)

Merge details

  • Changes merged into master with d6b963a4 (commits were squashed).
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
72 if "HLTResult_EF" in collections:
73 return 1
74 elif "TrigNavigation" in collections:
75 return 2
76 elif any("HLTNav_Summary" in s for s in collections):
77 return 3
78 elif not flags.Input.Collections:
79 # Special case for empty input files (can happen in merge jobs on the grid)
80 # The resulting version doesn't really matter as there's nothing to be done, but we want a valid configuration
81 return 3
82
83 return default_version
84
85 acf.addFlag('Trigger.EDMVersion', lambda prevFlags: EDMVersion(prevFlags))
86
87 acf.addFlag("Sim.ISF.Simulator", lambda prevFlags: GetFileMD(prevFlags.Input.Files).get('simFlavour', 'Unkown'))
  • Tadej Novak
  • Tadej Novak
  • Tadej Novak
  • Tadej Novak
  • Tadej Novak
  • Tadej Novak
  • Hi @cjmeyer, thanks for following up so quickly!

    I'm mainly worried about readability of AllConfigFlags.py after this change. The other comments are minor.

    I also wonder about the duplication of python files between AthenaCommon and AnaAlgorithm packages. While I do not want to delay this much further, I'm afraid that we will end up with just more duplicated code. Tagging @khoo and @krumnack on their opinon on that.

    Also in the future I recommend opening multiple smaller MRs (this one could easily be split into metadata, AthenaCommon and flags ones). This usually makes the review process much faster.

    • Author Developer
      Resolved by Tadej Novak

      Thanks for the comments @tadej!

      For AllConfigFlags.py: along the lines of your Input config comments, I can alternatively keep the this file more-or-less as it currently is. Many of the options would be irrelevant, but it would require fewer changes / differences between projects. The only dangerous config flags are a few that call functions (like getInitialTimeStampsFromRunNumbers()) which won't work in AnalysisBase. However, since the config flags aren't populated unless requested by a user, it will only crash if someone asks for something they shouldn't. I would also need to add a "return" before the portion that contains calls to modules that are only available in Athena, and instead populate only the subset I currently do.

      How this is done probably comes down to design philosophy. I'm happy to go with whatever core developers feel is best here.

  • Chris Meyer added 1 commit

    added 1 commit

    • 6eedfd62 - Include comments from MR, fix AB compilation issue

    Compare with previous version

  • This merge request affects 4 packages:

    • Control/AthenaCommon
    • Control/AthenaConfiguration
    • Projects/AnalysisBase
    • Tools/PyUtils

    Affected files list will not be printed in this case

    Adding @krumnack ,@akraszna ,@ssnyder ,@rbianchi as watchers

  • Chris Meyer added 1 commit

    added 1 commit

    • 7f27130d - Remove stray print statement

    Compare with previous version

  • This merge request affects 4 packages:

    • Control/AthenaCommon
    • Control/AthenaConfiguration
    • Projects/AnalysisBase
    • Tools/PyUtils

    Affected files list will not be printed in this case

    Adding @krumnack ,@akraszna ,@ssnyder ,@rbianchi as watchers

  • :x: CI Result FAILURE (hash 7f27130d)

    Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon
    externals :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    make :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    tests :white_check_mark: :white_check_mark: :white_check_mark: :o: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AthSimulation: number of compilation errors 0, warnings 0
    :white_check_mark: AthGeneration: number of compilation errors 0, warnings 0
    :white_check_mark: AnalysisBase: number of compilation errors 0, warnings 0
    :white_check_mark: AthAnalysis: number of compilation errors 0, warnings 0
    :white_check_mark: DetCommon: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 58219]

  • :x: CI Result FAILURE (hash 6eedfd62)

    Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon
    externals :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    make :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    tests :o: :white_check_mark: :white_check_mark: :o: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AthSimulation: number of compilation errors 0, warnings 0
    :white_check_mark: AthGeneration: number of compilation errors 0, warnings 0
    :white_check_mark: AnalysisBase: number of compilation errors 0, warnings 0
    :white_check_mark: AthAnalysis: number of compilation errors 0, warnings 0
    :white_check_mark: DetCommon: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 58217]

  • Tadej Novak
  • Tadej Novak
  • :pencil: :scissors: CI integration tests for projects AnalysisBase are cancelled because of compilation error(s)

  • :x: CI Result FAILURE (hash 91b91a4f)

    Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon
    externals :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    make :white_check_mark: :white_check_mark: :white_check_mark: :o: :white_check_mark: :white_check_mark:
    tests :white_check_mark: :white_check_mark: :white_check_mark: :o: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AthSimulation: number of compilation errors 0, warnings 0
    :white_check_mark: AthGeneration: number of compilation errors 0, warnings 0
    :o: AnalysisBase: number of compilation errors 1, warnings 0
    :white_check_mark: AthAnalysis: number of compilation errors 0, warnings 0
    :white_check_mark: DetCommon: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 58208]

  • The CI is reporting the error:

      File "/var/lib/jenkins/workspace/CI-MERGE-REQUEST-CC7/master/Tools/PyUtils/bin/apydep.py", line 15, in <module>
        import pygraphviz
    ModuleNotFoundError: No module named 'pygraphviz'

    and I see there were some changes related to that package in the CMakeLists, so could you please look into fixing this?
    Albert (L1)

  • Chris Meyer marked this merge request as draft

    marked this merge request as draft

  • Chris Meyer added 266 commits

    added 266 commits

    • 7f27130d...65fc58eb - 265 commits from branch atlas:master
    • 436c812a - Update packages needed to make ConfigFlag dual use in Athena and AnalysisBase

    Compare with previous version

  • Chris Meyer added 1 commit

    added 1 commit

    • dfdde9ae - Fix CMake files so that AthAnalysis compiles properly

    Compare with previous version

  • Chris Meyer added 5 commits

    added 5 commits

    • ad0431e8 - Update packages needed to make ConfigFlag dual use in Athena and AnalysisBase
    • 91b91a4f - Fix CMake files so that AthAnalysis compiles properly
    • 6eedfd62 - Include comments from MR, fix AB compilation issue
    • 7f27130d - Remove stray print statement
    • 34089288 - Fixing compile and ctest errors

    Compare with previous version

  • Author Developer

    Sorry for the mess above. I pushed a bad git rebase (didn't squash things far enough back and lost changes) and had to reset it. All comments should now be addressed, although I'm leaving one open with @tadej to keep things from merging.

    I've fixed the compilation issues from the previous CI and things look good locally. Removing Draft now to re-run CI tests.

  • Chris Meyer marked this merge request as ready

    marked this merge request as ready

  • This merge request affects 4 packages:

    • Control/AthenaCommon
    • Control/AthenaConfiguration
    • Projects/AnalysisBase
    • Tools/PyUtils

    Affected files list will not be printed in this case

    Adding @krumnack ,@akraszna ,@ssnyder ,@rbianchi as watchers

  • :white_check_mark: CI Result SUCCESS (hash 34089288)

    Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon
    externals :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    make :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    tests :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AthSimulation: number of compilation errors 0, warnings 0
    :white_check_mark: AthGeneration: number of compilation errors 0, warnings 0
    :white_check_mark: AnalysisBase: number of compilation errors 0, warnings 0
    :white_check_mark: AthAnalysis: number of compilation errors 0, warnings 0
    :white_check_mark: DetCommon: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output [CI-MERGE-REQUEST-CC7 58253]

  • From L1 side, this looks fine. I'll set review-pending-expert, so Tadej can comment. -L1

  • For the first version this looks OK for me now.

    I think we should also sweep to 22.0 to avoid conflicts in the future.

  • Tadej Novak resolved all threads

    resolved all threads

  • Chris Meyer changed the description

    changed the description

  • mentioned in commit d6b963a4

  • Sweep summary
    failed:

    • 22.0
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading