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

Algorithm to reconstruct CaloCluster objects with GPU acceleration, providing interoperability for calling standard CPU algorithms before and after the GPU processing part. More...

#include <CaloGPUHybridClusterProcessor.h>

Inheritance diagram for CaloGPUHybridClusterProcessor:

Classes

class  simple_GPU_pointer_holder
 A simple RAII wrapper to ensure proper allocation and deallocation of GPU memory in a void * for the temporaries. More...

Public Member Functions

 CaloGPUHybridClusterProcessor (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~CaloGPUHybridClusterProcessor () override=default
virtual StatusCode initialize () override
virtual StatusCode initialize_non_CUDA () override
 Initialization that does not invoke CUDA functions.
virtual StatusCode initialize_CUDA () override
 Initialization that invokes CUDA functions.
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode finalize () override
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
void handle (const Incident &incident) override

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.
void record_times (const size_t event_num, const std::vector< size_t > &times) const
template<class ... Args>
void record_times (const size_t event_num, const size_t &value) const
template<class ... Args>
void record_times (const size_t event_num, const size_t &value, Args &&... args) const
void print_times (const std::string &header, const size_t time_size) const

Protected Attributes

std::shared_mutex m_timeMutex
 Mutex that is locked when recording times.
Gaudi::Property< bool > m_measureTimes
 If true, times are recorded to the file given by m_timeFileName.
Gaudi::Property< std::string > m_timeFileName
 File to which times should be saved.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>
void record_times_helper (const size_t) const
template<class Arg>
void record_times_helper (const size_t index, Arg &&arg) const
template<class ... Args>
void record_times_helper (size_t index, Args &&... args) const

Private Attributes

ToolHandle< ICaloClusterGPUConstantTransformerm_transformConstantData {this, "ConstantDataToGPUTool", "", "Tool for transforming the constant data and sending it to the GPU"}
 The tool that will convert the constant data from the CPU to the GPU.
ToolHandleArray< CaloClusterCollectionProcessorm_preGPUoperations {this, "BeforeGPUTools", {}, "Tools to be applied to the clusters on the CPU before processing them on the GPU"}
 Tools to be applied to the clusters before being sent to the GPU for processing.
ToolHandle< ICaloClusterGPUInputTransformerm_transformForGPU {this, "EventDataToGPUTool", "", "Tool for transforming the event data and sending it to the GPU"}
 The tool that will actually convert the data from the CPU to the GPU.
ToolHandleArray< CaloClusterGPUProcessorm_GPUoperations {this, "GPUTools", {}, "Tools to be applied to the clusters on the GPU"}
 Tools to be applied to the clusters on the GPU.
ToolHandle< ICaloClusterGPUOutputTransformerm_transformBackToCPU {this, "GPUToEventDataTool", {}, "Tool for getting the data from the GPU back to the CPU Athena data structures"}
 The tool that will convert the data from the GPU back to the CPU.
ToolHandleArray< CaloClusterCollectionProcessorm_postGPUoperations {this, "AfterGPUTools", {}, "Tools to be applied to the clusters on the CPU after returning from the GPU"}
 Tools to be applied to the clusters after returning from the GPU.
Gaudi::Property< bool > m_doPlots {this, "DoPlots", false, "Do plots based on the plotter tool optionally provided."}
 If true, calls the plotter specified by m_plotterTool at every tool execution.
ToolHandle< ICaloClusterGPUPlotterm_plotterTool {this, "PlotterTool", "", "An optional plotter, for testing and/or debugging purposes"}
 An optional plotter, for testing and/or debugging purposes.
Gaudi::Property< bool > m_writeTriggerSpecificInfo {this, "WriteTriggerSpecificInfo", false, "Write some trigger-specific decorations and use the trigger auxiliary container."}
 If true, writes some trigger-specific decorations.
SG::WriteDecorHandleKey< xAOD::CaloClusterContainerm_mDecor_ncells {this, "Decor_ncells", "nCells", "Decorator containing the number of cells associated to a cluster"}
 Key to the handle for writing the number of cells as a decoration.
Gaudi::Property< size_t > m_numPreAllocatedGPUData {this, "NumPreAllocatedDataHolders", 0, "Number of event data holders to pre-allocate on GPU memory"}
 Number of events for which to pre-allocate space on GPU memory (should ideally be set to the expected number of threads to be run with).
SG::WriteHandleKey< xAOD::CaloClusterContainerm_clusterOutput {this, "ClustersOutputName", "", "The name of the key in StoreGate for the output CaloClusterContainer"}
 The name of the key in StoreGate for the output CaloClusterContainer.
SG::WriteHandleKey< CaloClusterCellLinkContainerm_clusterCellLinkOutput {this, "ClusterCellLinksOutputName", "", "The name of the key in StoreGate for the output CaloClusterCellLinkContainer"}
 The name of the key in StoreGate for the output CaloClusterCellLinkContainer.
Gaudi::Property< bool > m_deferConstantDataToFirstEvent {this, "DeferConstantDataPreparationToFirstEvent", true, "Convert and send event data on first event instead of during initialize (needed for exporting geometry and noise properly)?"}
 If true, the constant data is only converted and sent to the GPU on the first event, in case not all the necessary information is available during the initialize phase.
Gaudi::Property< bool > m_skipConversions {this, "SkipConversions", false, "If true, skip converting CPU to GPU data (useful if only instanting CPU tools)"}
 If true, both constant and event data conversion is skipped.
CaloRecGPU::Helpers::separate_thread_holder< CaloRecGPU::EventDataHolder > m_eventDataThreadedHolder ATLAS_THREAD_SAFE
 A way to reduce allocations over multiple threads by keeping a cache of previously allocated objects that get assigned to the threads as they need them.
CaloRecGPU::Helpers::separate_thread_holder< simple_GPU_pointer_holder > m_temporariesThreadedHolder ATLAS_THREAD_SAFE
 A way to reduce allocations over multiple threads by keeping a cache of previously allocated objects that get assigned to the threads as they need them.
size_t m_temporariesSize
 The size of the temporary buffer to allocate for the GPU tools that will be called.
CaloRecGPU::ConstantDataHolder m_constantData ATLAS_THREAD_SAFE
 Constant data, common for all events and persisted throughout the run.
std::atomic< bool > m_constantDataSent
 A flag to signal that the constant data has been adequately sent to the GPU.
std::mutex m_mutex
 This mutex is locked when sending the constant data on the first event to ensure thread safety.
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

Algorithm to reconstruct CaloCluster objects with GPU acceleration, providing interoperability for calling standard CPU algorithms before and after the GPU processing part.

Author
Nuno Fernandes nuno..nosp@m.dos..nosp@m.santo.nosp@m.s.fe.nosp@m.rnand.nosp@m.es@c.nosp@m.ern.c.nosp@m.h
Date
27 May 2022

This class is meant as a replacement for CaloClusterMaker in that it creates a CaloClusterCollection and runs several tools over it. The main addition is the fact that, besides CPU-based tools, GPU-accelerated versions of the standard tools can be run, with adequate memory sharing between them to minimize transfers and (re-)conversions from and to the GPU-friendly data representation.

Definition at line 50 of file CaloGPUHybridClusterProcessor.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

◆ CaloGPUHybridClusterProcessor()

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

Definition at line 31 of file CaloGPUHybridClusterProcessor.cxx.

31 :
32 AthReentrantAlgorithm(name, pSvcLocator),
33 CaloGPUTimed(this),
36{
37
38}
std::atomic< bool > m_constantDataSent
A flag to signal that the constant data has been adequately sent to the GPU.
size_t m_temporariesSize
The size of the temporary buffer to allocate for the GPU tools that will be called.
CaloGPUTimed(T *ptr)

◆ ~CaloGPUHybridClusterProcessor()

virtual CaloGPUHybridClusterProcessor::~CaloGPUHybridClusterProcessor ( )
overridevirtualdefault

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>

◆ 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 CaloGPUHybridClusterProcessor::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 164 of file CaloGPUHybridClusterProcessor.cxx.

165{
166 SG::WriteHandle<xAOD::CaloClusterContainer> cluster_collection (m_clusterOutput, ctx);
167
169 {
170 ATH_CHECK( cluster_collection.record (std::make_unique<xAOD::CaloClusterContainer>(), std::make_unique<xAOD::CaloClusterTrigAuxContainer> () ));
171 }
172 else
173 {
175 }
176
177 //ATH_CHECK(CaloClusterStoreHelper::AddContainerWriteHandle(&(*evtStore()), cluster_collection, msg()));
178
179 xAOD::CaloClusterContainer * cluster_collection_ptr = cluster_collection.ptr();
180
182 {
183 std::lock_guard<std::mutex> lock_guard(m_mutex);
184 if (!m_constantDataSent.load())
185 {
186 ConstantDataHolder * cdh_ptr ATLAS_THREAD_SAFE = &m_constantData;
187 ATH_CHECK( m_transformConstantData->convert(ctx, *cdh_ptr, m_doPlots) );
188 m_constantDataSent.store(true);
189 }
190 }
191
192 EventDataHolder * event_data_ptr = nullptr;
193
194 Helpers::separate_thread_accessor<EventDataHolder> sep_th_acc_1(m_eventDataThreadedHolder, event_data_ptr);
195 //This is a RAII wrapper to access an object held by Helpers::separate_thread_holder,
196 //to ensure the event data is appropriately released when we are done processing.
197
198 if (event_data_ptr == nullptr && !m_skipConversions)
199 {
200 ATH_MSG_ERROR("Could not get valid Event Data Holder! Event: " << ctx.evt() );
201 return StatusCode::FAILURE;
202 }
203
205 {
206 event_data_ptr->allocate(true);
207 //No-op if already allocated.
208 }
209
210 simple_GPU_pointer_holder * temporaries_data_ptr_holder = nullptr;
211
212 Helpers::separate_thread_accessor<simple_GPU_pointer_holder> sep_th_acc_2(m_temporariesThreadedHolder, temporaries_data_ptr_holder);
213 if (!temporaries_data_ptr_holder)
214 {
215 ATH_MSG_ERROR("temporaries_data_ptr_holder is null in CaloGPUHybridClusterProcessor::execute" );
216 return StatusCode::FAILURE;
217 }
218 temporaries_data_ptr_holder->allocate(m_temporariesSize);
219 //This will not perform any allocations if they've already been done.
220
221 if ( (temporaries_data_ptr_holder->get_pointer() == nullptr) && !m_skipConversions && m_temporariesSize > 0 )
222 {
223 ATH_MSG_ERROR("Could not get valid temporary buffer holder! Event: " << ctx.evt() );
224 return StatusCode::FAILURE;
225 }
226
227 const ConstantDataHolder & constant_data_holder ATLAS_THREAD_SAFE = m_constantData;
228 //Just to shut up the checker. We know what we are doing...
229
230 using clock_type = boost::chrono::thread_clock;
231 auto time_cast = [](const auto & before, const auto & after)
232 {
233 return boost::chrono::duration_cast<boost::chrono::microseconds>(after - before).count();
234 };
235
236 std::vector<size_t> times;
237
238 size_t plot_time = 0;
239
240 if (m_measureTimes)
241 {
242 const size_t time_size = m_preGPUoperations.size() + m_GPUoperations.size() + m_postGPUoperations.size() + m_doPlots + 2 * !m_skipConversions;
243 //+2 for the conversions
244 //+1 for the plotter (only added at the end)
245 times.reserve(time_size);
246 }
247
248 if (m_doPlots)
249 {
250 auto t1 = clock_type::now();
251 ATH_CHECK( m_plotterTool->update_plots_start(ctx, constant_data_holder, cluster_collection_ptr) );
252 auto t2 = clock_type::now();
253 if (m_measureTimes)
254 {
255 plot_time += time_cast(t1, t2);
256 }
257 }
258
259 for (const auto & pre_GPU_tool : m_preGPUoperations)
260 {
261 auto t1 = clock_type::now();
262 ATH_CHECK( pre_GPU_tool->execute(ctx, cluster_collection_ptr) );
263 auto t2 = clock_type::now();
264 if (m_measureTimes)
265 {
266 times.push_back(time_cast(t1, t2));
267 }
268 if (m_doPlots)
269 {
270 auto t3 = clock_type::now();
271 ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, pre_GPU_tool.get()) );
272 auto t4 = clock_type::now();
273 if (m_measureTimes)
274 {
275 plot_time += time_cast(t3, t4);
276 }
277 }
278 }
279
281 {
282 auto t3 = clock_type::now();
283 ATH_CHECK( m_transformForGPU->convert(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr) );
284 auto t4 = clock_type::now();
285 if (m_measureTimes)
286 {
287 times.push_back(time_cast(t3, t4));
288 }
289 }
290
291 if (m_doPlots)
292 {
293 auto t1 = clock_type::now();
294 ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, m_transformForGPU.get()) );
295 auto t2 = clock_type::now();
296 if (m_measureTimes)
297 {
298 plot_time += time_cast(t1, t2);
299 }
300 }
301
302 for (const auto & GPU_tool : m_GPUoperations)
303 {
304 auto t5 = clock_type::now();
305 ATH_CHECK( GPU_tool->execute(ctx, constant_data_holder, *event_data_ptr, temporaries_data_ptr_holder->get_pointer()) );
306 auto t6 = clock_type::now();
307 if (m_measureTimes)
308 {
309 times.push_back(time_cast(t5, t6));
310 }
311 if (m_doPlots)
312 {
313 auto t3 = clock_type::now();
314 ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, GPU_tool.get()) );
315 auto t4 = clock_type::now();
316 if (m_measureTimes)
317 {
318 plot_time += time_cast(t3, t4);
319 }
320 }
321 }
322
324 {
325 auto t7 = clock_type::now();
326 ATH_CHECK( m_transformBackToCPU->convert(ctx, constant_data_holder, *event_data_ptr, cluster_collection_ptr) );
327 auto t8 = clock_type::now();
328 if (m_measureTimes)
329 {
330 times.push_back(time_cast(t7, t8));
331 }
332 }
333
334 if (m_doPlots)
335 {
336 auto t1 = clock_type::now();
337 ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, m_transformBackToCPU.get()) );
338 auto t2 = clock_type::now();
339 if (m_measureTimes)
340 {
341 plot_time += time_cast(t1, t2);
342 }
343 }
344
345 for (const auto & post_GPU_tool : m_postGPUoperations)
346 {
347 auto t9 = clock_type::now();
348 ATH_CHECK( post_GPU_tool->execute(ctx, cluster_collection_ptr) );
349 auto t10 = clock_type::now();
350 if (m_measureTimes)
351 {
352 times.push_back(time_cast(t9, t10));
353 }
354 if (m_doPlots)
355 {
356 auto t3 = clock_type::now();
357 ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, post_GPU_tool.get()) );
358 auto t4 = clock_type::now();
359 if (m_measureTimes)
360 {
361 plot_time += time_cast(t3, t4);
362 }
363 }
364 }
365
366 if (m_doPlots)
367 {
368 auto t1 = clock_type::now();
369 ATH_CHECK( m_plotterTool->update_plots_end(ctx, constant_data_holder, cluster_collection_ptr) );
370 auto t2 = clock_type::now();
371 if (m_measureTimes)
372 {
373 plot_time += time_cast(t1, t2);
374 }
375 }
376
378 {
379 SG::WriteDecorHandle<xAOD::CaloClusterContainer, int> decor_handle(m_mDecor_ncells, ctx);
380
381 for (const xAOD::CaloCluster * cl : *cluster_collection_ptr)
382 {
383 const CaloClusterCellLink * cell_links = cl->getCellLinks();
384 if (!cell_links)
385 {
386 decor_handle(*cl) = 0;
387 }
388 else
389 {
390 decor_handle(*cl) = cell_links->size();
391 }
392 }
393 }
394
395 ATH_MSG_DEBUG("Created cluster container with " << cluster_collection->size() << " clusters");
396
397 SG::WriteHandle<CaloClusterCellLinkContainer> cell_links(m_clusterCellLinkOutput, ctx);
398
399 ATH_CHECK( CaloClusterStoreHelper::finalizeClusters(cell_links, cluster_collection.ptr()) );
400
401 if (m_measureTimes)
402 {
403 if (m_doPlots)
404 {
405 times.push_back(plot_time);
406 }
407 record_times(ctx.evt(), times);
408 }
409
410 return StatusCode::SUCCESS;
411}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
ToolHandle< ICaloClusterGPUConstantTransformer > m_transformConstantData
The tool that will convert the constant data from the CPU to the GPU.
ToolHandle< ICaloClusterGPUInputTransformer > m_transformForGPU
The tool that will actually convert the data from the CPU to the GPU.
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_clusterOutput
The name of the key in StoreGate for the output CaloClusterContainer.
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_mDecor_ncells
Key to the handle for writing the number of cells as a decoration.
ToolHandle< ICaloClusterGPUPlotter > m_plotterTool
An optional plotter, for testing and/or debugging purposes.
Gaudi::Property< bool > m_skipConversions
If true, both constant and event data conversion is skipped.
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_clusterCellLinkOutput
The name of the key in StoreGate for the output CaloClusterCellLinkContainer.
ToolHandleArray< CaloClusterGPUProcessor > m_GPUoperations
Tools to be applied to the clusters on the GPU.
Gaudi::Property< bool > m_doPlots
If true, calls the plotter specified by m_plotterTool at every tool execution.
std::mutex m_mutex
This mutex is locked when sending the constant data on the first event to ensure thread safety.
Gaudi::Property< bool > m_writeTriggerSpecificInfo
If true, writes some trigger-specific decorations.
ToolHandle< ICaloClusterGPUOutputTransformer > m_transformBackToCPU
The tool that will convert the data from the GPU back to the CPU.
CaloRecGPU::Helpers::separate_thread_holder< CaloRecGPU::EventDataHolder > m_eventDataThreadedHolder ATLAS_THREAD_SAFE
A way to reduce allocations over multiple threads by keeping a cache of previously allocated objects ...
ToolHandleArray< CaloClusterCollectionProcessor > m_preGPUoperations
Tools to be applied to the clusters before being sent to the GPU for processing.
Gaudi::Property< bool > m_deferConstantDataToFirstEvent
If true, the constant data is only converted and sent to the GPU on the first event,...
ToolHandleArray< CaloClusterCollectionProcessor > m_postGPUoperations
Tools to be applied to the clusters after returning from the GPU.
Gaudi::Property< bool > m_measureTimes
If true, times are recorded to the file given by m_timeFileName.
void record_times(const size_t event_num, const std::vector< size_t > &times) const
void allocate(const bool also_GPU=true)
std::vector< ALFA_RawDataContainer_p1 > t2
std::vector< ALFA_RawDataCollection_p1 > t1
std::vector< LUCID_DigitContainer_p2 > t6
std::vector< LUCID_RawDataContainer_p1 > t4
std::vector< LUCID_Digit_p2 > t5
std::vector< LUCID_SimHit_p2 > t7
std::vector< LUCID_SimHit_p3 > t8
std::vector< LUCID_RawData_p1 > t3
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
A simple RAII wrapper to ensure proper allocation and deallocation of GPU memory in a void * for the ...

◆ 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

◆ finalize()

StatusCode CaloGPUHybridClusterProcessor::finalize ( )
overridevirtual

Definition at line 413 of file CaloGPUHybridClusterProcessor.cxx.

414{
415 if (m_measureTimes)
416 {
417 std::string header_string;
418
419 auto add_name_to_string = [&](const auto & obj)
420 {
421 std::string rep = obj->name();
422 std::replace(rep.begin(), rep.end(), ' ', '_');
423 header_string += rep + " ";
424 };
425
426 for (const auto & pre_GPU_tool : m_preGPUoperations)
427 {
428 add_name_to_string(pre_GPU_tool);
429 }
430
432 {
433 add_name_to_string(m_transformForGPU);
434 }
435
436 for (const auto & GPU_tool : m_GPUoperations)
437 {
438 add_name_to_string(GPU_tool);
439 }
440
442 {
443 add_name_to_string(m_transformBackToCPU);
444 }
445
446 for (const auto & post_GPU_tool : m_postGPUoperations)
447 {
448 add_name_to_string(post_GPU_tool);
449 }
450
451 if (m_doPlots)
452 {
453 add_name_to_string(m_plotterTool);
454 }
455
456 print_times(header_string, m_preGPUoperations.size() + m_GPUoperations.size() + m_postGPUoperations.size() + 2 * !m_skipConversions + m_doPlots);
457 }
458
459 if (m_doPlots)
460 {
461 ATH_CHECK(m_plotterTool->finalize_plots());
462 }
463
464 return StatusCode::SUCCESS;
465}
void print_times(const std::string &header, const size_t time_size) const

◆ handle()

void CaloGPUCUDAInitialization::handle ( const Incident & incident)
inlineoverrideinherited

Definition at line 66 of file CaloGPUCUDAInitialization.h.

67 {
68 const bool is_multiprocess = (Gaudi::Concurrency::ConcurrencyFlags::numProcs() > 0);
69 if (is_multiprocess && incident.type() == AthenaInterprocess::UpdateAfterFork::type())
70 {
71 if (!this->initialize_CUDA().isSuccess())
72 {
73 throw GaudiException("Failed to perform the CUDA initialization!",
74 "CaloGPUCUDAInitialization::handle",
75 StatusCode::FAILURE);
76 }
77 }
78 }
static const std::string & type()
Incident type.
Definition Incidents.h:49
virtual StatusCode initialize_CUDA()
Initialization that invokes CUDA functions.

◆ initialize()

virtual StatusCode CaloGPUHybridClusterProcessor::initialize ( )
inlineoverridevirtual

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 57 of file CaloGPUHybridClusterProcessor.h.

◆ initialize_CUDA()

StatusCode CaloGPUHybridClusterProcessor::initialize_CUDA ( )
overridevirtual

Initialization that invokes CUDA functions.

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 126 of file CaloGPUHybridClusterProcessor.cxx.

127{
129 {
130 ATH_CHECK( m_transformConstantData->initialize() );
131 //Not sure if this is needed or the tool will get initialized by this point.
132
133 ATH_CHECK( m_transformConstantData->convert(m_constantData, m_doPlots) );
134 m_constantDataSent = true;
135 }
136
137 if (size_t(m_numPreAllocatedGPUData) > 0)
138 {
139 ATH_MSG_INFO("Pre-allocating event data and temporary buffer for " << size_t(m_numPreAllocatedGPUData) << " parellel events.");
140
141 m_eventDataThreadedHolder.resize(m_numPreAllocatedGPUData);
142 m_temporariesThreadedHolder.resize(m_numPreAllocatedGPUData);
143 //This will allocate the object holders.
144
145 m_eventDataThreadedHolder.operate_on_all( [&](EventDataHolder & edh)
146 {
147 edh.allocate(true);
148 }
149 );
150 m_temporariesThreadedHolder.operate_on_all( [&](simple_GPU_pointer_holder & ph)
151 {
152 ph.allocate(m_temporariesSize);
153 }
154 );
155 //This will allocate all the memory at this point.
156 //Also useful to prevent/debug potential allocation issues?
157 //But the main point is really reducing the execute times...
158 }
159
160 return StatusCode::SUCCESS;
161}
#define ATH_MSG_INFO(x)
Gaudi::Property< size_t > m_numPreAllocatedGPUData
Number of events for which to pre-allocate space on GPU memory (should ideally be set to the expected...

◆ initialize_non_CUDA()

StatusCode CaloGPUHybridClusterProcessor::initialize_non_CUDA ( )
overridevirtual

Initialization that does not invoke CUDA functions.

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 40 of file CaloGPUHybridClusterProcessor.cxx.

41{
42 ATH_CHECK( m_clusterOutput.initialize() );
43
44 if (m_clusterCellLinkOutput.key().empty())
45 {
47 }
48 ATH_CHECK( m_clusterCellLinkOutput.initialize() );
49
50
51 bool any_failed = false;
52
53 auto retrieve_and_report = [&](auto & var, const auto & type, bool & falsify_if_empty)
54 {
55 if (var.empty())
56 {
57 falsify_if_empty = false;
58 ATH_MSG_DEBUG("There is nothing to retrieve for " << type << ".");
59 }
60 else if (var.retrieve().isFailure())
61 {
62 ATH_MSG_ERROR("Failed to retrieve " << type << ": " << var);
63 any_failed = true;
64 }
65 else
66 {
67 ATH_MSG_DEBUG("Successfully retrieved " << type << ": " << var);
68 }
69 };
70 //A generic lambda to prevent code repetition.
71
72
73 bool checker = true;
74
75 retrieve_and_report(m_preGPUoperations, "pre-GPU operations", checker);
76 retrieve_and_report(m_GPUoperations, "GPU operations", checker);
77 retrieve_and_report(m_postGPUoperations, "post-GPU operations", checker);
78
80 {
81 retrieve_and_report(m_transformConstantData, "constant data to GPU transformer", checker);
82 retrieve_and_report(m_transformForGPU, "event data to GPU transformer", checker);
83 retrieve_and_report(m_transformBackToCPU, "GPU to Athena transformer", checker);
84 }
85 else
86 {
88 m_transformForGPU.disable();
89 m_transformBackToCPU.disable();
90 }
91
92 if (m_doPlots)
93 {
94 checker = true;
95 retrieve_and_report(m_plotterTool, "plotter tool", checker);
97 }
98 else
99 {
100 m_plotterTool.disable();
101 }
102
103 if (any_failed)
104 {
105 return StatusCode::FAILURE;
106 }
107
109
110 for (const auto & tool : m_GPUoperations)
111 {
112 m_temporariesSize = std::max(m_temporariesSize, tool->size_of_temporaries());
113 }
114
116 {
117 m_mDecor_ncells = m_clusterOutput.key() + "." + m_mDecor_ncells.key();
118 }
119
121
122 return StatusCode::SUCCESS;
123}

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

◆ print_times()

void CaloGPUTimed::print_times ( const std::string & header,
const size_t time_size ) const
inlineprotectedinherited

Definition at line 143 of file CaloGPUTimed.h.

144 {
145 std::shared_lock<std::shared_mutex> lock(m_timeMutex);
146
147 if (m_timeFileName.size() == 0)
148 {
149 return;
150 }
151
152 std::vector<size_t> indices(m_eventNumbers.size());
153
154 std::iota(indices.begin(), indices.end(), 0);
155 std::sort(indices.begin(), indices.end(), [&](size_t a, size_t b)
156 {
157 return m_eventNumbers[a] < m_eventNumbers[b];
158 }
159 );
160 std::ofstream out(m_timeFileName);
161
162 out << "Event_Number Total " << header << "\n";
163
164 for (const size_t idx : indices)
165 {
166 out << m_eventNumbers[idx] << " ";
167
168 size_t total = 0;
169
170 for (size_t i = 0; i < time_size; ++i)
171 {
172 total += m_times[idx * time_size + i];
173 }
174
175 out << total << " ";
176
177 for (size_t i = 0; i < time_size; ++i)
178 {
179 out << m_times[idx * time_size + i] << " ";
180 }
181 out << "\n";
182 }
183
184 out << std::endl;
185
186 out.close();
187 }
static Double_t a
Gaudi::Property< std::string > m_timeFileName
File to which times should be saved.
std::shared_mutex m_timeMutex
Mutex that is locked when recording times.
std::pair< long int, long int > indices
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ record_times() [1/3]

template<class ... Args>
void CaloGPUTimed::record_times ( const size_t event_num,
const size_t & value ) const
inlineprotectedinherited

Definition at line 105 of file CaloGPUTimed.h.

106 {
107 const size_t time_size = 1;
108
109 size_t old_size;
110
111 {
112 std::unique_lock<std::shared_mutex> lock(m_timeMutex);
113 old_size = m_times.size();
114 m_times.resize(old_size + time_size);
115 m_eventNumbers.push_back(event_num);
116 }
117 {
118 std::shared_lock<std::shared_mutex> lock(m_timeMutex);
119 record_times_helper(old_size, value);
120 }
121 }
void record_times_helper(const size_t) const

◆ record_times() [2/3]

template<class ... Args>
void CaloGPUTimed::record_times ( const size_t event_num,
const size_t & value,
Args &&... args ) const
inlineprotectedinherited

Definition at line 124 of file CaloGPUTimed.h.

125 {
126 const size_t time_size = sizeof...(args) + 1;
127
128 size_t old_size;
129
130 {
131 std::unique_lock<std::shared_mutex> lock(m_timeMutex);
132 old_size = m_times.size();
133 m_times.resize(old_size + time_size);
134 m_eventNumbers.push_back(event_num);
135 }
136 {
137 std::shared_lock<std::shared_mutex> lock(m_timeMutex);
138 record_times_helper(old_size, value, std::forward<Args>(args)...);
139 }
140
141 }

◆ record_times() [3/3]

void CaloGPUTimed::record_times ( const size_t event_num,
const std::vector< size_t > & times ) const
inlineprotectedinherited

Definition at line 86 of file CaloGPUTimed.h.

87 {
88 size_t old_size;
89 {
90 std::unique_lock<std::shared_mutex> lock(m_timeMutex);
91 old_size = m_times.size();
92 m_times.resize(old_size + times.size());
93 m_eventNumbers.push_back(event_num);
94 }
95 {
96 std::shared_lock<std::shared_mutex> lock(m_timeMutex);
97 for (size_t i = 0; i < times.size(); ++i)
98 {
99 m_times[old_size + i] = times[i];
100 }
101 }
102 }

◆ record_times_helper() [1/3]

template<class Arg>
void CaloGPUTimed::record_times_helper ( const size_t index,
Arg && arg ) const
inlineprivateinherited

Definition at line 70 of file CaloGPUTimed.h.

71 {
72 // coverity[missing_lock]
73 m_times[index] = std::forward<Arg>(arg);
74
75 //This is called within a function that holds the lock itself.
76 }
str index
Definition DeMoScan.py:362

◆ record_times_helper() [2/3]

void CaloGPUTimed::record_times_helper ( const size_t ) const
inlineprivateinherited

Definition at line 64 of file CaloGPUTimed.h.

65 {
66 //Do nothing
67 }

◆ record_times_helper() [3/3]

template<class ... Args>
void CaloGPUTimed::record_times_helper ( size_t index,
Args &&... args ) const
inlineprivateinherited

Definition at line 79 of file CaloGPUTimed.h.

80 {
81 (record_times_helper(index++, std::forward<Args>(args)), ...);
82 }

◆ 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_WARNING(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/3]

CaloRecGPU::Helpers::separate_thread_holder<CaloRecGPU::EventDataHolder> m_eventDataThreadedHolder CaloGPUHybridClusterProcessor::ATLAS_THREAD_SAFE
mutableprivate

A way to reduce allocations over multiple threads by keeping a cache of previously allocated objects that get assigned to the threads as they need them.

It's all thread-safe due to an internal mutex ensuring no objects get assigned to different threads.

Definition at line 159 of file CaloGPUHybridClusterProcessor.h.

◆ ATLAS_THREAD_SAFE [2/3]

CaloRecGPU::Helpers::separate_thread_holder<simple_GPU_pointer_holder> m_temporariesThreadedHolder CaloGPUHybridClusterProcessor::ATLAS_THREAD_SAFE
mutableprivate

A way to reduce allocations over multiple threads by keeping a cache of previously allocated objects that get assigned to the threads as they need them.

It's all thread-safe due to an internal mutex ensuring no objects get assigned to different threads.

Definition at line 224 of file CaloGPUHybridClusterProcessor.h.

◆ ATLAS_THREAD_SAFE [3/3]

CaloRecGPU::ConstantDataHolder m_constantData CaloGPUHybridClusterProcessor::ATLAS_THREAD_SAFE
mutableprivate

Constant data, common for all events and persisted throughout the run.

Is mutable to deal with the cases where the data preparation is deferred to the first event.

Definition at line 239 of file CaloGPUHybridClusterProcessor.h.

◆ m_clusterCellLinkOutput

SG::WriteHandleKey<CaloClusterCellLinkContainer> CaloGPUHybridClusterProcessor::m_clusterCellLinkOutput {this, "ClusterCellLinksOutputName", "", "The name of the key in StoreGate for the output CaloClusterCellLinkContainer"}
private

The name of the key in StoreGate for the output CaloClusterCellLinkContainer.

Definition at line 142 of file CaloGPUHybridClusterProcessor.h.

142{this, "ClusterCellLinksOutputName", "", "The name of the key in StoreGate for the output CaloClusterCellLinkContainer"};

◆ m_clusterOutput

SG::WriteHandleKey<xAOD::CaloClusterContainer> CaloGPUHybridClusterProcessor::m_clusterOutput {this, "ClustersOutputName", "", "The name of the key in StoreGate for the output CaloClusterContainer"}
private

The name of the key in StoreGate for the output CaloClusterContainer.

Definition at line 138 of file CaloGPUHybridClusterProcessor.h.

138{this, "ClustersOutputName", "", "The name of the key in StoreGate for the output CaloClusterContainer"};

◆ m_constantDataSent

std::atomic<bool> CaloGPUHybridClusterProcessor::m_constantDataSent
mutableprivate

A flag to signal that the constant data has been adequately sent to the GPU.

This is required for everything to work properly in a multi-threaded context...

Definition at line 245 of file CaloGPUHybridClusterProcessor.h.

◆ m_deferConstantDataToFirstEvent

Gaudi::Property<bool> CaloGPUHybridClusterProcessor::m_deferConstantDataToFirstEvent {this, "DeferConstantDataPreparationToFirstEvent", true, "Convert and send event data on first event instead of during initialize (needed for exporting geometry and noise properly)?"}
private

If true, the constant data is only converted and sent to the GPU on the first event, in case not all the necessary information is available during the initialize phase.

Definition at line 148 of file CaloGPUHybridClusterProcessor.h.

148{this, "DeferConstantDataPreparationToFirstEvent", true, "Convert and send event data on first event instead of during initialize (needed for exporting geometry and noise properly)?"};

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

Gaudi::Property<bool> CaloGPUHybridClusterProcessor::m_doPlots {this, "DoPlots", false, "Do plots based on the plotter tool optionally provided."}
private

If true, calls the plotter specified by m_plotterTool at every tool execution.

It should be the plotter's responsibility to only take data from the tools it wants to.

Definition at line 113 of file CaloGPUHybridClusterProcessor.h.

113{this, "DoPlots", false, "Do plots based on the plotter tool optionally provided."};

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

ToolHandleArray<CaloClusterGPUProcessor> CaloGPUHybridClusterProcessor::m_GPUoperations {this, "GPUTools", {}, "Tools to be applied to the clusters on the GPU"}
private

Tools to be applied to the clusters on the GPU.

Definition at line 95 of file CaloGPUHybridClusterProcessor.h.

95{this, "GPUTools", {}, "Tools to be applied to the clusters on the GPU"};

◆ m_mDecor_ncells

SG::WriteDecorHandleKey<xAOD::CaloClusterContainer> CaloGPUHybridClusterProcessor::m_mDecor_ncells {this, "Decor_ncells", "nCells", "Decorator containing the number of cells associated to a cluster"}
private

Key to the handle for writing the number of cells as a decoration.

Definition at line 127 of file CaloGPUHybridClusterProcessor.h.

127{this, "Decor_ncells", "nCells", "Decorator containing the number of cells associated to a cluster"};

◆ m_measureTimes

Gaudi::Property<bool> CaloGPUTimed::m_measureTimes
protectedinherited

If true, times are recorded to the file given by m_timeFileName.

Defaults to false.

Definition at line 46 of file CaloGPUTimed.h.

◆ m_mutex

std::mutex CaloGPUHybridClusterProcessor::m_mutex
mutableprivate

This mutex is locked when sending the constant data on the first event to ensure thread safety.

Otherwise, it's unused.

Definition at line 251 of file CaloGPUHybridClusterProcessor.h.

◆ m_numPreAllocatedGPUData

Gaudi::Property<size_t> CaloGPUHybridClusterProcessor::m_numPreAllocatedGPUData {this, "NumPreAllocatedDataHolders", 0, "Number of event data holders to pre-allocate on GPU memory"}
private

Number of events for which to pre-allocate space on GPU memory (should ideally be set to the expected number of threads to be run with).

Definition at line 134 of file CaloGPUHybridClusterProcessor.h.

134{this, "NumPreAllocatedDataHolders", 0, "Number of event data holders to pre-allocate on GPU memory"};

◆ m_plotterTool

ToolHandle<ICaloClusterGPUPlotter> CaloGPUHybridClusterProcessor::m_plotterTool {this, "PlotterTool", "", "An optional plotter, for testing and/or debugging purposes"}
private

An optional plotter, for testing and/or debugging purposes.

Definition at line 119 of file CaloGPUHybridClusterProcessor.h.

119{this, "PlotterTool", "", "An optional plotter, for testing and/or debugging purposes"};

◆ m_postGPUoperations

ToolHandleArray<CaloClusterCollectionProcessor> CaloGPUHybridClusterProcessor::m_postGPUoperations {this, "AfterGPUTools", {}, "Tools to be applied to the clusters on the CPU after returning from the GPU"}
private

Tools to be applied to the clusters after returning from the GPU.

Definition at line 107 of file CaloGPUHybridClusterProcessor.h.

107{this, "AfterGPUTools", {}, "Tools to be applied to the clusters on the CPU after returning from the GPU"};

◆ m_preGPUoperations

ToolHandleArray<CaloClusterCollectionProcessor> CaloGPUHybridClusterProcessor::m_preGPUoperations {this, "BeforeGPUTools", {}, "Tools to be applied to the clusters on the CPU before processing them on the GPU"}
private

Tools to be applied to the clusters before being sent to the GPU for processing.

Definition at line 82 of file CaloGPUHybridClusterProcessor.h.

82{this, "BeforeGPUTools", {}, "Tools to be applied to the clusters on the CPU before processing them on the GPU"};

◆ m_skipConversions

Gaudi::Property<bool> CaloGPUHybridClusterProcessor::m_skipConversions {this, "SkipConversions", false, "If true, skip converting CPU to GPU data (useful if only instanting CPU tools)"}
private

If true, both constant and event data conversion is skipped.

Definition at line 153 of file CaloGPUHybridClusterProcessor.h.

153{this, "SkipConversions", false, "If true, skip converting CPU to GPU data (useful if only instanting CPU tools)"};

◆ m_temporariesSize

size_t CaloGPUHybridClusterProcessor::m_temporariesSize
private

The size of the temporary buffer to allocate for the GPU tools that will be called.

Will correspond to the maximum of all the necessary sizes for all the GPU tools.

Warning
Every tool should consider the buffer as filled with uninitialized memory at their start.

Definition at line 232 of file CaloGPUHybridClusterProcessor.h.

◆ m_timeFileName

Gaudi::Property<std::string> CaloGPUTimed::m_timeFileName
protectedinherited

File to which times should be saved.

Definition at line 50 of file CaloGPUTimed.h.

◆ m_timeMutex

std::shared_mutex CaloGPUTimed::m_timeMutex
mutableprotectedinherited

Mutex that is locked when recording times.

Definition at line 32 of file CaloGPUTimed.h.

◆ m_transformBackToCPU

ToolHandle<ICaloClusterGPUOutputTransformer> CaloGPUHybridClusterProcessor::m_transformBackToCPU {this, "GPUToEventDataTool", {}, "Tool for getting the data from the GPU back to the CPU Athena data structures"}
private

The tool that will convert the data from the GPU back to the CPU.

Definition at line 101 of file CaloGPUHybridClusterProcessor.h.

101{this, "GPUToEventDataTool", {}, "Tool for getting the data from the GPU back to the CPU Athena data structures"};

◆ m_transformConstantData

ToolHandle<ICaloClusterGPUConstantTransformer> CaloGPUHybridClusterProcessor::m_transformConstantData {this, "ConstantDataToGPUTool", "", "Tool for transforming the constant data and sending it to the GPU"}
private

The tool that will convert the constant data from the CPU to the GPU.

Definition at line 76 of file CaloGPUHybridClusterProcessor.h.

76{this, "ConstantDataToGPUTool", "", "Tool for transforming the constant data and sending it to the GPU"};

◆ m_transformForGPU

ToolHandle<ICaloClusterGPUInputTransformer> CaloGPUHybridClusterProcessor::m_transformForGPU {this, "EventDataToGPUTool", "", "Tool for transforming the event data and sending it to the GPU"}
private

The tool that will actually convert the data from the CPU to the GPU.

Definition at line 89 of file CaloGPUHybridClusterProcessor.h.

89{this, "EventDataToGPUTool", "", "Tool for transforming the event data and sending it to the GPU"};

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

Gaudi::Property<bool> CaloGPUHybridClusterProcessor::m_writeTriggerSpecificInfo {this, "WriteTriggerSpecificInfo", false, "Write some trigger-specific decorations and use the trigger auxiliary container."}
private

If true, writes some trigger-specific decorations.

Definition at line 123 of file CaloGPUHybridClusterProcessor.h.

123{this, "WriteTriggerSpecificInfo", false, "Write some trigger-specific decorations and use the trigger auxiliary container."};

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