ATLAS Offline Software
Loading...
Searching...
No Matches
EFTrackingXrtAlgorithm Class Reference

Generic Athena algorithm for running xclbin kernels, creating a mapping between store gate keys and kernel interfaces. More...

#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.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::optional< xrt::bo::flags > determine_mem_flags (const std::unique_ptr< xrt::kernel > &kernel, const std::size_t index) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKeyArray< std::vector< unsigned long > > m_inputDataStreamKeys {this, "inputDataStreamKeys", {}}
 Keys to access encoded 64bit words following the EFTracking specification.
SG::ReadHandleKeyArray< std::vector< unsigned long > > m_vSizeDataStreamKeys {this, "vSizeDataStreamKeys", {}}
SG::WriteHandleKeyArray< std::vector< unsigned long > > m_outputDataStreamKeys {this, "outputDataStreamKeys", {}}
ServiceHandle< AthXRT::IDeviceMgmtSvcm_DeviceMgmtSvc
ServiceHandle< IChronoSvc > m_chronoSvc
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_inputInterfaces
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_vSizeInterfaces
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_outputInterfaces
Gaudi::Property< std::vector< std::tuple< std::string, int, std::string, int > > > m_sharedInterfaces
Gaudi::Property< std::vector< std::vector< std::string > > > m_kernelOrder
Gaudi::Property< std::size_t > m_bufferSize
std::map< std::string, std::unique_ptr< xrt::kernel > > m_kernels {}
std::map< std::string, 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 {}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Generic Athena algorithm for running xclbin kernels, creating a mapping between store gate keys and kernel interfaces.

Three interface types are supported, inputs, vSizes and outputs. Inputs and outputs are for memory mapped interfaces. VSizes tell the kernel how long an input is (based on the size() of the associated std::vector (retrieved from store gate).

Definition at line 35 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 9 of file EFTrackingXrtAlgorithm.cxx.

12 : AthReentrantAlgorithm(name, pSvcLocator)
13{}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
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.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ determine_mem_flags()

std::optional< xrt::bo::flags > EFTrackingXrtAlgorithm::determine_mem_flags ( const std::unique_ptr< xrt::kernel > & kernel,
const std::size_t index ) const
private

Definition at line 362 of file EFTrackingXrtAlgorithm.cxx.

365 {
366 for (
367 const xrt::xclbin::kernel& kernelMetaData :
368 kernel->get_xclbin().get_kernels()
369 ) {
370 if (kernel->get_name() != kernelMetaData.get_name()) {
371 continue;
372 }
373
374 for (const xrt::xclbin::arg& arg : kernelMetaData.get_args()) {
375 if (arg.get_index() != index) {
376 continue;
377 }
378
379 if (arg.get_mems().size() == 0) {
381 "No mems associated with argument " <<
382 index <<
383 " of " <<
384 kernel->get_name() <<
385 ". Expect more warnings."
386 );
387
388 return std::nullopt;
389 }
390
391 if (arg.get_mems()[0].get_tag().find("HOST") != std::string::npos) {
392 return xrt::bo::flags::host_only;
393 }
394
395 return xrt::bo::flags::normal;
396 }
397 }
398
399 return std::nullopt;
400}
#define ATH_MSG_WARNING(x)

◆ 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.

◆ evtStore()

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.

◆ execute()

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

Definition at line 255 of file EFTrackingXrtAlgorithm.cxx.

256{
257 ATH_CHECK(m_inputDataStreamKeys.size() == m_inputBuffers.size());
258 std::size_t inputHandleIndex = 0;
259 for (
260 const SG::ReadHandleKey<std::vector<unsigned long>>& inputDataStreamKey :
262 ) {
263 SG::ReadHandle<std::vector<unsigned long>> inputDataStream(inputDataStreamKey, ctx);
264 ATH_MSG_DEBUG("Writing: " << inputDataStream.name());
265 unsigned long* inputMap = m_inputBuffers.at(inputHandleIndex).map<unsigned long*>();
266
267 ATH_CHECK(inputDataStream->size() <= m_bufferSize);
268
269 ATH_MSG_DEBUG("Copy " + inputDataStream.name() + " from storegate to host side map");
270 {
271 Athena::Chrono chrono(
272 "Copy " + inputDataStream.name() + " from storegate to host side map",
273 m_chronoSvc.get()
274 );
275
276 for (std::size_t index = 0; index < inputDataStream->size(); index++) {
277 inputMap[index] = inputDataStream->at(index);
278 }
279 }
280
281 ATH_MSG_DEBUG("Copy " + inputDataStream.name() + " from host side map to device");
282 {
283 Athena::Chrono chrono(
284 "Copy " + inputDataStream.name() + " from host side map to device",
285 m_chronoSvc.get()
286 );
287
288 m_inputBuffers.at(inputHandleIndex).sync(XCL_BO_SYNC_BO_TO_DEVICE);
289 }
290
291 inputHandleIndex++;
292 }
293
295 std::size_t vSizeHandleIndex = 0;
296 for (
297 const SG::ReadHandleKey<std::vector<unsigned long>>& vSizeDataStreamKey :
299 ) {
300 SG::ReadHandle<std::vector<unsigned long>> vSizeDataStream(vSizeDataStreamKey, ctx);
301 const auto& [kernelName, storeGateKey, argumentIndex] = m_vSizeInterfaces[vSizeHandleIndex];
302 ATH_MSG_DEBUG("Setting VSize: " << kernelName << ", " << vSizeDataStream.name() << ", " << vSizeDataStream->size());
303
304 m_runs.at(kernelName)->set_arg(argumentIndex, vSizeDataStream->size());
305 vSizeHandleIndex++;
306 }
307
308 ATH_MSG_DEBUG("Run kernels");
309 {
310 Athena::Chrono chrono("Run kernels", m_chronoSvc.get());
311
312 for (const auto& kernelNames : m_kernelOrder) {
313 for (const auto& kernelName : kernelNames) {
314 ATH_MSG_DEBUG("Running: " << kernelName);
315 m_runs.at(kernelName)->start();
316 }
317
318 for (const auto& kernelName : kernelNames) {
319 ATH_MSG_DEBUG("Waiting: " << kernelName);
320 m_runs.at(kernelName)->wait();
321 }
322 }
323 }
324
325 std::size_t outputHandleIndex = 0;
326 for (
327 const SG::WriteHandleKey<std::vector<unsigned long>>& outputDataStreamKey :
329 ) {
330 SG::WriteHandle<std::vector<unsigned long>> outputDataStream(outputDataStreamKey, ctx);
331 ATH_CHECK(outputDataStream.record(std::make_unique<std::vector<unsigned long>>(m_bufferSize)));
332
333 ATH_MSG_DEBUG("Copy " + outputDataStream.name() + " from device to host side map");
334 {
335 Athena::Chrono chrono(
336 "Copy " + outputDataStream.name() + " from device to host side map",
337 m_chronoSvc.get()
338 );
339
340 m_outputBuffers.at(outputHandleIndex).sync(XCL_BO_SYNC_BO_FROM_DEVICE);
341 }
342
343 const unsigned long* outputMap = m_outputBuffers.at(outputHandleIndex).map<unsigned long*>();
344 ATH_MSG_DEBUG("Copy " + outputDataStream.name() + " from host side map to storegate");
345 {
346 Athena::Chrono chrono(
347 "Copy " + outputDataStream.name() + " from host side map to storegate",
348 m_chronoSvc.get()
349 );
350
351 for (std::size_t index = 0; index < outputDataStream->size(); index++) {
352 outputDataStream->at(index) = outputMap[index];
353 }
354 }
355
356 outputHandleIndex++;
357 }
358
359 return StatusCode::SUCCESS;
360}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_vSizeInterfaces
SG::ReadHandleKeyArray< std::vector< unsigned long > > m_vSizeDataStreamKeys
std::map< std::string, std::unique_ptr< xrt::run > > m_runs
Gaudi::Property< std::vector< std::vector< std::string > > > m_kernelOrder
SG::ReadHandleKeyArray< std::vector< unsigned long > > m_inputDataStreamKeys
Keys to access encoded 64bit words following the EFTracking specification.
SG::WriteHandleKeyArray< std::vector< unsigned long > > m_outputDataStreamKeys
Gaudi::Property< std::size_t > m_bufferSize
ServiceHandle< IChronoSvc > m_chronoSvc
str index
Definition DeMoScan.py:362

◆ 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 ( ) const
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 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ 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 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode EFTrackingXrtAlgorithm::initialize ( )
finaloverride

Definition at line 15 of file EFTrackingXrtAlgorithm.cxx.

15 {
16 ATH_MSG_INFO("Initializing " << name());
17
18 ATH_CHECK(m_DeviceMgmtSvc.retrieve());
19 ATH_CHECK(m_chronoSvc.retrieve());
20 ATH_CHECK(m_inputDataStreamKeys.initialize());
21 ATH_CHECK(m_vSizeDataStreamKeys.initialize());
23
24 for (const auto& [kernelName, storeGateKey, argumentIndex] : m_inputInterfaces) {
26 "Setting up " <<
27 kernelName <<
28 " to read " <<
29 storeGateKey <<
30 " into argument " <<
31 argumentIndex
32 );
33
34 const std::vector<std::shared_ptr<xrt::device>> devices =
35 m_DeviceMgmtSvc->get_xrt_devices_by_kernel_name(kernelName);
36
37 ATH_CHECK(devices.size() != 0);
38
39 if (!m_kernels.contains(kernelName)) {
40 m_kernels[kernelName] = std::make_unique<xrt::kernel>(
41 *(devices[0]),
42 (devices[0])->get_xclbin_uuid(),
43 kernelName,
44 xrt::kernel::cu_access_mode::exclusive
45 );
46 }
47
48 ATH_CHECK(m_kernels[kernelName].get() != nullptr);
49
50 const std::optional<xrt::bo::flags> mem_flags =
51 determine_mem_flags(m_kernels[kernelName], argumentIndex);
52
53 if (!mem_flags.has_value()) {
55 "Unable to determine mem_flags for argument with index " <<
56 argumentIndex <<
57 " in kernel named " <<
58 kernelName <<
59 ". Defaulting to xrt::bo::normal. Good luck!"
60 );
61
62 m_inputBuffers.emplace_back(
63 *(devices[0]),
64 sizeof(unsigned long) * m_bufferSize,
65 xrt::bo::flags::normal,
66 m_kernels[kernelName]->group_id(argumentIndex)
67 );
68 }
69 else {
70 m_inputBuffers.emplace_back(
71 *(devices[0]),
72 sizeof(unsigned long) * m_bufferSize,
73 mem_flags.value(),
74 m_kernels[kernelName]->group_id(argumentIndex)
75 );
76 }
77
78 if (!m_runs.contains(kernelName)) {
79 m_runs[kernelName] = std::make_unique<xrt::run>(*m_kernels[kernelName]);
80 }
81
82 ATH_CHECK(m_runs[kernelName].get() != nullptr);
83 m_runs[kernelName]->set_arg(argumentIndex, m_inputBuffers.back());
84 }
85
86 for (const auto& [kernelName, storeGateKey, argumentIndex] : m_vSizeInterfaces) {
88 "Setting up " <<
89 kernelName <<
90 " to get input size from " <<
91 storeGateKey <<
92 " for argument " <<
93 argumentIndex
94 );
95
96 const std::vector<std::shared_ptr<xrt::device>> devices =
97 m_DeviceMgmtSvc->get_xrt_devices_by_kernel_name(kernelName);
98
99 ATH_CHECK(devices.size() != 0);
100
101 if (!m_kernels.contains(kernelName)) {
102 m_kernels[kernelName] = std::make_unique<xrt::kernel>(
103 *(devices[0]),
104 (devices[0])->get_xclbin_uuid(),
105 kernelName,
106 xrt::kernel::cu_access_mode::exclusive
107 );
108 }
109
110 ATH_CHECK(m_kernels[kernelName].get() != nullptr);
111
112 if (!m_runs.contains(kernelName)) {
113 m_runs[kernelName] = std::make_unique<xrt::run>(*m_kernels[kernelName]);
114 }
115
116 ATH_CHECK(m_runs[kernelName].get() != nullptr);
117 }
118
119 for (const auto& [kernelName, storeGateKey, argumentIndex] : m_outputInterfaces) {
121 "Setting up " <<
122 kernelName <<
123 " to write " <<
124 storeGateKey <<
125 " from argument " <<
126 argumentIndex
127 );
128
129 const std::vector<std::shared_ptr<xrt::device>> devices =
130 m_DeviceMgmtSvc->get_xrt_devices_by_kernel_name(kernelName);
131
132 ATH_CHECK(devices.size() != 0);
133
134 if (!m_kernels.contains(kernelName)) {
135 m_kernels[kernelName] = std::make_unique<xrt::kernel>(
136 *(devices[0]),
137 devices[0]->get_xclbin_uuid(),
138 kernelName,
139 xrt::kernel::cu_access_mode::exclusive
140 );
141 }
142
143 const std::optional<xrt::bo::flags> mem_flags =
144 determine_mem_flags(m_kernels[kernelName], argumentIndex);
145
146 if (!mem_flags.has_value()) {
148 "Unable to determine mem_flags for argument with index " <<
149 argumentIndex <<
150 " in kernel named " <<
151 kernelName <<
152 ". Defaulting to xrt::bo::normal. Good luck!"
153 );
154
155 m_outputBuffers.emplace_back(
156 *(devices[0]),
157 sizeof(unsigned long) * m_bufferSize,
158 xrt::bo::flags::normal,
159 m_kernels[kernelName]->group_id(argumentIndex)
160 );
161 }
162 else {
163 m_outputBuffers.emplace_back(
164 *(devices[0]),
165 sizeof(unsigned long) * m_bufferSize,
166 mem_flags.value(),
167 m_kernels[kernelName]->group_id(argumentIndex)
168 );
169 }
170
171 if (!m_runs.contains(kernelName)) {
172 m_runs[kernelName] = std::make_unique<xrt::run>(*m_kernels[kernelName]);
173 }
174
175 ATH_CHECK(m_runs[kernelName].get() != nullptr);
176 m_runs[kernelName]->set_arg(argumentIndex, m_outputBuffers.back());
177 }
178
179 for (const auto& [kernelName, argumentIndex, sourceKernelName, sourceArgumentIndex] : m_sharedInterfaces) {
181 "Setting up shared buffer between " <<
182 kernelName <<
183 " argument " <<
184 argumentIndex <<
185 " and " <<
186 sourceKernelName <<
187 " argument " <<
188 sourceArgumentIndex
189 );
190
191 const std::vector<std::shared_ptr<xrt::device>> devices =
192 m_DeviceMgmtSvc->get_xrt_devices_by_kernel_name(kernelName);
193
194 ATH_CHECK(devices.size() != 0);
195
196 if (!m_kernels.contains(kernelName)) {
197 m_kernels[kernelName] = std::make_unique<xrt::kernel>(
198 *(devices[0]),
199 devices[0]->get_xclbin_uuid(),
200 kernelName,
201 xrt::kernel::cu_access_mode::exclusive
202 );
203 }
204
205 if (!m_runs.contains(kernelName)) {
206 m_runs[kernelName] = std::make_unique<xrt::run>(*m_kernels[kernelName]);
207 }
208
209 ATH_CHECK(m_runs[kernelName].get() != nullptr);
210
211 std::size_t index = 0;
212 for (const auto& [outputKernelName, outputStoreGateKey, outputArgumentIndex] : m_outputInterfaces) {
213 if (
214 outputKernelName == sourceKernelName &&
215 outputArgumentIndex == sourceArgumentIndex
216 ) {
217 m_runs[kernelName]->set_arg(argumentIndex, m_outputBuffers[index]);
218
219 break;
220 }
221
222 index++;
223 }
224 }
225
226 for (const auto& kernelNames : m_kernelOrder) {
227 for (const auto& kernelName : kernelNames) {
228 const std::vector<std::shared_ptr<xrt::device>> devices =
229 m_DeviceMgmtSvc->get_xrt_devices_by_kernel_name(kernelName);
230
231 ATH_CHECK(devices.size() != 0);
232
233 if (!m_kernels.contains(kernelName)) {
234 ATH_MSG_DEBUG("Creating kernel: " << kernelName);
235
236 m_kernels[kernelName] = std::make_unique<xrt::kernel>(
237 *(devices[0]),
238 devices[0]->get_xclbin_uuid(),
239 kernelName,
240 xrt::kernel::cu_access_mode::exclusive
241 );
242
243 if (!m_runs.contains(kernelName)) {
244 m_runs[kernelName] = std::make_unique<xrt::run>(*m_kernels[kernelName]);
245 }
246
247 ATH_CHECK(m_runs[kernelName].get() != nullptr);
248 }
249 }
250 }
251
252 return StatusCode::SUCCESS;
253}
#define ATH_MSG_INFO(x)
std::optional< xrt::bo::flags > determine_mem_flags(const std::unique_ptr< xrt::kernel > &kernel, const std::size_t index) const
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_inputInterfaces
std::map< std::string, std::unique_ptr< xrt::kernel > > m_kernels
Gaudi::Property< std::vector< std::tuple< std::string, int, std::string, int > > > m_sharedInterfaces
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_outputInterfaces
ServiceHandle< AthXRT::IDeviceMgmtSvc > m_DeviceMgmtSvc
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

◆ 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()

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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();
384 }
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)

◆ 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 {
366 }

◆ setFilterPassed()

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

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ 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 HypoBase, and InputMakerBase.

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()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ 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) {
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 104 of file EFTrackingXrtAlgorithm.h.

104{};

◆ ATLAS_THREAD_SAFE [2/2]

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

Definition at line 105 of file EFTrackingXrtAlgorithm.h.

105{};

◆ 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 93 of file EFTrackingXrtAlgorithm.h.

93 {
94 this,
95 "bufferSize",
96 8192,
97 "Capacity of xrt buffers in terms of 64bit words."
98 };

◆ m_chronoSvc

ServiceHandle<IChronoSvc> EFTrackingXrtAlgorithm::m_chronoSvc
private
Initial value:
{
this,
"ChronoStatSvc",
"ChronoStatSvc",
"Stop watch"
}

Definition at line 51 of file EFTrackingXrtAlgorithm.h.

51 {
52 this,
53 "ChronoStatSvc",
54 "ChronoStatSvc",
55 "Stop watch"
56 };

◆ 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_DeviceMgmtSvc

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

Definition at line 44 of file EFTrackingXrtAlgorithm.h.

44 {
45 this,
46 "DeviceMgmtSvc",
47 "AthXRT::DeviceMgmtSvc",
48 "The XRT device manager service to use"
49 };

◆ 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

SG::ReadHandleKeyArray<std::vector<unsigned long> > EFTrackingXrtAlgorithm::m_inputDataStreamKeys {this, "inputDataStreamKeys", {}}
private

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

Definition at line 40 of file EFTrackingXrtAlgorithm.h.

40{this, "inputDataStreamKeys", {}};

◆ m_inputInterfaces

Gaudi::Property<std::vector<std::tuple<std::string, std::string, int> > > EFTrackingXrtAlgorithm::m_inputInterfaces
private
Initial value:
{
this,
"inputInterfaces",
{},
""
}

Definition at line 58 of file EFTrackingXrtAlgorithm.h.

58 {
59 this,
60 "inputInterfaces",
61 {},
62 ""
63 };

◆ m_kernelOrder

Gaudi::Property<std::vector<std::vector<std::string> > > EFTrackingXrtAlgorithm::m_kernelOrder
private
Initial value:
{
this,
"kernelOrder",
{},
""
}

Definition at line 86 of file EFTrackingXrtAlgorithm.h.

86 {
87 this,
88 "kernelOrder",
89 {},
90 ""
91 };

◆ m_kernels

std::map<std::string, std::unique_ptr<xrt::kernel> > EFTrackingXrtAlgorithm::m_kernels {}
private

Definition at line 100 of file EFTrackingXrtAlgorithm.h.

100{};

◆ m_outputDataStreamKeys

SG::WriteHandleKeyArray<std::vector<unsigned long> > EFTrackingXrtAlgorithm::m_outputDataStreamKeys {this, "outputDataStreamKeys", {}}
private

Definition at line 42 of file EFTrackingXrtAlgorithm.h.

42{this, "outputDataStreamKeys", {}};

◆ m_outputInterfaces

Gaudi::Property<std::vector<std::tuple<std::string, std::string, int> > > EFTrackingXrtAlgorithm::m_outputInterfaces
private
Initial value:
{
this,
"outputInterfaces",
{},
""
}

Definition at line 72 of file EFTrackingXrtAlgorithm.h.

72 {
73 this,
74 "outputInterfaces",
75 {},
76 ""
77 };

◆ m_runs

std::map<std::string, std::unique_ptr<xrt::run> > EFTrackingXrtAlgorithm::m_runs {}
private

Definition at line 101 of file EFTrackingXrtAlgorithm.h.

101{};

◆ m_sharedInterfaces

Gaudi::Property<std::vector<std::tuple<std::string, int, std::string, int> > > EFTrackingXrtAlgorithm::m_sharedInterfaces
private
Initial value:
{
this,
"sharedInterfaces",
{},
""
}

Definition at line 79 of file EFTrackingXrtAlgorithm.h.

79 {
80 this,
81 "sharedInterfaces",
82 {},
83 ""
84 };

◆ 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_vSizeDataStreamKeys

SG::ReadHandleKeyArray<std::vector<unsigned long> > EFTrackingXrtAlgorithm::m_vSizeDataStreamKeys {this, "vSizeDataStreamKeys", {}}
private

Definition at line 41 of file EFTrackingXrtAlgorithm.h.

41{this, "vSizeDataStreamKeys", {}};

◆ m_vSizeInterfaces

Gaudi::Property<std::vector<std::tuple<std::string, std::string, int> > > EFTrackingXrtAlgorithm::m_vSizeInterfaces
private
Initial value:
{
this,
"vSizeInterfaces",
{},
""
}

Definition at line 65 of file EFTrackingXrtAlgorithm.h.

65 {
66 this,
67 "vSizeInterfaces",
68 {},
69 ""
70 };

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