| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | List of all members
concurrency::DecisionUpdater Class Reference

`#include <src/PRGraph/Visitors/Promoters.h>`

Inheritance diagram for concurrency::DecisionUpdater:
[legend]
Collaboration diagram for concurrency::DecisionUpdater:
[legend]

## Public Member Functions
| DecisionUpdater (EventSlot &slot, const Cause &cause, bool ifTrace=false)
| Constructor. More...
bool | visit (AlgorithmNode &) override
virtual bool | visit (DecisionNode &)
virtual bool | visit (AlgorithmNode &)
virtual bool | visit (DataNode &)
virtual bool | visit (ConditionNode &)
Public Member Functions inherited from concurrency::IGraphVisitor
virtual | ~IGraphVisitor ()=default
virtual bool | visitEnter (DecisionNode &) const
virtual bool | visit (DecisionNode &)
virtual bool | visitEnter (AlgorithmNode &) const
virtual bool | visitEnter (DataNode &) const
virtual bool | visit (DataNode &)
virtual bool | visitEnter (ConditionNode &) const
virtual bool | visit (ConditionNode &)
virtual void | reset ()

## Public Attributes
EventSlot * | m_slot
Cause | m_cause
bool | m_trace

## Detailed Description

Definition at line 38 of file Promoters.h.

## Constructor & Destructor Documentation

## ◆ DecisionUpdater()

concurrency::DecisionUpdater::DecisionUpdater | ( | EventSlot & | slot,
|  | const Cause & | cause,
|  | bool | ifTrace = `false`
| ) |  |
| inline

Constructor.

Definition at line 41 of file Promoters.h.

42 : m_slot( &slot ), m_cause( cause ), m_trace( ifTrace ){};
concurrency::DecisionUpdater::m_slot
EventSlot * m_slot
Definition: Promoters.h:48
concurrency::DecisionUpdater::m_trace
bool m_trace
Definition: Promoters.h:50
concurrency::DecisionUpdater::m_cause
Cause m_cause
Definition: Promoters.h:49

## Member Function Documentation

## ◆ visit() [1/5]

virtual bool concurrency::IGraphVisitor::visit
| inline

Definition at line 16 of file IGraphVisitor.h.

16 { return true; };

## ◆ visit() [2/5]

virtual bool concurrency::IGraphVisitor::visit
| inline

Definition at line 25 of file IGraphVisitor.h.

25 { return true; };

## ◆ visit() [3/5]

virtual bool concurrency::IGraphVisitor::visit
| inline

Definition at line 22 of file IGraphVisitor.h.

22 { return true; };

## ◆ visit() [4/5]

virtual bool concurrency::IGraphVisitor::visit
| inline

Definition at line 19 of file IGraphVisitor.h.

19 { return true; };

## ◆ visit() [5/5]

bool concurrency::DecisionUpdater::visit | ( | AlgorithmNode & | node | ) |
| override virtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 104 of file Promoters.cpp.

104 {
105
106 auto& states = m_slot->algsStates;
107 const AState& state = states[node.getAlgoIndex()];
108 int decision = -1;
109
110 if ( true == node.isOptimist() )
111 decision = 1;
112 else if ( AState::EVTACCEPTED == state )
113 decision = !node.isLiar();
114 else if ( AState::EVTREJECTED == state )
115 decision = node.isLiar();
116
117 if ( -1 != decision ) {
118
119 m_slot->controlFlowState[node.getNodeIndex()] = decision;
120
121 auto promoter = DataReadyPromoter( *m_slot, m_cause, m_trace );
122 for ( const auto& output : node.getOutputDataNodes() )
123 for ( auto& consumer : output->getConsumers() ) consumer->accept( promoter );
124
125 // propagate decision upward to active regions of the graph
126 auto vis = concurrency::Supervisor( *m_slot, m_cause, m_trace );
127 auto& parents = node.getParentDecisionHubs();
128 if ( parents.size() == 1 ) {
129 parents[0]->accept( vis );
130 } else if ( m_slot->parentSlot ) {
131 auto scout = SubSlotScout( m_slot, node );
132 for ( auto& p : parents ) {
133 p->accept( scout );
134 if ( scout.reply() ) p->accept( vis );
135 scout.reset();
136 }
137 } else {
138 auto scout = ActiveLineageScout( m_slot, node );
139 for ( auto& p : parents ) {
140 p->accept( scout );
141 if ( scout.reply() ) p->accept( vis );
142 scout.reset();
143 }
144 }
145
146 return true; // return true only if the algorithm produced a decision
147 }
148
149 return false;
150 }
concurrency::AState
AlgsExecutionStates::State AState
Definition: Promoters.cpp:11
gaudirun.output
output
Definition: gaudirun.py:484
concurrency::DecisionUpdater::m_slot
EventSlot * m_slot
Definition: Promoters.h:48
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:77
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
concurrency::DecisionUpdater::m_trace
bool m_trace
Definition: Promoters.h:50
concurrency::DecisionUpdater::m_cause
Cause m_cause
Definition: Promoters.h:49
EventSlot::parentSlot
EventSlot * parentSlot
Pointer to parent slot (null for top level)
Definition: EventSlot.h:86
concurrency::Supervisor
Definition: Promoters.h:54
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:75

## Member Data Documentation

## ◆ m_cause

Cause concurrency::DecisionUpdater::m_cause

Definition at line 49 of file Promoters.h.

## ◆ m_slot

EventSlot* concurrency::DecisionUpdater::m_slot

Definition at line 48 of file Promoters.h.

## ◆ m_trace

bool concurrency::DecisionUpdater::m_trace

Definition at line 50 of file Promoters.h.

The documentation for this class was generated from the following files:

- GaudiHive/src/PRGraph/Visitors/Promoters.h
- GaudiHive/src/PRGraph/Visitors/Promoters.cpp