Skip to content
Snippets Groups Projects

Add new StatusCode category to return filterpassed states from functional algorithms

Merged Christoph Hasse requested to merge chasse_AlgExecFree_Algorithm_eval into master

Add a new FunctionalFilterDecision StatusCode category to return an algorithm's filterPassed state.
This allows LHCb to remove the need for AlgExecState update calls in its scheduler and circumvent sysExecute entirely.

cc: @nnolte @clemenci

Edited by Christoph Hasse

Merge request reports

Pipeline #1155537 passed

Pipeline passed for 78e6d600 on chasse_AlgExecFree_Algorithm_eval

Approved by

Merged by Marco ClemencicMarco Clemencic 5 years ago (Oct 22, 2019 10:53am UTC)

Merge details

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

Pipeline #1170603 passed

Pipeline passed for a729b15e on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    Compare with previous version

    • Resolved by Christoph Hasse

      From an architectural point of view, adding a new method to Algorithm that is not reflected in LegacyAlgorithm, or circumvents parts of the design (ie, keeping the AlgExecState information up to date), is not a good solution to this problem. How do you enforce keeping that AlgExecState current if a user decides to use the evaluate method instead of execute? This information is essential to proper operation of other parts of the framework. LHCb is not the only one who uses the reentrant Algorithm base class - all new ATLAS Algorithms do, and there is a strong effort to migrate as many old ones as possible as well.

      It seems to me that better approaches would be to optimize the AlgExecStateSvc for your use case, or return extra information via the extension to the StatusCode that Frank developed.

    • Resolved by Christoph Hasse

      Since this is something that is entirely LHCb specific, it could be better to implement it in a Brunel package. Just like ATLAS has AthAlgorithm, LHCb can have its LHCbAlgorithm which will implement the evaluate method, and the LHCb scheduler can talk directly to it.

  • The AlgExecStateSvc was designed to remove state information from the reentrant Alg base class, which was first an LHCb requirement ;-}

    I agree that we don't need the enabled/disabled checking for every event when using the scheduler. However, we sill need backward compatibility for serial usage without the scheduler, so I don't think we can get rid of this yet. Pity.

    • Resolved by Christoph Hasse

      It seems that the best way to optimize performance for LHCb would be to inherit only from IAlgorithm, and have the complete implementation of LHCbAlgorithm in Brunel. This way you can get rid of or not implement all the methods you don't need. Or you can just override sysExecute to do whatever you want instead of calling AlgExecStateSvc.

  • At least checking `am I enabled' is just directly accessing a simple bool at a known location... so while I find it annoying as it is done 'in the wrong place', and thus makes things less clear (improper separation of responsabilities), in practice it doesn't hurt so much...

  • added 1 commit

    • c321e18f - change functional base classes to use new evaluate method.

    Compare with previous version

  • added 1 commit

    Compare with previous version

    • Resolved by Christoph Hasse

      So there are 2 issues:

      • the AlgExecStateSvc is too slow for your needs
      • you need to get the setFilterPassed flag out of execute

      Why not change Algorithm::execState to not use the AlgExecStateSvc if it's not wanted/instantiated. Since it returns a ref you'll need to be a bit tricky - maybe add a UnusedState that turns all setState calls into a noop. Then return the setFilterPassed flag as an extension to the StatusCode.

  • mentioned in merge request lhcb/LHCb!2171 (merged)

  • added 1 commit

    • c0999436 - extend statuscode instead of new evaluate method

    Compare with previous version

  • added 1 commit

    • 7cd997cd - implement evaluate method via inheritance from special base class

    Compare with previous version

  • Christoph Hasse changed title from WIP: Add new execute method to Algorithm base class to WIP: Add new execute method to functional algorithms

    changed title from WIP: Add new execute method to Algorithm base class to WIP: Add new execute method to functional algorithms

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 3e297991 - Use StatusCode extension to return filter passed or failed from functional algorithms

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Christoph Hasse changed the description

    changed the description

  • Christoph Hasse resolved all threads

    resolved all threads

  • Christoph Hasse changed title from WIP: Add new execute method to functional algorithms to WIP: Add new StatusCode category to return filterpassed states from functional algorithms

    changed title from WIP: Add new execute method to functional algorithms to WIP: Add new StatusCode category to return filterpassed states from functional algorithms

  • Christoph Hasse unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Author Developer

    Hi @leggett @fwinkl,
    as discussed this now uses the StatusCode to return the FilterPassed decision.
    Hope this is more to your liking ;)

  • Frank Winklmeier
  • added 1 commit

    • f50800ba - change naming of new FilterDecision statuscode

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 78e6d600 - update string representation

    Compare with previous version

  • Marco Clemencic changed milestone to %v33r0

    changed milestone to %v33r0

  • Christoph Hasse resolved all threads

    resolved all threads

  • Niklas Stefan Nolte resolved all threads

    resolved all threads

  • Author Developer

    @fwinkl, @leggett if there are no outstanding comments anymore, could we maybe get the required approvals? :)

  • OK from my side. Although I don't have GitLab approval rights.

  • Charles Leggett
  • Niklas Stefan Nolte approved this merge request

    approved this merge request

  • Charles Leggett approved this merge request

    approved this merge request

  • Charles Leggett resolved all threads

    resolved all threads

  • Edited by Software for LHCb
  • added lhcb-gaudi-head label and removed Test on LHCb label

  • @clemenci this looks ok for LHCb, please go ahead (some refs need to be updated in Moore, but that'll be done today)

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