ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
EFTrackingXrtAlgorithm Class Reference

#include <EFTrackingXrtAlgorithm.h>

Inheritance diagram for EFTrackingXrtAlgorithm:
Collaboration diagram for EFTrackingXrtAlgorithm:

Public Member Functions

 EFTrackingXrtAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize () override final
 
StatusCode execute (const EventContext &ctx) const override final
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::vector< SG::ReadHandleKey< std::vector< unsigned long > > > m_inputDataStreamKeys {}
 Keys to access encoded 64bit words following the EFTracking specification. More...
 
std::vector< SG::WriteHandleKey< std::vector< unsigned long > > > m_outputDataStreamKeys {}
 
ServiceHandle< AthXRT::IDeviceMgmtSvcm_DeviceMgmtSvc
 
Gaudi::Property< std::string > m_xclbinPath
 
Gaudi::Property< std::string > m_kernelDefinitionsJsonString
 
Gaudi::Property< std::size_t > m_bufferSize
 
std::shared_ptr< xrt::device > m_device {}
 
std::vector< std::unique_ptr< xrt::kernel > > m_kernels {}
 
std::vector< std::unique_ptr< xrt::run > > m_runs {}
 
std::vector< xrt::bo > m_inputBuffers ATLAS_THREAD_SAFE {}
 
std::vector< xrt::bo > m_outputBuffers ATLAS_THREAD_SAFE {}
 
std::vector< EFTrackingFPGAIntegration::VSizem_vsizes {}
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Generic Athena algorithm for running xclbins (FPGA firmware). The idea is to associate a set store gate handles with memory mapped kernel interfaces (kernels and interfaces defined in the xclbin).

The objects behind these store gate handles are then written directly to the FPGAs global memory. The kernels are then run. Finally outputs from the FPGAs global memory are written back into storegate.

Definition at line 47 of file EFTrackingXrtAlgorithm.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ EFTrackingXrtAlgorithm()

EFTrackingXrtAlgorithm::EFTrackingXrtAlgorithm ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 65 of file EFTrackingXrtAlgorithm.cxx.

68  : AthReentrantAlgorithm(name, pSvcLocator)
69 {}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode EFTrackingXrtAlgorithm::execute ( const EventContext &  ctx) const
finaloverride

Definition at line 179 of file EFTrackingXrtAlgorithm.cxx.

180 {
181  ATH_MSG_DEBUG("Writing Inputs");
182  std::size_t handleIndex = 0;
183  for (
184  const SG::ReadHandleKey<std::vector<unsigned long>>& inputDataStreamKey :
186  ) {
188  unsigned long* inputMap = m_inputBuffers.at(handleIndex).map<unsigned long*>();
189 
190  if (inputDataStream->size() > m_bufferSize) {
191  ATH_MSG_ERROR("Input data stream too large for buffer (buffer: " <<
192  m_bufferSize <<
193  ", data stream: " <<
194  inputDataStream->size() <<
195  "), consider increasing buffer size.");
196 
197  return StatusCode::FAILURE;
198  }
199 
200  for (std::size_t index = 0; index < inputDataStream->size(); index++) {
201  inputMap[index] = inputDataStream->at(index);
202  }
203 
204  m_inputBuffers.at(handleIndex).sync(XCL_BO_SYNC_BO_TO_DEVICE);
205  handleIndex++;
206  }
207 
208  ATH_MSG_DEBUG("Writing VSizes");
209  for (const EFTrackingFPGAIntegration::VSize& vsize : m_vsizes) {
211 
212  m_runs.at(vsize.runIndex)->set_arg(vsize.argumentIndex, inputDataStream->size());
213  }
214 
215  ATH_MSG_DEBUG("Starting Kernels");
216  for (std::size_t index = 0; index < m_runs.size(); index++) {
217  m_runs.at(index)->start();
218  }
219 
220  ATH_MSG_DEBUG("Waiting for Kernels");
221  for (std::size_t index = 0; index < m_runs.size(); index++) {
222  m_runs.at(index)->wait();
223  }
224 
225  ATH_MSG_DEBUG("Reading Outputs");
226  handleIndex = 0;
227  for (
228  const SG::WriteHandleKey<std::vector<unsigned long>>& outputDataStreamKey :
230  ) {
232  ATH_CHECK(outputDataStream.record(std::make_unique<std::vector<unsigned long>>(m_bufferSize)));
233 
234  m_outputBuffers.at(handleIndex).sync(XCL_BO_SYNC_BO_FROM_DEVICE);
235 
236  const unsigned long* outputMap = m_outputBuffers.at(handleIndex).map<unsigned long*>();
237 
238  for (std::size_t index = 0; index < outputDataStream->size(); index++) {
239  outputDataStream->at(index) = outputMap[index];
240  }
241 
242  handleIndex++;
243  }
244 
245  return StatusCode::SUCCESS;
246 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90 {
91  // If we didn't find any symlinks to add, just return the collection
92  // from the base class. Otherwise, return the extended collection.
93  if (!m_extendedExtraObjects.empty()) {
95  }
96  return BaseAlg::extraOutputDeps();
97 }

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96  {
97  return execState( ctx ).filterPassed();
98  }

◆ initialize()

StatusCode EFTrackingXrtAlgorithm::initialize ( )
finaloverride

Definition at line 71 of file EFTrackingXrtAlgorithm.cxx.

71  {
72  ATH_MSG_INFO("Initializing " << name());
73 
74  // Too complicated to implement as a Gaudi::Property (would require a new
75  // grammar) so get a string and make the nlohmann::json in initialize.
76  const std::optional<nlohmann::json> kernelDefinitionsJson {
77  [](const std::string& kernelDefinitionsJsonString)->std::optional<nlohmann::json> {
78  try {
79  const nlohmann::json kernelDefinitionsJson =
81  return kernelDefinitionsJson;
82 
83  }
84  catch (const nlohmann::json::exception& [[maybe_unused]]exception) {
85  return std::nullopt;
86  }
87 
88  // c++23 std::unreachable()
89  return std::nullopt;
91  };
92 
93  if (!kernelDefinitionsJson) {
94  return StatusCode::FAILURE;
95  }
96 
97  ATH_CHECK(m_DeviceMgmtSvc.retrieve());
98 
99  // Todo: Fix this disgusting mess (probably just add a new method to the
100  // AthXrt service to enumerate devices and a method to check if a
101  // device has a particular kernel.
102  m_device = getDevice(*kernelDefinitionsJson, m_DeviceMgmtSvc);
103  if (!m_device) {
104  ATH_MSG_ERROR("No XRT device provides all kernels.");
105 
106  return StatusCode::FAILURE;
107  }
108 
109  for (const auto& [kernelName, kernelDefinition] : kernelDefinitionsJson->items()) {
110  m_kernels.push_back(std::make_unique<xrt::kernel>(*m_device,
111  m_device->get_xclbin_uuid(),
112  kernelName,
113  xrt::kernel::cu_access_mode::exclusive));
114 
115  m_runs.push_back(std::make_unique<xrt::run>(*m_kernels.back()));
116 
117  for (const auto& interfaceDefinition : kernelDefinition) {
118  const std::string& storeGateKey =
119  interfaceDefinition.at("storeGateKey").get<const std::string>();
120 
121  const int argumentIndex =
122  std::stoi(interfaceDefinition.at("argumentIndex").get<const std::string>());
123 
124  const int interfaceMode =
125  std::stoi(interfaceDefinition.at("interfaceMode").get<const std::string>());
126 
127  switch (interfaceMode) {
129  m_inputDataStreamKeys.emplace_back(storeGateKey);
130  ATH_CHECK(m_inputDataStreamKeys.back().initialize());
131 
132  m_inputBuffers.emplace_back(
133  *m_device,
134  sizeof(unsigned long) * m_bufferSize,
135  xrt::bo::flags::normal,
136  m_kernels.back()->group_id(argumentIndex)
137  );
138 
139  m_runs.back()->set_arg(argumentIndex, m_inputBuffers.back());
140 
141  break;
142  }
144  m_outputDataStreamKeys.emplace_back(storeGateKey);
145  ATH_CHECK(m_outputDataStreamKeys.back().initialize());
146 
147  m_outputBuffers.emplace_back(
148  *m_device,
149  sizeof(unsigned long) * m_bufferSize,
150  xrt::bo::flags::normal,
151  m_kernels.back()->group_id(argumentIndex)
152  );
153 
154  m_runs.back()->set_arg(argumentIndex, m_outputBuffers.back());
155 
156  break;
157  }
159  m_vsizes.push_back({.runIndex = static_cast<int>(m_runs.size()) - 1,
160  .argumentIndex = argumentIndex,
161  .storeGateKey = SG::ReadHandleKey<std::vector<long unsigned int>>(storeGateKey)});
162 
163  ATH_CHECK(m_vsizes.back().storeGateKey.initialize());
164 
165  break;
166  }
167  default: {
168  ATH_MSG_ERROR("Failed to map kernel definitions to xrt objects.");
169 
170  return StatusCode::FAILURE;
171  }
172  }
173  }
174  }
175 
176  return StatusCode::SUCCESS;
177 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::isClonable
overridevirtualinherited

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

52 {
53  // Reentrant algorithms are clonable.
54  return true;
55 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100  {
101  execState( ctx ).setFilterPassed( state );
102  }

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77 {
78  return BaseAlg::sysExecute (ctx);
79 }

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107  {
109 
110  if (sc.isFailure()) {
111  return sc;
112  }
113 
114  ServiceHandle<ICondSvc> cs("CondSvc",name());
115  for (auto h : outputHandles()) {
116  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117  // do this inside the loop so we don't create the CondSvc until needed
118  if ( cs.retrieve().isFailure() ) {
119  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120  return StatusCode::SUCCESS;
121  }
122  if (cs->regHandle(this,*h).isFailure()) {
123  sc = StatusCode::FAILURE;
124  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125  << " with CondSvc");
126  }
127  }
128  }
129  return sc;
130 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

std::vector<xrt::bo> m_inputBuffers EFTrackingXrtAlgorithm::ATLAS_THREAD_SAFE {}
mutableprivate

Definition at line 93 of file EFTrackingXrtAlgorithm.h.

◆ ATLAS_THREAD_SAFE [2/2]

std::vector<xrt::bo> m_outputBuffers EFTrackingXrtAlgorithm::ATLAS_THREAD_SAFE {}
mutableprivate

Definition at line 94 of file EFTrackingXrtAlgorithm.h.

◆ m_bufferSize

Gaudi::Property<std::size_t> EFTrackingXrtAlgorithm::m_bufferSize
private
Initial value:
{
this,
"bufferSize",
8192,
"Capacity of xrt buffers in terms of 64bit words."
}

Definition at line 76 of file EFTrackingXrtAlgorithm.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_device

std::shared_ptr<xrt::device> EFTrackingXrtAlgorithm::m_device {}
private

Definition at line 84 of file EFTrackingXrtAlgorithm.h.

◆ m_DeviceMgmtSvc

ServiceHandle<AthXRT::IDeviceMgmtSvc> EFTrackingXrtAlgorithm::m_DeviceMgmtSvc
private
Initial value:
{
this,
"DeviceMgmtSvc",
"AthXRT::DeviceMgmtSvc",
"The XRT device manager service to use"
}

Definition at line 55 of file EFTrackingXrtAlgorithm.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_inputDataStreamKeys

std::vector<SG::ReadHandleKey<std::vector<unsigned long> > > EFTrackingXrtAlgorithm::m_inputDataStreamKeys {}
private

Keys to access encoded 64bit words following the EFTracking specification.

Definition at line 52 of file EFTrackingXrtAlgorithm.h.

◆ m_kernelDefinitionsJsonString

Gaudi::Property<std::string> EFTrackingXrtAlgorithm::m_kernelDefinitionsJsonString
private
Initial value:
{
this,
"kernelDefinitionsJsonString",
"{}",
"String representation of the json kernel definitions."
}

Definition at line 69 of file EFTrackingXrtAlgorithm.h.

◆ m_kernels

std::vector<std::unique_ptr<xrt::kernel> > EFTrackingXrtAlgorithm::m_kernels {}
private

Definition at line 87 of file EFTrackingXrtAlgorithm.h.

◆ m_outputDataStreamKeys

std::vector<SG::WriteHandleKey<std::vector<unsigned long> > > EFTrackingXrtAlgorithm::m_outputDataStreamKeys {}
private

Definition at line 53 of file EFTrackingXrtAlgorithm.h.

◆ m_runs

std::vector<std::unique_ptr<xrt::run> > EFTrackingXrtAlgorithm::m_runs {}
private

Definition at line 90 of file EFTrackingXrtAlgorithm.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vsizes

std::vector<EFTrackingFPGAIntegration::VSize> EFTrackingXrtAlgorithm::m_vsizes {}
private

Definition at line 97 of file EFTrackingXrtAlgorithm.h.

◆ m_xclbinPath

Gaudi::Property<std::string> EFTrackingXrtAlgorithm::m_xclbinPath
private
Initial value:
{
this,
"xclbinPath",
"",
"Path to Xilinx Compute Language Binary (firmware)."
}

Definition at line 62 of file EFTrackingXrtAlgorithm.h.


The documentation for this class was generated from the following files:
EFTrackingXrtAlgorithmConfig.kernelDefinitionsJsonString
kernelDefinitionsJsonString
Definition: EFTrackingXrtAlgorithmConfig.py:85
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
json
nlohmann::json json
Definition: HistogramDef.cxx:9
EFTrackingXrtParameters::VSIZE
@ VSIZE
Definition: EFTrackingXrtParameters.h:12
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
parse
std::map< std::string, std::string > parse(const std::string &list)
Definition: egammaLayerRecalibTool.cxx:1080
AthCommonDataStore::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition: AthCommonDataStore.h:380
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
EFTrackingXrtAlgorithm::m_inputDataStreamKeys
std::vector< SG::ReadHandleKey< std::vector< unsigned long > > > m_inputDataStreamKeys
Keys to access encoded 64bit words following the EFTracking specification.
Definition: EFTrackingXrtAlgorithm.h:52
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
EFTrackingXrtAlgorithm::m_vsizes
std::vector< EFTrackingFPGAIntegration::VSize > m_vsizes
Definition: EFTrackingXrtAlgorithm.h:97
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
EFTrackingXrtAlgorithm::m_runs
std::vector< std::unique_ptr< xrt::run > > m_runs
Definition: EFTrackingXrtAlgorithm.h:90
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
EFTrackingXrtParameters::OUTPUT
@ OUTPUT
Definition: EFTrackingXrtParameters.h:11
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
calibdata.exception
exception
Definition: calibdata.py:496
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
EFTrackingXrtAlgorithm::m_DeviceMgmtSvc
ServiceHandle< AthXRT::IDeviceMgmtSvc > m_DeviceMgmtSvc
Definition: EFTrackingXrtAlgorithm.h:55
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
EFTrackingXrtAlgorithm::m_kernelDefinitionsJsonString
Gaudi::Property< std::string > m_kernelDefinitionsJsonString
Definition: EFTrackingXrtAlgorithm.h:69
EFTrackingXrtAlgorithmConfig.outputDataStream
outputDataStream
Definition: EFTrackingXrtAlgorithmConfig.py:91
internal_poltrig::INPUT
@ INPUT
Definition: PolygonTriangulator.cxx:112
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
EFTrackingXrtAlgorithm::m_device
std::shared_ptr< xrt::device > m_device
Definition: EFTrackingXrtAlgorithm.h:84
DeMoScan.index
string index
Definition: DeMoScan.py:364
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
EFTrackingXrtAlgorithmConfig.inputDataStream
inputDataStream
Definition: EFTrackingXrtAlgorithmConfig.py:79
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
EFTrackingXrtAlgorithm::m_outputDataStreamKeys
std::vector< SG::WriteHandleKey< std::vector< unsigned long > > > m_outputDataStreamKeys
Definition: EFTrackingXrtAlgorithm.h:53
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
EFTrackingXrtAlgorithm::m_bufferSize
Gaudi::Property< std::size_t > m_bufferSize
Definition: EFTrackingXrtAlgorithm.h:76
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
EFTrackingXrtAlgorithm::m_kernels
std::vector< std::unique_ptr< xrt::kernel > > m_kernels
Definition: EFTrackingXrtAlgorithm.h:87
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
EFTrackingFPGAIntegration::VSize
Definition: EFTrackingXrtAlgorithm.h:29
ServiceHandle< ICondSvc >