| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

EventSchedulingState.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_EVENTSCHEDULINGSTATE_H
2 #define GAUDIHIVE_EVENTSCHEDULINGSTATE_H
3
4 #include "boost/dynamic_bitset.hpp"
5 #include "tbb/concurrent_vector.h"
6
7 #include <atomic>
8
9 // typedef for the event and algo state
10 typedef boost::dynamic_bitset<> state_type;
11
12 class EventSchedulingState
13 {
14 public:
15 EventSchedulingState( const unsigned int& n_algos, const unsigned int& n_products );
16 ~EventSchedulingState(){};
17
18 void algoFinished();
19 void algoStarts( unsigned int& index );
20 bool hasStarted( unsigned int& index ) const;
21 bool hasFinished() const { return ( m_algosFinished == m_numberOfAlgos ); }
22 const state_type& state() const { return m_eventState; }
23 void update_state( unsigned int& product_index );
24
25 private:
27 std::atomic_uint m_algosInFlight;
29 std::atomic_uint m_algosFinished;
31 unsigned int m_numberOfAlgos;
33 state_type m_eventState;
35 tbb::concurrent_vector<bool> m_algosStarted;
36 };
37
38 #endif // GAUDIHIVE_EVENTSCHEDULINGSTATE_H
EventSchedulingState::update_state
void update_state(unsigned int &product_index)
Definition: EventSchedulingState.cpp:26
EventSchedulingState::algoStarts
void algoStarts(unsigned int &index)
Definition: EventSchedulingState.cpp:20
EventSchedulingState::m_numberOfAlgos
unsigned int m_numberOfAlgos
Total number of algos.
Definition: EventSchedulingState.h:31
EventSchedulingState::~EventSchedulingState
~EventSchedulingState()
Definition: EventSchedulingState.h:16
EventSchedulingState::m_algosInFlight
std::atomic_uint m_algosInFlight
Number of algos in flight.
Definition: EventSchedulingState.h:27
EventSchedulingState::hasStarted
bool hasStarted(unsigned int &index) const
Definition: EventSchedulingState.cpp:18
EventSchedulingState::m_algosStarted
tbb::concurrent_vector< bool > m_algosStarted
Register of algorithms started.
Definition: EventSchedulingState.h:35
EventSchedulingState::state
const state_type & state() const
Definition: EventSchedulingState.h:22
state_type
boost::dynamic_bitset state_type
Definition: EventSchedulingState.h:10
EventSchedulingState::m_algosFinished
std::atomic_uint m_algosFinished
Number of finished algos.
Definition: EventSchedulingState.h:29
EventSchedulingState
Definition: EventSchedulingState.h:12
EventSchedulingState::m_eventState
state_type m_eventState
Event state recording which products are there.
Definition: EventSchedulingState.h:33
EventSchedulingState::algoFinished
void algoFinished()
Definition: EventSchedulingState.cpp:12
EventSchedulingState::hasFinished
bool hasFinished() const
Definition: EventSchedulingState.h:21
EventSchedulingState::EventSchedulingState
EventSchedulingState(const unsigned int &n_algos, const unsigned int &n_products)
Definition: EventSchedulingState.cpp:3