![]() |
ATLAS Offline Software
|
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc.h and will be non-nullptr in case the GaudiSvc/AthenaKernel shared libraries have been loaded. More...
Namespaces | |
| namespace | details |
| namespace | DsoUtils |
| namespace | Options |
| namespace | detail |
| namespace | Units |
Classes | |
| class | Chrono |
Exception-safe IChronoSvc caller. More... | |
| class | CondObjDeleter |
| Deletion object for conditions payloads. More... | |
| class | IMessageSvcHolder |
| get a IMessageSvc* on 1st use (if not set) and release it on ~ More... | |
| class | IConditionsCleanerSvc |
| Interface for doing garbage collection of conditions objects. More... | |
| class | IInputRename |
| Interface to retrieve input rename map. More... | |
| class | ToolLock |
RAII helper for acquiring the lock of an ILockableTool. More... | |
| struct | InputRenameEntry |
| Type of the input rename map: sgkey_t -> sgkey_t. More... | |
| class | IRCUSvc |
| Interface for RCU service. More... | |
| class | ISlimmingHdlr |
| This class defines a protocol to slim objects (removing parts of that object). More... | |
| class | IThinningHdlr |
| This class defines a protocol to pack and unpack thinned collections. More... | |
| class | DvThinningHdlr |
Handle DataProxy holding DataVector. More... | |
| class | StdThinningHdlr |
Handle DataProxy holding std::vector<T> This class defines a (type-safe) protocol to pack and unpack thinned DataVector. More... | |
| class | IdcThinningHdlr |
Handle DataProxy holding IdentifiableContainer This class defines a (type-safe) protocol to pack and unpack thinned IdentifiableContainer. More... | |
| struct | get_thinning_handler |
| metafunction to automagically dispatch on the type of a container and fetch the right thinning handler More... | |
| class | RCURead |
Helper to read data from a RCUObject. More... | |
| class | RCUReadQuiesce |
Helper to read data from a RCUObject. More... | |
| class | RCUUpdate |
Helper to update data in a RCUObject. More... | |
| class | IRCUObject |
| Base object class for RCU-style synchronization for Athena. More... | |
| class | RCUObject |
| Wrapper object controlled by RCU synchonization. More... | |
| class | RCUUpdater |
| Implementation of Updater for RCUSvc. More... | |
| class | RecyclableDataQueue |
| Holder for recyclable objects. More... | |
| class | Timeout |
| Singleton to access the timeout flag. More... | |
| class | TimeoutMaster |
| Class to modify timeout flag. More... | |
| struct | TPCnvVers |
| struct | TPCnvType |
| struct | StatusCategory |
| struct | RCUObjectGraceSets |
| class | ConditionsCleanerSvc |
| Facade class for conditions garbage collection. More... | |
| class | DelayedConditionsCleanerSvcProps |
| class | DelayedConditionsCleanerSvc |
| Clean conditions containers after a delay. More... | |
| class | RCUSvc |
| Service to allow cleaning up RCU objects at the EndEvent. More... | |
| class | ROOTMessageFilterSvc |
| Service for filtering "ROOT messages" in Athena. More... | |
| class | ThinningCacheTool |
| Create ThinningCache for a given stream. More... | |
| class | Signal |
| Utilities for handling signals and fatal errors. More... | |
| class | LeafCnv |
| class | NtupleCnvSvc |
| class | RootAsciiDumperAlg |
| class | RootBranchAddress |
A simple class to hold the buffer of a TBranch from a TTree. More... | |
| class | RootCnv |
| This class provides the abstract converter to translate an object to/from its persistent ROOT representation. More... | |
| class | RootCnvSvc |
| This class provides the interface between Athena and RootSvc. More... | |
| class | RootConnection |
| This class provides the implementation of Athena::RootConnection class, similar to Gaudi IDataConnection. More... | |
| class | DataBucketBranch |
| class | RootGlobalsRestore |
| state of a few global resources from ROOT and restores their initial value upon d-tor call. More... | |
| class | RootNtupleEventContext |
| ROOT specific event selector context. More... | |
| class | RootNtupleEventSelector |
Class implementing the GAUDI IEvtSelector interface using ROOT TTree as a backend. More... | |
| class | RootNtupleOutputMetadataTool |
| This is the AthenaRoot version of AthenaServices/AthenaOutputStreamTool. More... | |
| class | RootNtupleOutputStream |
| algorithm that marks for write data objects in SG More... | |
| class | RootOutputStreamTool |
| This is the AthenaRoot version of AthenaServices/AthenaOutputStreamTool. More... | |
| class | RootSvc |
| This class provides the interface to the ROOT software. More... | |
| class | xAODBranchAddress |
| A simple class to do the retrieve from TEvent. More... | |
| class | xAODCnv |
| class | xAODCnvSvc |
| class | xAODEventContext |
| event selector context ... just holds reference back to the selector More... | |
| class | xAODEventSelector |
Class implementing the GAUDI IEvtSelector interface using ROOT TTree as a backend. More... | |
| class | DBLock |
| Common database lock. More... | |
Typedefs | |
| using | InputRenameMap_t = SG::SGKeyMap<InputRenameEntry> |
| typedef void(* | DummyHandlerType) (int) |
Dummy handler type for standard signal() function. | |
| typedef RootNtupleEventContext::FileNames_t | FileNames_t |
Enumerations | |
| enum class | Status : StatusCode::code_t { TIMEOUT = 10 , MISSING_DATA = 11 } |
| Athena specific StatusCode values. More... | |
Functions | |
| std::string | typeinfoName (const std::type_info &ti) |
Convert a type_info to a demangled string. | |
| IMessageSvc * | getMessageSvc (bool quiet=false) |
| IMessageSvc * | getMessageSvc (const Options::CreateOptions o, bool quiet=false) |
| void | reportMessage (IMessageSvc *ims, const std::string &source, int type, const std::string &message) |
| Wrappers for some of the IMessageSvc methods These can be used from libraries without explicit Gaudi dependency via weak linking. | |
| int | outputLevel (const IMessageSvc *ims, const std::string &source) |
| void | setOutputLevel (IMessageSvc *ims, const std::string &source, int level) |
| template<typename... ARGS> | |
| RecyclableDataObject (std::shared_ptr< queue_t > queue, ARGS &&... args) | |
| Helper for recycling objects from event to event. | |
| virtual unsigned long | release () override |
| DataObject release method. | |
| int | ubsan_boost_suppress () |
| StatusCode ROOTMessageFilterSvc::initialize | ATLAS_NOT_THREAD_SAFE (void) |
| Return the file descriptor #fataldump() uses for output. | |
| static void | SignalDumpLibs (const SharedLibrary::LibraryInfo &info, IOFD fd) |
| Internal #Signal::fataldump() dumper to produce the list of currently loaded shared libraries. | |
| void Signal::handleQuit | ATLAS_NOT_THREAD_SAFE (QuitHook hook) |
| void Signal::handleFatal | ATLAS_NOT_THREAD_SAFE (const char *applicationName, IOFD fd, FatalHook hook, FatalReturn mainreturn, unsigned options) |
| Install default handler for fatal signals. | |
| void Signal::quit | ATLAS_NOT_THREAD_SAFE (int sig, siginfo_t *info, void *x) |
| The quit signal handler. | |
| bool Signal::fatalDump | ATLAS_NOT_THREAD_SAFE (int sig, siginfo_t *info, void *extra, IOFD fd, unsigned options) |
| find_coll_idx (-1, coll_idx, tuple_idx) | |
| return m_collEvts | back ().back().max_entries |
Variables | |
| std::atomic< bool > | getMessageSvcQuiet |
| Set this to force off the warning messages from getMessageSvc (in unit tests, for example). | |
| std::shared_ptr< queue_t > | m_queue |
| The queue on which this object will be placed when it is recycled. | |
| int | ubsan_boost_suppress_ = ubsan_boost_suppress() |
| static SharedLibrary::InfoHandler * | SignalDumpCallback = 0 |
| Shared library dump callback for #Signal::fataldump(). | |
| static char | buf [SIGNAL_MESSAGE_BUFSIZE] |
| Dump application state information on a fatal signal. | |
| const | |
| helper method to get the collection index (into m_inputCollectionsName) and tuple index (into m_tupleNames')
for a given event index evtidx`. | |
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc.h and will be non-nullptr in case the GaudiSvc/AthenaKernel shared libraries have been loaded.
| typedef void(* Athena::DummyHandlerType) (int) |
Dummy handler type for standard signal() function.
Definition at line 109 of file SealSignal.cxx.
Definition at line 213 of file RootNtupleEventSelector.cxx.
Definition at line 32 of file InputRenameMap.h.
|
strong |
Athena specific StatusCode values.
These can be used in place of Gaudi's StatusCode::XYZ if additional information should be returned. Some of these codes will result in special treatment of the event (e.g. sending them to the debug stream in the HLT).
Only generic return codes should be defined here. Algorithm-specific return values should be encoded in separate enums in the respective packages.
| Enumerator | |
|---|---|
| TIMEOUT | Timeout during event processing. |
| MISSING_DATA | Missing/corrupted input data. |
Definition at line 22 of file AthStatusCode.h.
| void Signal::handleFatal Athena::ATLAS_NOT_THREAD_SAFE | ( | const char * | applicationName, |
| IOFD | fd, | ||
| FatalHook | hook, | ||
| FatalReturn | mainreturn, | ||
| unsigned | options ) |
Install default handler for fatal signals.
This method installs a handler for fatal signals such as floating point exceptions, illegal instructions, and memory violations. The behaviour is more precisely determined by options, a bitwise or of the option constants defined in the class declaration.
applicationName sets the application name to be used to report the signal in #fatalDump(). fd sets the file descriptor to which the fatal signal message is written; by default this will be the standard error output. hook sets the pre-exit application hook to invoke, mainreturn sets the hook to return to back to the application "main loop" (i.e. ignore the signal by jumping out of the signal back to the somewhere higher up in the application).
Options left to default values will not change the current state. This allows one to re-install signal handlers without disturbing already registered information. Use this to restore handlers after some other library has meddled with the handlers.
This installs #fatal() as the handler for fatal signals and on Windows for otherwise unhandled fatal structured exceptions. If #FATAL_ON_QUIT is included in options, quitting related signals (see #quit()) are also considered fatal. If #FATAL_ON_INT is set, SIGINT is considered fatal—but see also #fatal() documentation. If #USR1_DUMP_CORE is set, DebugAids::coredump is registered as a handler for SIGUSR1 (please note the security risks of this option in its documentation).
A multi-threaded application should call this method in each thread. (FIXME: Calling this in one thread and blocking signals in others won't work on Linux, and in any case will probably produce nonsense stack traces (unless stacktrace can be fixed to dump the stacks of all the threads). Since the handler is always the same, I am not sure it will make the slightest difference which thread catches the signals, and on the other hand, it is best to dump the problems in the faulting thread if possible.)
Definition at line 646 of file SealSignal.cxx.
| bool Signal::fatalDump Athena::ATLAS_NOT_THREAD_SAFE | ( | int | sig, |
| siginfo_t * | info, | ||
| void * | extra, | ||
| IOFD | fd, | ||
| unsigned | options ) |
Definition at line 1515 of file SealSignal.cxx.
| bool Signal::fatalDump Athena::ATLAS_NOT_THREAD_SAFE | ( | int | sig, |
| siginfo_t * | info, | ||
| void * | x ) |
The quit signal handler.
The fatal signal handler.
This is the handler installed by #handleQuit(). Please use #handleQuit() and this method instead of installing your own handlers with #handle().
This handler first invokes the application hook if one was given to #handleQuit(). If the hook returns true, the signal handler for this signal (number sig) is reset to its default handler, and the signal is re-raised. This causes the program to exit via the signal and have a the correct exit status.
The application should do whatever is necessary for a graceful shutdown. Note however that this signal may arrive asynchronously at any time, hence it probably isn't safe to allocate memory, use the standard output streams, and so forth. What you can do is to set a flag, return false to return back to your application, detect the flag setting and drain your current event loop, and then quit. But do note that if #FATAL_AUTO_EXIT was set in call to #handleFatal(), #fatal() will call #quit() which in turn calls the application hook. Thus the hook should make sure it returns true if the application has crashed as noted in the documentation for <<QuitHook>>.
This is the handler installed by #handleFatal(). Please use #handleFatal() and this method instead of installing your handlers with #handle(). You should be able use the handler options to specify all the control you need.
The first thing this handler does is to reinstall itself for the benefit of platforms with single-delivery signals. Immediately after that it unblocks the delivery of that signal again, in case the signal handler itself gets in trouble. The next step is to check if the current crash level (the recursion of calls to #fatal(), see #fatalLevel()) exceeds the predefined limit of 4; if so, we give up and let the application die with this this signal. The handler then determines whether the signal is fatal: everything except SIGINT is, and SIGINT is fatal if #FATAL_ON_INT was set. If the signal is fatal, crash indicator is set (see #crashed()).
If this is not a nested fatal signal, the signal is fatal, and #FATAL_DUMP_CORE is set, the handler tries dump a core file. Then the handler will either attempt to quit or to return to the main program depending on #FATAL_AUTO_EXIT option setting. If it is set or this is a nested fatal signal, the handler will attempt to exit as follows: the application hook (or #fatalDump() in its absence) is invoked. If the hook returns true, #quit() is called; otherwise the signal handler will return (and crash or get an infinite sequence of fatal signals). Note that if an application hook is registered, #fataldump() is not called by default; the application hook must invoke it itself to get the dump.
If #FATAL_AUTO_EXIT is not set, the application must have registered a main return hook, which will be invoked. The hook must not return, but do a siglongjmp back to the main program (it should not throw unless all code is built with options that allow exceptions to be thrown from signal handlers). Note that the fatal signal may be asynchronous and may have arisen in code left in unsafe state, so returning back to the main program may not buy you much. It may make sense for a few things like rogue null pointer dereferences or floating point exceptions.
An interactive application using a main return hook should do something like this when the sigsetjmp in the main loop returns:
Using a main return will most likely leak memory like a sieve, but in balance, the application just got a fatal signal and the leak is unlikely to be the greatest concern.
Definition at line 817 of file SealSignal.cxx.
| void Signal::handleQuit Athena::ATLAS_NOT_THREAD_SAFE | ( | QuitHook | hook | ) |
Definition at line 581 of file SealSignal.cxx.
| bool Signal::crashed Athena::ATLAS_NOT_THREAD_SAFE | ( | void | ) |
Return the file descriptor #fataldump() uses for output.
Return the crash status indicator: true if a fatal signal has been received since the program started.
Return the depth to which #fatal() is currently recursively entered, or zero if #fatal() is not currently active.
Return the current application quit signal hook.
Return the current fatal signal handling options.
Return the application fatal signal return hook.
Return the application fatal signal hook.
Registered through #handleFatal().
Registered through #handleFatal().
Registered through #handleFatal().
Set on invocation to #handleFatal().
Registered through #handleQuit().
Use this method in application fatal hook to decide which operations are safe to perform. For example, if the attempts to notify the user result in further signals, it is best to avoid such attempts at deeper recursion levels. Currently #fatal() ceases to call the application's hooks and forces termination if the nesting level reaches 4.
Set if #fatal() is entered with a fatal signal.
Definition at line 103 of file ROOTMessageFilterSvc.cxx.
| return m_collEvts Athena::back | ( | ) |
| Athena::find_coll_idx | ( | - | 1, |
| coll_idx | , | ||
| tuple_idx | ) |
| IMessageSvc * Athena::getMessageSvc | ( | bool | quiet = false | ) |
Definition at line 20 of file getMessageSvc.cxx.
| IMessageSvc * Athena::getMessageSvc | ( | const Options::CreateOptions | o, |
| bool | quiet = false ) |
Definition at line 21 of file getMessageSvc.cxx.
Definition at line 60 of file getMessageSvc.cxx.
| Athena::RecyclableDataObject | ( | std::shared_ptr< queue_t > | queue, |
| ARGS &&... | args ) |
Helper for recycling objects from event to event.
In some cases, one wants to reuse already-allocated objects from event to event, rather than deleting and recreating them each time. This has typically been done for complicated objects, such as classes deriving from IdentfiableContainer.
Some care is obviously needed for this to work in a MT job. Rather than holding a pointer to a specific object from a class member, we instead maintain a concurrent_queue of pointers to objects. When we want an object, we get one from the queue; if the queue is empty, then we allocate a new one.
The object used should derive from DataObject. We bump the reference count by 1 when the object is allocated so that it won't get deleted by StoreGate. We also override release() so that when the reference count goes back to 1 it is `recycled'. When this happens, we call the recycle() method on the object (which should probably be protected) and put the object back on the queue to be allocated again.
Example use: *
DOBJ should derive from DataObject and should provide a member recycle().
Implementation note: one needs to be careful about the order in which objects are deleted during finalization. In particular, it is possible for a Gaudi component that holds a RecyclableDataQueue as a member to be deleted while there are still associated data objects registered in the event store. To be robust against this, we allocate the actual queue object separately from RecyclableDataQueue and manage it with shared_ptr; RecyclableDataObject then references the queue with a shared_ptr. */ template <class DOBJ> class RecyclableDataObject : public DOBJ { public: / Underlying queue type holding these objects. typedef tbb::concurrent_queue<DOBJ*> queue_t;
/**
Constructor.
| queue | Queue on which this object will be entered when it is released. |
| args... | Additional arguments to pass to the DOBJ constructor. |
|
overridevirtual |
DataObject release method.
This overrides the release() method of DataObject. Once the reference count falls back to 1 (meaning that the object is no longer referenced from StoreGate), we recycle the object back to the queue.
| void Athena::reportMessage | ( | IMessageSvc * | ims, |
| const std::string & | source, | ||
| int | type, | ||
| const std::string & | message ) |
Wrappers for some of the IMessageSvc methods These can be used from libraries without explicit Gaudi dependency via weak linking.
(see e.g. TrigConf::MsgStream in TrigConfBase)
DO NOT MODIFY THE SIGNATURE OF THESE METHODS WITHOUT UPDATING THE TRIGCONF SIDE !!!
Definition at line 56 of file getMessageSvc.cxx.
| void Athena::setOutputLevel | ( | IMessageSvc * | ims, |
| const std::string & | source, | ||
| int | level ) |
Definition at line 65 of file getMessageSvc.cxx.
|
static |
Internal #Signal::fataldump() dumper to produce the list of currently loaded shared libraries.
Called for every library detected by SharedLibrary::loaded().
| info | Information about this particular library. |
| fd | The file descriptor to output to. |
Definition at line 175 of file SealSignal.cxx.
| std::string Athena::typeinfoName | ( | const std::type_info & | ti | ) |
Convert a type_info to a demangled string.
| ti | The type_info to convert. |
A wrapper around System::typeinfoName. Moved out-of-line so that this header does not need to depend on System.h.
Definition at line 23 of file AthenaKernel/src/ClassName.cxx.
| int Athena::ubsan_boost_suppress | ( | ) |
Definition at line 21 of file ubsan_boost_suppress.cxx.
|
static |
Dump application state information on a fatal signal.
Use this method to dump program state on a delivery of a fatal signal. #fatal() uses this function automatically if no fatal handler hook has not been registered by the application.
This function attempts to be as maximally robust given that it runs in a signal handler in conditions where the program by definition is unstable. In other words, it allocates no memory and writes its output directly to a file descriptor with direct system calls. For this reason some initialisation is required; use #handleFatal() to register the current application name and an output file descriptor, preferably as early in the program as possible.
The dump will consist of the following items:
This always returns true so it is convenient for the application fatal hook to return with a call to this function.
Note that this function will not flush std::cerr or stderr before producing output, for stability reasons. If the streams have unflushed output in their buffers, that output may get mixed with unbuffered direct output from this function. If you wish to avoid this mixup and are willing to take the risk that those calls might crash, install an application hook that flushes the streams and then calls this function.
Definition at line 1508 of file SealSignal.cxx.
| Athena::const |
helper method to get the collection index (into m_inputCollectionsName) and tuple index (into m_tupleNames') for a given event index evtidx`.
returns -1 if not found. */ void RootNtupleEventSelector::find_coll_idx (int evtidx, long& coll_idx, long& tuple_idx) const { coll_idx = -1; tuple_idx = -1;
std::cout << "--find_coll_idx(" << evtidx << ")..." << std::endl << "--collsize: " << m_collEvts.size() << std::endl; for (size_t ituple = 0; ituple < m_collEvts.size(); ++ituple) { for (size_t icoll = 0; icoll < m_collEvts[ituple].size(); ++icoll) { CollMetaData &itr = m_collEvts[ituple][icoll]; if (itr.min_entries == -1) { TTree *tree = fetchNtuple(m_inputCollectionsName.value()[icoll], m_tupleNames[ituple]); if (tree) { long offset = 0; if (icoll > 0) { offset = m_collEvts[ituple][icoll-1].max_entries; } else if (ituple > 0) { offset = m_collEvts[ituple-1].back().max_entries; } itr.entries = tree->GetEntriesFast(); itr.min_entries = offset; itr.max_entries = offset + itr.entries; } else { throw "RootNtupleEventSelector: Unable to fetch ntuple"; } } std::cout << "--[" << i << "] => [" << itr.min_entries << ", " << itr.max_entries << ") evtidx=[" << evtidx << "]" << std::endl; if (itr.min_entries <= evtidx && evtidx < itr.max_entries) { coll_idx = icoll; tuple_idx = ituple; return; } } } }
/return total number of events in all TTree int RootNtupleEventSelector::size (Context& /*refCtxt
Definition at line 1262 of file RootNtupleEventSelector.cxx.
|
extern |
Set this to force off the warning messages from getMessageSvc (in unit tests, for example).
Definition at line 18 of file getMessageSvc.cxx.
|
private |
The queue on which this object will be placed when it is recycled.
Definition at line 115 of file RecyclableDataObject.h.
|
static |
Shared library dump callback for #Signal::fataldump().
Allocated at initialisation time in #Signal::handleFatal() so that we won't need to allocate memory in the middle of a fatal handler. This variable is deliberately private to this file (to keep Signal headers from referring to SharedLibrary for the local class).
Definition at line 118 of file SealSignal.cxx.
| int Athena::ubsan_boost_suppress_ = ubsan_boost_suppress() |
Definition at line 29 of file ubsan_boost_suppress.cxx.