Decode the top alg list.
224 if (!algMan.isValid()){
225 error() <<
"Algorithm manager could not be properly fetched." <<
endmsg;
230 auto createAlg = [&algMan,
this] (
const std::string& item_type,
231 const std::string& item_name,
233 StatusCode createAlgSc = algMan->createAlgorithm(item_type,
239 this->warning() <<
"Algorithm " << item_type <<
"/" << item_name
240 <<
" could not be created." <<
endmsg;
248 for (
auto&
name : topAlgNames) {
252 const std::string& item_name =
item.name();
253 const std::string& item_type =
item.type();
256 if (!algoSmartIF.isValid()){
257 createAlg(item_type,item_name,algo);
261 algoSmartIF->sysInitialize();
272 if (!algorithm) fatal() <<
"Conversion from IAlgorithm to Algorithm failed" <<
endmsg;
276 debug() <<
"List of algorithms is: " <<
endmsg;
278 debug() <<
" o " << algo->type() <<
"/" << algo->name() <<
" @ " << algo <<
endmsg;
284 unsigned int resource_counter(0);
285 std::hash<std::string> hash_function;
286 for (
auto& ialgoSmartIF : m_flatUniqueAlgList) {
288 const std::string& item_name = ialgoSmartIF->name();
290 verbose() <<
"Treating resource management and clones of " << item_name <<
endmsg;
293 if (!algo) fatal() <<
"Conversion from IAlgorithm to Algorithm failed" <<
endmsg;
294 const std::string& item_type = algo->
type();
296 size_t algo_id = hash_function(item_name);
310 for (
auto& resource_name : ialgo->neededResources()){
311 auto ret =
m_resource_indices.insert(std::pair<std::string, unsigned int>(resource_name,resource_counter));
313 if (ret.second==
true) {
317 requirements.resize(resource_counter);
319 requirements[ret.first->second] =
true;
327 for (
unsigned int i =1,
end =ialgo->cardinality();
i<
end; ++
i){
328 debug() <<
"type/name to create clone of: " << item_type <<
"/" << item_name <<
endmsg;
330 createAlg(item_type,item_name,ialgoClone);
331 ialgoClone->sysInitialize();
332 queue->push(ialgoClone);
343 kv.second.resize(resource_counter);
ListAlg m_flatUniqueAlgList
The flat list of algorithms w/o clones.
StringArrayProperty m_topAlgNames
The names of the algorithms to be passed to the algorithm manager.
std::map< size_t, concurrentQueueIAlgPtr * > m_algqueue_map
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
const std::string & type() const override
The type of the algorithm object.
bool isFailure() const
Test for a status code of FAILURE.
state_type m_available_resources
Helper class to parse a string of format "type/name".
std::map< size_t, size_t > m_n_of_allowed_instances
tbb::concurrent_bounded_queue< IAlgorithm * > concurrentQueueIAlgPtr
auto end(reverse_wrapper< T > &w)
This class is used for returning status codes from appropriate routines.
concurrency::ExecutionFlowGraph * m_EFGraph
OMG yet another hack.
The IAlgorithm is the interface implemented by the Algorithm base class.
const TYPE & value() const
explicit conversion
boost::dynamic_bitset state_type
Base class from which all concrete algorithm classes should be derived.
StatusCode flattenSequencer(Algorithm *sequencer, ListAlg &alglist, const std::string &parentName, unsigned int recursionDepth=0)
Recursively flatten an algList.
std::map< size_t, state_type > m_resource_requirements
void addHeadNode(const std::string &headName, bool modeOR, bool allPass, bool isLazy)
Add a node, which has no parents.
ListAlg m_topAlgList
The list of top algorithms.
std::map< std::string, unsigned int > m_resource_indices
void attachAlgorithmsToNodes(const std::string &algo_name, const T &container)
Attach pointers to real Algorithms (and their clones) to Algorithm nodes of the graph.
std::map< size_t, unsigned int > m_n_of_created_instances
ListAlg m_algList
The list of all algorithms created withing the Pool which are not top.