19#include <boost/dynamic_bitset.hpp>
25#include <tbb/concurrent_queue.h>
26#include <unordered_map>
40 using extends::extends;
79 unsigned int recursionDepth = 0 );
88 this,
"TopAlg", {},
"Names of the algorithms to be passed to the algorithm manager" };
90 "Override the un-clonability of algorithms. Use with caution!" };
92 this,
"CountAlgorithmInstanceMisses",
false,
93 "Count and print out algorithm instance misses. Useful for finding ways to improve throughput scalability." };
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
std::list< IAlgorithm * > getFlatAlgList() override
std::map< size_t, size_t > m_n_of_allowed_instances
StatusCode acquireResource(std::string_view name) override
Acquire a certain resource.
Gaudi::Property< bool > m_lazyCreation
boost::dynamic_bitset state_type
std::list< IAlgorithm * > m_algList
The list of all algorithms created within the Pool which are not top.
std::map< size_t, concurrentQueueIAlgPtr * > m_algqueue_map
StatusCode initialize() override
std::mutex m_resource_mutex
StatusCode releaseAlgorithm(std::string_view name, IAlgorithm *&algo) override
Release a certain algorithm.
Gaudi::Property< std::vector< std::string > > m_topAlgNames
Gaudi::Property< bool > m_countAlgInstMisses
~AlgResourcePool() override
std::list< IAlgorithm * > m_flatUniqueAlgList
The flat list of algorithms w/o clones.
void dumpInstanceMisses() const
Dump recorded Algorithm instance misses.
std::list< IAlgorithm * > getTopAlgList() override
StatusCode finalize() override
tbb::concurrent_bounded_queue< IAlgorithm * > concurrentQueueIAlgPtr
StatusCode releaseResource(std::string_view name) override
Release a certain resource.
std::list< IAlgorithm * > m_topAlgList
The list of top algorithms.
StatusCode stop() override
std::map< size_t, unsigned int > m_n_of_created_instances
state_type m_available_resources
StatusCode acquireAlgorithm(std::string_view name, IAlgorithm *&algo, bool blocking=false) override
Acquire a certain algorithm using its name.
std::unordered_map< std::string_view, unsigned int > m_algInstanceMisses
Counters for Algorithm instance misses.
std::map< size_t, state_type > m_resource_requirements
StatusCode start() override
StatusCode decodeTopAlgs()
Decode the top Algorithm list.
Gaudi::Property< bool > m_overrideUnClonable
StatusCode flattenSequencer(IAlgorithm *sequencer, std::list< IAlgorithm * > &alglist, unsigned int recursionDepth=0)
Recursively flatten an algList.
std::map< std::string_view, unsigned int > m_resource_indices
Implementation of property with value of concrete type.
The IAlgorithm is the interface implemented by the Algorithm base class.
const std::string & name() const override
Retrieve name of the service.
This class is used for returning status codes from appropriate routines.
Base class used to extend a class implementing other interfaces.