Skip to content
Snippets Groups Projects

Use MessageSvc to handle ROOT messages

Merged Marco Clemencic requested to merge use-messagesvc-for-root-messages into master
All threads resolved!

The default ROOT error handler (the equivalent of Gaudi MessageSvc) prints messages to stderr, which is problematic with Gaudi based workflows that expect all messages to go through stdout and be filtered according to MessageSvc output level.

This MR replaces the ROOT error handler with an adapter function that redirects to MessageSvc.

There are a couple of drawbacks which the changes proposed here:

  • it works only if ROOT (gROOT) has been initialized before ApplicationMgr::configure, but my tests suggest this is always the case
  • every message sent by ROOT makes a call to IMessageSvc::outputLevel( source ) to decide if the message has to be printed or not, while MsgStream instances cache the thresholds; we can optimize the adapter caching internally the thresholds (e.g. with a static std::unordered_map<std::string, int> thresholds) or by using a global threshold for ROOT messages.

Merge request reports

Pipeline #5040460 passed

Pipeline passed for be086a4c on use-messagesvc-for-root-messages

Merged by Marco ClemencicMarco Clemencic 2 years ago (Jan 26, 2023 4:33pm UTC)

Loading

Pipeline #5050548 passed

Pipeline passed for 0069c7e8 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
  • mentioned in merge request lhcb/LHCb!3938 (closed)

  • mentioned in merge request lhcb/LHCb!3939 (closed)

  • Marco Clemencic added 2 commits

    added 2 commits

    • 16582dfb - Allow disabling use of MessageSvc for ROOT
    • 0768b104 - Restore original ROOT error handler at terminate

    Compare with previous version

  • Marco Clemencic resolved all threads

    resolved all threads

  • Marco Clemencic added 2 commits

    added 2 commits

    • 5cd6a7df - Allow disabling use of MessageSvc for ROOT
    • aad0e7e5 - Restore original ROOT error handler at terminate

    Compare with previous version

  • added 1 commit

    • 2d7f3471 - Restore original ROOT error handler at terminate

    Compare with previous version

  • Marco Clemencic resolved all threads

    resolved all threads

  • Marco Clemencic added 2 commits

    added 2 commits

    • 22723973 - Allow disabling use of MessageSvc for ROOT
    • 003faa12 - Restore original ROOT error handler at terminate

    Compare with previous version

  • Edited by Software for LHCb
    • Resolved by Marco Clemencic

      There is definitely some fallout from this on the ATLAS side. We are now starting to see warning messages from TClass that were previously suppressed. Likely that's related to our use of gErrorIgnoreLevel that is now being ignored. But I need to look more closely to be sure.

  • added 1 commit

    • be086a4c - Take into account ROOT message suppression in ROOTErrorHandlerAdapter

    Compare with previous version

  • Marco Clemencic resolved all threads

    resolved all threads

  • Marco Clemencic resolved all threads

    resolved all threads

  • About the default setting, the main reason why I started this exercise is that ROOT prints all messages to stderr, and in 6.26 we are getting a new Info message that we cannot avoid and it's causing our tests to fail in a way that is a bit tricky to hide. Redirecting the messages to stdout is a good workaround for us and the easiest way was to override the ROOT error handler.

    I'd like to keep the default to go to MessageSvc, but we can discuss.

  • mentioned in merge request atlas/athena!60061 (merged)

  • Frank Winklmeier approved this merge request

    approved this merge request

  • Looks good from the ATLAS side now.

  • Marco Clemencic mentioned in commit 0069c7e8

    mentioned in commit 0069c7e8

  • mentioned in merge request atlas/athena!60753 (merged)

  • Please register or sign in to reply
    Loading