| The Gaudi Framework v28r2-patches (bc4ad17a)

- 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
5 #include "tbb/concurrent_vector.h"
6 #include "boost/dynamic_bitset.hpp"
7
8 #include <atomic>
9
10 // typedef for the event and algo state
11 typedef boost::dynamic_bitset<> state_type;
12
13
14 class EventSchedulingState {
15 public:
16 EventSchedulingState(const unsigned int& n_algos,const unsigned int& n_products);
17 ~EventSchedulingState(){};
18
19 void algoFinished();
20 void algoStarts(unsigned int& index);
21 bool hasStarted(unsigned int& index) const;
22 bool hasFinished() const {return (m_algosFinished == m_numberOfAlgos);}
23 const state_type& state() const {return m_eventState;}
24 void update_state(unsigned int& product_index);
25
26 private:
28 std::atomic_uint m_algosInFlight;
30 std::atomic_uint m_algosFinished;
32 unsigned int m_numberOfAlgos;
34 state_type m_eventState;
36 tbb::concurrent_vector<bool> m_algosStarted;
37 };
38
39
40 #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:21
EventSchedulingState::m_numberOfAlgos
unsigned int m_numberOfAlgos
Total number of algos.
Definition: EventSchedulingState.h:32
EventSchedulingState::~EventSchedulingState
~EventSchedulingState()
Definition: EventSchedulingState.h:17
EventSchedulingState::m_algosInFlight
std::atomic_uint m_algosInFlight
Number of algos in flight.
Definition: EventSchedulingState.h:28
EventSchedulingState::hasStarted
bool hasStarted(unsigned int &index) const
Definition: EventSchedulingState.cpp:17
EventSchedulingState::m_algosStarted
tbb::concurrent_vector< bool > m_algosStarted
Register of algorithms started.
Definition: EventSchedulingState.h:36
EventSchedulingState::state
const state_type & state() const
Definition: EventSchedulingState.h:23
state_type
boost::dynamic_bitset state_type
Definition: EventSchedulingState.h:11
EventSchedulingState::m_algosFinished
std::atomic_uint m_algosFinished
Number of finished algos.
Definition: EventSchedulingState.h:30
EventSchedulingState
Definition: EventSchedulingState.h:14
EventSchedulingState::m_eventState
state_type m_eventState
Event state recording which products are there.
Definition: EventSchedulingState.h:34
EventSchedulingState::algoFinished
void algoFinished()
Definition: EventSchedulingState.cpp:12
EventSchedulingState::hasFinished
bool hasFinished() const
Definition: EventSchedulingState.h:22
EventSchedulingState::EventSchedulingState
EventSchedulingState(const unsigned int &n_algos, const unsigned int &n_products)
Definition: EventSchedulingState.cpp:3