 |
ATLAS Offline Software
|
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>
|
| 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. More...
|
|
virtual StatusCode | initialize_CUDA () override |
| Initialization that invokes CUDA functions. More...
|
|
virtual StatusCode | execute (const EventContext &ctx) const override |
|
virtual StatusCode | finalize () override |
|
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, V, H > &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 |
|
void | handle (const Incident &incident) override |
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
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 |
|
|
ToolHandle< ICaloClusterGPUConstantTransformer > | m_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. More...
|
|
ToolHandleArray< CaloClusterCollectionProcessor > | m_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. More...
|
|
ToolHandle< ICaloClusterGPUInputTransformer > | m_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. More...
|
|
ToolHandleArray< CaloClusterGPUProcessor > | m_GPUoperations {this, "GPUTools", {}, "Tools to be applied to the clusters on the GPU"} |
| Tools to be applied to the clusters on the GPU. More...
|
|
ToolHandle< ICaloClusterGPUOutputTransformer > | m_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. More...
|
|
ToolHandleArray< CaloClusterCollectionProcessor > | m_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. More...
|
|
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. More...
|
|
ToolHandle< ICaloClusterGPUPlotter > | m_plotterTool {this, "PlotterTool", "", "An optional plotter, for testing and/or debugging purposes"} |
| An optional plotter, for testing and/or debugging purposes. More...
|
|
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. More...
|
|
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > | m_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. More...
|
|
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). More...
|
|
SG::WriteHandleKey< xAOD::CaloClusterContainer > | m_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. More...
|
|
SG::WriteHandleKey< CaloClusterCellLinkContainer > | m_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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
size_t | m_temporariesSize |
| The size of the temporary buffer to allocate for the GPU tools that will be called. More...
|
|
CaloRecGPU::ConstantDataHolder m_constantData | ATLAS_THREAD_SAFE |
| Constant data, common for all events and persisted throughout the run. More...
|
|
std::atomic< bool > | m_constantDataSent |
| A flag to signal that the constant data has been adequately sent to the GPU. More...
|
|
std::mutex | m_mutex |
| This mutex is locked when sending the constant data on the first event to ensure thread safety. More...
|
|
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 |
|
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.
◆ StoreGateSvc_t
◆ CaloGPUHybridClusterProcessor()
CaloGPUHybridClusterProcessor::CaloGPUHybridClusterProcessor |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~CaloGPUHybridClusterProcessor()
virtual CaloGPUHybridClusterProcessor::~CaloGPUHybridClusterProcessor |
( |
| ) |
|
|
overridevirtualdefault |
◆ cardinality()
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.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode CaloGPUHybridClusterProcessor::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Definition at line 164 of file CaloGPUHybridClusterProcessor.cxx.
170 ATH_CHECK( cluster_collection.record (std::make_unique<xAOD::CaloClusterContainer>(), std::make_unique<xAOD::CaloClusterTrigAuxContainer> () ));
183 std::lock_guard<std::mutex> lock_guard(
m_mutex);
200 ATH_MSG_ERROR(
"Could not get valid Event Data Holder! Event: " << ctx.evt() );
201 return StatusCode::FAILURE;
210 simple_GPU_pointer_holder * temporaries_data_ptr_holder =
nullptr;
213 if (!temporaries_data_ptr_holder)
215 ATH_MSG_ERROR(
"temporaries_data_ptr_holder is null in CaloGPUHybridClusterProcessor::execute" );
216 return StatusCode::FAILURE;
223 ATH_MSG_ERROR(
"Could not get valid temporary buffer holder! Event: " << ctx.evt() );
224 return StatusCode::FAILURE;
230 using clock_type = boost::chrono::thread_clock;
231 auto time_cast = [](
const auto & before,
const auto & after)
233 return boost::chrono::duration_cast<boost::chrono::microseconds>(after - before).count();
236 std::vector<size_t>
times;
238 size_t plot_time = 0;
245 times.reserve(time_size);
255 plot_time += time_cast(
t1,
t2);
262 ATH_CHECK( pre_GPU_tool->execute(ctx, cluster_collection_ptr) );
271 ATH_CHECK(
m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, pre_GPU_tool.get()) );
275 plot_time += time_cast(
t3,
t4);
298 plot_time += time_cast(
t1,
t2);
305 ATH_CHECK( GPU_tool->execute(ctx, constant_data_holder, *event_data_ptr, temporaries_data_ptr_holder->get_pointer()) );
314 ATH_CHECK(
m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, GPU_tool.get()) );
318 plot_time += time_cast(
t3,
t4);
341 plot_time += time_cast(
t1,
t2);
348 ATH_CHECK( post_GPU_tool->execute(ctx, cluster_collection_ptr) );
352 times.push_back(time_cast(t9, t10));
357 ATH_CHECK(
m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, post_GPU_tool.get()) );
361 plot_time += time_cast(
t3,
t4);
373 plot_time += time_cast(
t1,
t2);
386 decor_handle(*
cl) = 0;
390 decor_handle(*
cl) = cell_links->
size();
395 ATH_MSG_DEBUG(
"Created cluster container with " << cluster_collection->size() <<
" clusters");
405 times.push_back(plot_time);
410 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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()
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.
◆ filterPassed()
◆ finalize()
StatusCode CaloGPUHybridClusterProcessor::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 413 of file CaloGPUHybridClusterProcessor.cxx.
417 std::string header_string;
419 auto add_name_to_string = [&](
const auto &
obj)
421 std::string
rep =
obj->name();
423 header_string +=
rep +
" ";
428 add_name_to_string(pre_GPU_tool);
438 add_name_to_string(GPU_tool);
448 add_name_to_string(post_GPU_tool);
464 return StatusCode::SUCCESS;
◆ handle()
void CaloGPUCUDAInitialization::handle |
( |
const Incident & |
incident | ) |
|
|
inlineoverrideinherited |
Definition at line 66 of file CaloGPUCUDAInitialization.h.
68 const bool is_multiprocess = (Gaudi::Concurrency::ConcurrencyFlags::numProcs() > 0);
73 throw GaudiException(
"Failed to perform the CUDA initialization!",
74 "CaloGPUCUDAInitialization::handle",
◆ initialize()
virtual StatusCode CaloGPUHybridClusterProcessor::initialize |
( |
| ) |
|
|
inlineoverridevirtual |
◆ initialize_CUDA()
StatusCode CaloGPUHybridClusterProcessor::initialize_CUDA |
( |
| ) |
|
|
overridevirtual |
◆ 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.
51 bool any_failed =
false;
53 auto retrieve_and_report = [&](
auto &
var,
const auto &
type,
bool & falsify_if_empty)
57 falsify_if_empty =
false;
60 else if (
var.retrieve().isFailure())
105 return StatusCode::FAILURE;
122 return StatusCode::SUCCESS;
◆ inputHandles()
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() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
152 std::vector<size_t>
indices(m_eventNumbers.size());
157 return m_eventNumbers[a] < m_eventNumbers[b];
162 out <<
"Event_Number Total " <<
header <<
"\n";
166 out << m_eventNumbers[
idx] <<
" ";
170 for (
size_t i = 0;
i < time_size; ++
i)
172 total += m_times[
idx * time_size +
i];
177 for (
size_t i = 0;
i < time_size; ++
i)
179 out << m_times[
idx * time_size +
i] <<
" ";
◆ 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.
107 const size_t time_size = 1;
113 old_size = m_times.size();
114 m_times.resize(old_size + time_size);
115 m_eventNumbers.push_back(event_num);
◆ 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.
126 const size_t time_size =
sizeof...(args) + 1;
132 old_size = m_times.size();
133 m_times.resize(old_size + time_size);
134 m_eventNumbers.push_back(event_num);
◆ 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.
91 old_size = m_times.size();
92 m_times.resize(old_size +
times.size());
93 m_eventNumbers.push_back(event_num);
97 for (
size_t i = 0;
i <
times.size(); ++
i)
99 m_times[old_size +
i] =
times[
i];
◆ record_times_helper() [1/3]
template<class Arg >
void CaloGPUTimed::record_times_helper |
( |
const size_t |
index, |
|
|
Arg && |
arg |
|
) |
| const |
|
inlineprivateinherited |
◆ record_times_helper() [2/3]
void CaloGPUTimed::record_times_helper |
( |
const |
size_t | ) |
const |
|
inlineprivateinherited |
◆ record_times_helper() [3/3]
template<class ... Args>
void CaloGPUTimed::record_times_helper |
( |
size_t |
index, |
|
|
Args &&... |
args |
|
) |
| const |
|
inlineprivateinherited |
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
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.
◆ sysInitialize()
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.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ ATLAS_THREAD_SAFE [1/3]
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]
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]
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
◆ m_clusterOutput
◆ 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.
◆ m_detStore
◆ 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.
◆ m_evtStore
◆ m_extendedExtraObjects
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 |
◆ m_mDecor_ncells
◆ 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.
◆ m_plotterTool
ToolHandle<ICaloClusterGPUPlotter> CaloGPUHybridClusterProcessor::m_plotterTool {this, "PlotterTool", "", "An optional plotter, for testing and/or debugging purposes"} |
|
private |
◆ 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 |
◆ 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 |
◆ 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 |
◆ 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
◆ m_transformConstantData
◆ m_transformForGPU
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_writeTriggerSpecificInfo
Gaudi::Property<bool> CaloGPUHybridClusterProcessor::m_writeTriggerSpecificInfo {this, "WriteTriggerSpecificInfo", false, "Write some trigger-specific decorations and use the trigger auxiliary container."} |
|
private |
The documentation for this class was generated from the following files:
std::vector< LUCID_DigitContainer_p2 > t6
std::string replace(std::string s, const std::string &s2, const std::string &s3)
ToolHandle< ICaloClusterGPUOutputTransformer > m_transformBackToCPU
The tool that will convert the data from the GPU back to the CPU.
Gaudi::Property< bool > m_skipConversions
If true, both constant and event data conversion is skipped.
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
std::shared_mutex m_timeMutex
Mutex that is locked when recording times.
std::vector< LUCID_SimHit_p3 > t8
std::vector< LUCID_RawData_p1 > t3
std::pair< long int, long int > indices
size_t m_temporariesSize
The size of the temporary buffer to allocate for the GPU tools that will be called.
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)
std::vector< ALFA_RawDataCollection_p1 > t1
Gaudi::Property< bool > m_writeTriggerSpecificInfo
If true, writes some trigger-specific decorations.
ToolHandle< ICaloClusterGPUPlotter > m_plotterTool
An optional plotter, for testing and/or debugging purposes.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Gaudi::Property< std::string > m_timeFileName
File to which times should be saved.
std::vector< SG::VarHandleKeyArray * > m_vhka
std::vector< LUCID_SimHit_p2 > t7
const std::string & key() const
Return the StoreGate ID for the referenced object.
ToolHandleArray< CaloClusterGPUProcessor > m_GPUoperations
Tools to be applied to the clusters on the GPU.
virtual void setOwner(IDataHandleHolder *o)=0
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Property< bool > m_doPlots
If true, calls the plotter specified by m_plotterTool at every tool execution.
virtual StatusCode initialize()
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Description of a calorimeter cluster.
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 ...
std::mutex m_mutex
This mutex is locked when sending the constant data on the first event to ensure thread safety.
void allocate(const bool also_GPU=true)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Handle class for adding a decoration to an object.
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
void print_times(const std::string &header, const size_t time_size) const
Gaudi::Property< bool > m_deferConstantDataToFirstEvent
If true, the constant data is only converted and sent to the GPU on the first event,...
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
std::atomic< bool > m_constantDataSent
A flag to signal that the constant data has been adequately sent to the GPU.
std::vector< LUCID_RawDataContainer_p1 > t4
virtual void renounce()=0
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_clusterCellLinkOutput
The name of the key in StoreGate for the output CaloClusterCellLinkContainer.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
size_t size() const
size method
static const std::string & type()
Incident type.
ToolHandleArray< CaloClusterCollectionProcessor > m_postGPUoperations
Tools to be applied to the clusters after returning from the GPU.
void record_times_helper(const size_t) const
virtual StatusCode initialize_CUDA()
Initialization that invokes CUDA functions.
std::vector< LUCID_Digit_p2 > t5
std::vector< ALFA_RawDataContainer_p1 > t2
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_mDecor_ncells
Key to the handle for writing the number of cells as a decoration.
void record_times(const size_t event_num, const std::vector< size_t > ×) const
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_measureTimes
If true, times are recorded to the file given by m_timeFileName.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
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...
ToolHandleArray< CaloClusterCollectionProcessor > m_preGPUoperations
Tools to be applied to the clusters before being sent to the GPU for processing.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_clusterOutput
The name of the key in StoreGate for the output CaloClusterContainer.
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.