ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
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:
Collaboration 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. 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 > &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
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 
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. More...
 
Gaudi::Property< bool > m_measureTimes
 If true, times are recorded to the file given by m_timeFileName. More...
 
Gaudi::Property< std::string > m_timeFileName
 File to which times should be saved. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. 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< ICaloClusterGPUPlotterm_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_doMonitoring {this, "DoMonitoring", false, "Do monitoring."}
 If true, uses the monitoring tool specified by m_monitorTool. More...
 
Gaudi::Property< bool > m_monitorCells {this, "MonitorCells", false, "Whether to monitor cells too."}
 
Gaudi::Property< float > m_monitoring1thr { this, "Thr1", 2, "First Threshold to pass for cell monitoring" }
 
Gaudi::Property< float > m_monitoring2thr { this, "Thr2", 4, "Second Threshold to pass for cell monitoring" }
 
SG::ReadCondHandleKey< CaloNoisem_noiseCDOKey {this, "CaloNoiseKey", "totalNoise", "SG Key of CaloNoise data object"}
 
ToolHandle< GenericMonitoringToolm_moniTool { this, "MonitoringTool", "", "Monitoring tool" }
 Monitoring tool. More...
 
SG::ReadDecorHandleKey< xAOD::EventInfom_avgMuKey { this, "averageInteractionsPerCrossingKey", "EventInfo.averageInteractionsPerCrossing", "Decoration for Average Interaction Per Crossing" }
 Event input: To get <mu> from Event Info. 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::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. 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::ReadHandleKey< CaloCellContainerm_cellsKey {this, "CellsName", "", "Name(s) of Cell Containers"}
 vector of names of the cell containers to use as input. More...
 
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. More...
 
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. 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
 

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 51 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),
35  m_constantDataSent(false)
36 {
37 
38 }

◆ ~CaloGPUHybridClusterProcessor()

virtual CaloGPUHybridClusterProcessor::~CaloGPUHybridClusterProcessor ( )
overridevirtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::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.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode CaloGPUHybridClusterProcessor::execute ( const EventContext &  ctx) const
overridevirtual

Definition at line 179 of file CaloGPUHybridClusterProcessor.cxx.

180 {
181  auto time_tot = Monitored::Timer("TIME_execute");
182  auto time_clusMaker = Monitored::Timer("TIME_ClustMaker");
183  auto time_clusCorr = Monitored::Timer("TIME_ClustCorr");
184  //No good way to not declare this here at the outer scope
185  //since we do need the timers to be available when we do our operations.
186  //Also: contrary to what the CPU does, we don't have a clear distinction
187  //between what is cluster making and cluster corrections;
188  //for now, ClustMaker = Pre-GPU + (CPU -> GPU) + GPU Tools + (GPU -> CPU)
189  //and ClustCorr = Post-GPU...
190 
191  if (m_doMonitoring)
192  {
193  time_tot.start();
194  }
195 
196 
198 
200  {
201  ATH_CHECK( cluster_collection.record (std::make_unique<xAOD::CaloClusterContainer>(), std::make_unique<xAOD::CaloClusterTrigAuxContainer> () ));
202  }
203  else
204  {
206  }
207 
208  //ATH_CHECK(CaloClusterStoreHelper::AddContainerWriteHandle(&(*evtStore()), cluster_collection, msg()));
209 
210  xAOD::CaloClusterContainer * cluster_collection_ptr = cluster_collection.ptr();
211 
213  {
214  std::lock_guard<std::mutex> lock_guard(m_mutex);
215  if (!m_constantDataSent.load())
216  {
217  ConstantDataHolder * cdh_ptr ATLAS_THREAD_SAFE = &m_constantData;
218  ATH_CHECK( m_transformConstantData->convert(ctx, *cdh_ptr, m_doPlots) );
219  m_constantDataSent.store(true);
220  }
221  }
222 
223  EventDataHolder * event_data_ptr = nullptr;
224 
225  Helpers::separate_thread_accessor<EventDataHolder> sep_th_acc_1(m_eventDataThreadedHolder, event_data_ptr);
226  //This is a RAII wrapper to access an object held by Helpers::separate_thread_holder,
227  //to ensure the event data is appropriately released when we are done processing.
228 
229  if (event_data_ptr == nullptr && !m_skipConversions)
230  {
231  ATH_MSG_ERROR("Could not get valid Event Data Holder! Event: " << ctx.evt() );
232  return StatusCode::FAILURE;
233  }
234 
235  if (!m_skipConversions)
236  {
237  event_data_ptr->allocate(true);
238  //No-op if already allocated.
239  }
240 
241  simple_GPU_pointer_holder * temporaries_data_ptr_holder = nullptr;
242 
243  Helpers::separate_thread_accessor<simple_GPU_pointer_holder> sep_th_acc_2(m_temporariesThreadedHolder, temporaries_data_ptr_holder);
244  if (!temporaries_data_ptr_holder)
245  {
246  ATH_MSG_ERROR("temporaries_data_ptr_holder is null in CaloGPUHybridClusterProcessor::execute" );
247  return StatusCode::FAILURE;
248  }
249  temporaries_data_ptr_holder->allocate(m_temporariesSize);
250  //This will not perform any allocations if they've already been done.
251 
252  if ( (temporaries_data_ptr_holder->get_pointer() == nullptr) && !m_skipConversions && m_temporariesSize > 0 )
253  {
254  ATH_MSG_ERROR("Could not get valid temporary buffer holder! Event: " << ctx.evt() );
255  return StatusCode::FAILURE;
256  }
257 
258  const ConstantDataHolder & constant_data_holder ATLAS_THREAD_SAFE = m_constantData;
259  //Just to shut up the checker. We know what we are doing...
260 
261  using clock_type = boost::chrono::thread_clock;
262  auto time_cast = [](const auto & before, const auto & after)
263  {
264  return boost::chrono::duration_cast<boost::chrono::microseconds>(after - before).count();
265  };
266 
267  std::vector<size_t> times;
268 
269  size_t plot_time = 0;
270 
271  if (m_measureTimes)
272  {
273  const size_t time_size = m_preGPUoperations.size() + m_GPUoperations.size() + m_postGPUoperations.size() + m_doPlots + 2 * !m_skipConversions;
274  //+2 for the conversions
275  //+1 for the plotter (only added at the end)
276  times.reserve(time_size);
277  }
278 
279  if (m_doPlots)
280  {
281  auto t1 = clock_type::now();
282  ATH_CHECK( m_plotterTool->update_plots_start(ctx, constant_data_holder, cluster_collection_ptr) );
283  auto t2 = clock_type::now();
284  if (m_measureTimes)
285  {
286  plot_time += time_cast(t1, t2);
287  }
288  }
289 
290  if (m_doMonitoring)
291  {
292  time_clusMaker.start();
293  }
294 
295  for (const auto & pre_GPU_tool : m_preGPUoperations)
296  {
297  auto t1 = clock_type::now();
298  ATH_CHECK( pre_GPU_tool->execute(ctx, cluster_collection_ptr) );
299  auto t2 = clock_type::now();
300  if (m_measureTimes)
301  {
302  times.push_back(time_cast(t1, t2));
303  }
304  if (m_doPlots)
305  {
306  auto t3 = clock_type::now();
307  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, pre_GPU_tool.get()) );
308  auto t4 = clock_type::now();
309  if (m_measureTimes)
310  {
311  plot_time += time_cast(t3, t4);
312  }
313  }
314  }
315 
316  if (!m_skipConversions)
317  {
318  auto t3 = clock_type::now();
319  ATH_CHECK( m_transformForGPU->convert(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr) );
320  auto t4 = clock_type::now();
321  if (m_measureTimes)
322  {
323  times.push_back(time_cast(t3, t4));
324  }
325  }
326 
327  if (m_doPlots)
328  {
329  auto t1 = clock_type::now();
330  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, m_transformForGPU.get()) );
331  auto t2 = clock_type::now();
332  if (m_measureTimes)
333  {
334  plot_time += time_cast(t1, t2);
335  }
336  }
337 
338  for (const auto & GPU_tool : m_GPUoperations)
339  {
340  auto t5 = clock_type::now();
341  ATH_CHECK( GPU_tool->execute(ctx, constant_data_holder, *event_data_ptr, temporaries_data_ptr_holder->get_pointer()) );
342  auto t6 = clock_type::now();
343  if (m_measureTimes)
344  {
345  times.push_back(time_cast(t5, t6));
346  }
347  if (m_doPlots)
348  {
349  auto t3 = clock_type::now();
350  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, GPU_tool.get()) );
351  auto t4 = clock_type::now();
352  if (m_measureTimes)
353  {
354  plot_time += time_cast(t3, t4);
355  }
356  }
357  }
358 
359  if (!m_skipConversions)
360  {
361  auto t7 = clock_type::now();
362  ATH_CHECK( m_transformBackToCPU->convert(ctx, constant_data_holder, *event_data_ptr, cluster_collection_ptr) );
363  auto t8 = clock_type::now();
364  if (m_measureTimes)
365  {
366  times.push_back(time_cast(t7, t8));
367  }
368  }
369 
370  if (m_doPlots)
371  {
372  auto t1 = clock_type::now();
373  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, *event_data_ptr, m_transformBackToCPU.get()) );
374  auto t2 = clock_type::now();
375  if (m_measureTimes)
376  {
377  plot_time += time_cast(t1, t2);
378  }
379  }
380 
381  if (m_doMonitoring)
382  {
383  time_clusMaker.stop();
384  time_clusCorr.start();
385  }
386 
387  for (const auto & post_GPU_tool : m_postGPUoperations)
388  {
389  auto t9 = clock_type::now();
390  ATH_CHECK( post_GPU_tool->execute(ctx, cluster_collection_ptr) );
391  auto t10 = clock_type::now();
392  if (m_measureTimes)
393  {
394  times.push_back(time_cast(t9, t10));
395  }
396  if (m_doPlots)
397  {
398  auto t3 = clock_type::now();
399  ATH_CHECK( m_plotterTool->update_plots(ctx, constant_data_holder, cluster_collection_ptr, post_GPU_tool.get()) );
400  auto t4 = clock_type::now();
401  if (m_measureTimes)
402  {
403  plot_time += time_cast(t3, t4);
404  }
405  }
406  }
407 
408  if (m_doPlots)
409  {
410  auto t1 = clock_type::now();
411  ATH_CHECK( m_plotterTool->update_plots_end(ctx, constant_data_holder, cluster_collection_ptr) );
412  auto t2 = clock_type::now();
413  if (m_measureTimes)
414  {
415  plot_time += time_cast(t1, t2);
416  }
417  }
418 
420  {
422 
423  for (const xAOD::CaloCluster * cl : *cluster_collection_ptr)
424  {
425  const CaloClusterCellLink * cell_links = cl->getCellLinks();
426  if (!cell_links)
427  {
428  decor_handle(*cl) = 0;
429  }
430  else
431  {
432  decor_handle(*cl) = cell_links->size();
433  }
434  }
435  }
436 
437  ATH_MSG_DEBUG("Created cluster container with " << cluster_collection->size() << " clusters");
438 
440 
441  ATH_CHECK( CaloClusterStoreHelper::finalizeClusters(cell_links, cluster_collection.ptr()) );
442 
443  if (m_measureTimes)
444  {
445  if (m_doPlots)
446  {
447  times.push_back(plot_time);
448  }
449  record_times(ctx.evt(), times);
450  }
451 
452  if (m_doMonitoring)
453  //For monitoring.
454  {
455  time_clusCorr.stop();
456 
457  auto mon_clusEt = Monitored::Collection("Et", *cluster_collection_ptr, &xAOD::CaloCluster::et);
458  auto mon_clusSignalState = Monitored::Collection("signalState", *cluster_collection_ptr, &xAOD::CaloCluster::signalState);
459  auto mon_clusSize = Monitored::Collection("clusterSize", *cluster_collection_ptr, &xAOD::CaloCluster::clusterSize);
460  std::vector<double> clus_phi;
461  std::vector<double> clus_eta;
462  std::vector<double> N_BAD_CELLS;
463  std::vector<double> ENG_FRAC_MAX;
464  std::vector<unsigned int> sizeVec;
465  auto mon_clusPhi = Monitored::Collection("Phi", clus_phi);
466  auto mon_clusEta = Monitored::Collection("Eta", clus_eta);
467  auto mon_badCells = Monitored::Collection("N_BAD_CELLS", N_BAD_CELLS);
468  auto mon_engFrac = Monitored::Collection("ENG_FRAC_MAX", N_BAD_CELLS);
469  auto mon_size = Monitored::Collection("size", sizeVec);
470  auto monmu = Monitored::Scalar("mu", -999.0);
471  auto mon_container_size = Monitored::Scalar("container_size", 0.);
472  auto moncount_1thrsigma = Monitored::Scalar("count_1thrsigma", -999.0);
473  auto moncount_2thrsigma = Monitored::Scalar("count_2thrsigma", -999.0);
474  auto mon_container_size_by_mu = Monitored::Scalar("container_size_by_mu", 0.);
475  auto moncount_1thrsigma_by_mu2 = Monitored::Scalar("count_1thrsigma_by_mu2", -999.0);
476  auto moncount_2thrsigma_by_mu2 = Monitored::Scalar("count_2thrsigma_by_mu2", -999.0);
477  auto monitorIt = Monitored::Group( m_moniTool, time_tot, time_clusMaker, time_clusCorr, mon_container_size,
478  mon_clusEt, mon_clusPhi, mon_clusEta, mon_clusSignalState, mon_clusSize,
479  mon_badCells, mon_engFrac, mon_size, monmu, moncount_1thrsigma, moncount_2thrsigma,
480  mon_container_size_by_mu, moncount_1thrsigma_by_mu2, moncount_2thrsigma_by_mu2 );
481  // fill monitored variables
482 
483  mon_container_size = cluster_collection_ptr->size();
484 
485  for (const xAOD::CaloCluster * cl : *cluster_collection_ptr)
486  {
487  const CaloClusterCellLink * num_cell_links = cl->getCellLinks();
488  if (! num_cell_links)
489  {
490  sizeVec.push_back(0);
491  }
492  else
493  {
494  sizeVec.push_back(num_cell_links->size());
495  }
496  clus_phi.push_back(cl->phi());
497  clus_eta.push_back(cl->eta());
498  N_BAD_CELLS.push_back(cl->getMomentValue(xAOD::CaloCluster::N_BAD_CELLS));
499  ENG_FRAC_MAX.push_back(cl->getMomentValue(xAOD::CaloCluster::ENG_FRAC_MAX));
500  }
501 
502  float read_mu = 0;
503 
505  if (eventInfoDecor.isPresent())
506  {
507  read_mu = eventInfoDecor(0);
508  monmu = read_mu;
509  }
510 
511 
512  int count_1thrsigma = 0, count_2thrsigma = 0;
513 
514  if (m_monitorCells)
515  {
516  SG::ReadHandle<CaloCellContainer> cell_collection(m_cellsKey, ctx);
517  if ( !cell_collection.isValid() )
518  {
519  ATH_MSG_ERROR( " Cannot retrieve CaloCellContainer: " << cell_collection.name() );
520  return StatusCode::FAILURE;
521  }
522 
524  const CaloNoise * noisep = *noiseHdl;
525  for (const auto & cell : *cell_collection)
526  {
527  const CaloDetDescrElement * cdde = cell->caloDDE();
528  if (cdde->is_tile())
529  {
530  continue;
531  }
532  float thr = noisep->getNoise(cdde->identifyHash(), cell->gain());
533  if (cell->energy() > m_monitoring1thr * thr)
534  {
535  count_1thrsigma += 1;
536  if (cell->energy() > m_monitoring2thr * thr)
537  {
538  count_2thrsigma += 1;
539  }
540  }
541  }
542  }
543 
544  moncount_1thrsigma = count_1thrsigma;
545  moncount_2thrsigma = count_2thrsigma;
546 
547  if (read_mu > 5)
548  {
549  const float rev_mu = 1.f / read_mu;
550  mon_container_size_by_mu = rev_mu * cluster_collection_ptr->size();
551  const float sqr_rev_mu = rev_mu * rev_mu;
552  moncount_1thrsigma_by_mu2 = sqr_rev_mu * count_1thrsigma;
553  moncount_2thrsigma_by_mu2 = sqr_rev_mu * count_2thrsigma;
554  }
555 
556  time_tot.stop();
557  }
558 
559  return StatusCode::SUCCESS;
560 }

◆ 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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ finalize()

StatusCode CaloGPUHybridClusterProcessor::finalize ( )
overridevirtual

Definition at line 562 of file CaloGPUHybridClusterProcessor.cxx.

563 {
564  if (m_measureTimes)
565  {
566  std::string header_string;
567 
568  auto add_name_to_string = [&](const auto & obj)
569  {
570  std::string rep = obj->name();
571  std::replace(rep.begin(), rep.end(), ' ', '_');
572  header_string += rep + " ";
573  };
574 
575  for (const auto & pre_GPU_tool : m_preGPUoperations)
576  {
577  add_name_to_string(pre_GPU_tool);
578  }
579 
580  if (!m_skipConversions)
581  {
582  add_name_to_string(m_transformForGPU);
583  }
584 
585  for (const auto & GPU_tool : m_GPUoperations)
586  {
587  add_name_to_string(GPU_tool);
588  }
589 
590  if (!m_skipConversions)
591  {
592  add_name_to_string(m_transformBackToCPU);
593  }
594 
595  for (const auto & post_GPU_tool : m_postGPUoperations)
596  {
597  add_name_to_string(post_GPU_tool);
598  }
599 
600  if (m_doPlots)
601  {
602  add_name_to_string(m_plotterTool);
603  }
604 
605  print_times(header_string, m_preGPUoperations.size() + m_GPUoperations.size() + m_postGPUoperations.size() + 2 * !m_skipConversions + m_doPlots);
606  }
607 
608  if (m_doPlots)
609  {
610  ATH_CHECK(m_plotterTool->finalize_plots());
611  }
612 
613  return StatusCode::SUCCESS;
614 }

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

◆ initialize()

virtual StatusCode CaloGPUHybridClusterProcessor::initialize ( )
inlineoverridevirtual

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 58 of file CaloGPUHybridClusterProcessor.h.

59  {
61  }

◆ initialize_CUDA()

StatusCode CaloGPUHybridClusterProcessor::initialize_CUDA ( )
overridevirtual

Initialization that invokes CUDA functions.

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 141 of file CaloGPUHybridClusterProcessor.cxx.

142 {
144  {
145  ATH_CHECK( m_transformConstantData->initialize() );
146  //Not sure if this is needed or the tool will get initialized by this point.
147 
148  ATH_CHECK( m_transformConstantData->convert(m_constantData, m_doPlots) );
149  m_constantDataSent = true;
150  }
151 
152  if (size_t(m_numPreAllocatedGPUData) > 0)
153  {
154  ATH_MSG_INFO("Pre-allocating event data and temporary buffer for " << size_t(m_numPreAllocatedGPUData) << " parellel events.");
155 
156  m_eventDataThreadedHolder.resize(m_numPreAllocatedGPUData);
157  m_temporariesThreadedHolder.resize(m_numPreAllocatedGPUData);
158  //This will allocate the object holders.
159 
160  m_eventDataThreadedHolder.operate_on_all( [&](EventDataHolder & edh)
161  {
162  edh.allocate(true);
163  }
164  );
165  m_temporariesThreadedHolder.operate_on_all( [&](simple_GPU_pointer_holder & ph)
166  {
167  ph.allocate(m_temporariesSize);
168  }
169  );
170  //This will allocate all the memory at this point.
171  //Also useful to prevent/debug potential allocation issues?
172  //But the main point is really reducing the execute times...
173  }
174 
175  return StatusCode::SUCCESS;
176 }

◆ 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 {
43 
44  if (m_clusterCellLinkOutput.key().empty())
45  {
47  }
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 
79  if (!m_skipConversions)
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  {
87  m_transformConstantData.disable();
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 (m_doMonitoring)
104  {
105  checker = true;
106  retrieve_and_report(m_moniTool, "monitoring tool", checker);
108  }
109  else
110  {
111  m_moniTool.disable();
112  }
113 
114  if (any_failed)
115  {
116  return StatusCode::FAILURE;
117  }
118 
119  ATH_CHECK(m_avgMuKey.initialize(m_doMonitoring));
122 
123  m_temporariesSize = 0;
124 
125  for (const auto & tool : m_GPUoperations)
126  {
127  m_temporariesSize = std::max(m_temporariesSize, tool->size_of_temporaries());
128  }
129 
131  {
133  }
134 
136 
137  return StatusCode::SUCCESS;
138 }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

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

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

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

◆ 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();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::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 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/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 184 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 249 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 264 of file CaloGPUHybridClusterProcessor.h.

◆ m_avgMuKey

SG::ReadDecorHandleKey<xAOD::EventInfo> CaloGPUHybridClusterProcessor::m_avgMuKey { this, "averageInteractionsPerCrossingKey", "EventInfo.averageInteractionsPerCrossing", "Decoration for Average Interaction Per Crossing" }
private

Event input: To get <mu> from Event Info.

Definition at line 139 of file CaloGPUHybridClusterProcessor.h.

◆ m_cellsKey

SG::ReadHandleKey<CaloCellContainer> CaloGPUHybridClusterProcessor::m_cellsKey {this, "CellsName", "", "Name(s) of Cell Containers"}
private

vector of names of the cell containers to use as input.

Definition at line 159 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 167 of file CaloGPUHybridClusterProcessor.h.

◆ 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 163 of file CaloGPUHybridClusterProcessor.h.

◆ 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 270 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 173 of file CaloGPUHybridClusterProcessor.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doMonitoring

Gaudi::Property<bool> CaloGPUHybridClusterProcessor::m_doMonitoring {this, "DoMonitoring", false, "Do monitoring."}
private

If true, uses the monitoring tool specified by m_monitorTool.

Definition at line 125 of file CaloGPUHybridClusterProcessor.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 114 of file CaloGPUHybridClusterProcessor.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.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 96 of file CaloGPUHybridClusterProcessor.h.

◆ 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 147 of file CaloGPUHybridClusterProcessor.h.

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

ToolHandle<GenericMonitoringTool> CaloGPUHybridClusterProcessor::m_moniTool { this, "MonitoringTool", "", "Monitoring tool" }
private

Monitoring tool.

Definition at line 136 of file CaloGPUHybridClusterProcessor.h.

◆ m_monitorCells

Gaudi::Property<bool> CaloGPUHybridClusterProcessor::m_monitorCells {this, "MonitorCells", false, "Whether to monitor cells too."}
private

Definition at line 126 of file CaloGPUHybridClusterProcessor.h.

◆ m_monitoring1thr

Gaudi::Property<float> CaloGPUHybridClusterProcessor::m_monitoring1thr { this, "Thr1", 2, "First Threshold to pass for cell monitoring" }
private

Definition at line 127 of file CaloGPUHybridClusterProcessor.h.

◆ m_monitoring2thr

Gaudi::Property<float> CaloGPUHybridClusterProcessor::m_monitoring2thr { this, "Thr2", 4, "Second Threshold to pass for cell monitoring" }
private

Definition at line 128 of file CaloGPUHybridClusterProcessor.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 276 of file CaloGPUHybridClusterProcessor.h.

◆ m_noiseCDOKey

SG::ReadCondHandleKey<CaloNoise> CaloGPUHybridClusterProcessor::m_noiseCDOKey {this, "CaloNoiseKey", "totalNoise", "SG Key of CaloNoise data object"}
private

Definition at line 132 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 154 of file CaloGPUHybridClusterProcessor.h.

◆ 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 120 of file CaloGPUHybridClusterProcessor.h.

◆ 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 108 of file CaloGPUHybridClusterProcessor.h.

◆ 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 83 of file CaloGPUHybridClusterProcessor.h.

◆ 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 178 of file CaloGPUHybridClusterProcessor.h.

◆ 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 257 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 102 of file CaloGPUHybridClusterProcessor.h.

◆ 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 77 of file CaloGPUHybridClusterProcessor.h.

◆ 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 90 of file CaloGPUHybridClusterProcessor.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_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 143 of file CaloGPUHybridClusterProcessor.h.


The documentation for this class was generated from the following files:
LUCID_EventTPCnv_Dict::t6
std::vector< LUCID_DigitContainer_p2 > t6
Definition: LUCID_EventTPCnvDict.h:32
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
CaloGPUHybridClusterProcessor::m_transformBackToCPU
ToolHandle< ICaloClusterGPUOutputTransformer > m_transformBackToCPU
The tool that will convert the data from the GPU back to the CPU.
Definition: CaloGPUHybridClusterProcessor.h:102
CaloGPUHybridClusterProcessor::m_skipConversions
Gaudi::Property< bool > m_skipConversions
If true, both constant and event data conversion is skipped.
Definition: CaloGPUHybridClusterProcessor.h:178
CaloClusterStoreHelper::finalizeClusters
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
Definition: CaloClusterStoreHelper.cxx:64
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
header
Definition: hcg.cxx:526
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
max
#define max(a, b)
Definition: cfImp.cxx:41
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloClusterStoreHelper::AddContainerWriteHandle
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
Definition: CaloClusterStoreHelper.cxx:53
CaloGPUTimed::m_timeMutex
std::shared_mutex m_timeMutex
Mutex that is locked when recording times.
Definition: CaloGPUTimed.h:32
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
LUCID_EventTPCnv_Dict::t8
std::vector< LUCID_SimHit_p3 > t8
Definition: LUCID_EventTPCnvDict.h:35
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LUCID_EventTPCnv_Dict::t3
std::vector< LUCID_RawData_p1 > t3
Definition: LUCID_EventTPCnvDict.h:28
make_hlt_rep.rep
rep
Definition: make_hlt_rep.py:32
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
CaloGPUHybridClusterProcessor::m_temporariesSize
size_t m_temporariesSize
The size of the temporary buffer to allocate for the GPU tools that will be called.
Definition: CaloGPUHybridClusterProcessor.h:257
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloGPUHybridClusterProcessor::m_doMonitoring
Gaudi::Property< bool > m_doMonitoring
If true, uses the monitoring tool specified by m_monitorTool.
Definition: CaloGPUHybridClusterProcessor.h:125
AthCommonDataStore::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition: AthCommonDataStore.h:380
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
CaloGPUHybridClusterProcessor::m_avgMuKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_avgMuKey
Event input: To get <mu> from Event Info.
Definition: CaloGPUHybridClusterProcessor.h:139
CaloGPUHybridClusterProcessor::m_writeTriggerSpecificInfo
Gaudi::Property< bool > m_writeTriggerSpecificInfo
If true, writes some trigger-specific decorations.
Definition: CaloGPUHybridClusterProcessor.h:143
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
CaloGPUHybridClusterProcessor::m_plotterTool
ToolHandle< ICaloClusterGPUPlotter > m_plotterTool
An optional plotter, for testing and/or debugging purposes.
Definition: CaloGPUHybridClusterProcessor.h:120
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
CaloGPUTimed::m_timeFileName
Gaudi::Property< std::string > m_timeFileName
File to which times should be saved.
Definition: CaloGPUTimed.h:50
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
LUCID_EventTPCnv_Dict::t7
std::vector< LUCID_SimHit_p2 > t7
Definition: LUCID_EventTPCnvDict.h:34
xAOD::CaloCluster_v1::et
double et() const
Definition: CaloCluster_v1.h:856
athena.value
value
Definition: athena.py:124
xAOD::CaloCluster_v1::signalState
State signalState() const
Get the current signal state.
Definition: CaloCluster_v1.h:633
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
xAOD::CaloCluster_v1::ENG_FRAC_MAX
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
Definition: CaloCluster_v1.h:140
CaloGPUHybridClusterProcessor::m_GPUoperations
ToolHandleArray< CaloClusterGPUProcessor > m_GPUoperations
Tools to be applied to the clusters on the GPU.
Definition: CaloGPUHybridClusterProcessor.h:96
CaloNoise::getNoise
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition: CaloNoise.h:34
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CaloGPUHybridClusterProcessor::m_monitoring1thr
Gaudi::Property< float > m_monitoring1thr
Definition: CaloGPUHybridClusterProcessor.h:127
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
CaloGPUHybridClusterProcessor::m_doPlots
Gaudi::Property< bool > m_doPlots
If true, calls the plotter specified by m_plotterTool at every tool execution.
Definition: CaloGPUHybridClusterProcessor.h:114
CaloGPUCUDAInitialization::initialize
virtual StatusCode initialize()
Definition: CaloGPUCUDAInitialization.h:44
CaloGPUHybridClusterProcessor::m_monitoring2thr
Gaudi::Property< float > m_monitoring2thr
Definition: CaloGPUHybridClusterProcessor.h:128
xAOD::CaloCluster_v1::clusterSize
ClusterSize clusterSize() const
Get cluster size.
Definition: CaloCluster_v1.cxx:364
CaloGPUHybridClusterProcessor::m_noiseCDOKey
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
Definition: CaloGPUHybridClusterProcessor.h:132
CaloGPUHybridClusterProcessor::m_moniTool
ToolHandle< GenericMonitoringTool > m_moniTool
Monitoring tool.
Definition: CaloGPUHybridClusterProcessor.h:136
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloGPUHybridClusterProcessor::ATLAS_THREAD_SAFE
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 ...
Definition: CaloGPUHybridClusterProcessor.h:184
python.handimod.now
now
Definition: handimod.py:675
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CaloRecGPU::EventDataHolder
Definition: DataHolders.h:35
CaloGPUHybridClusterProcessor::m_mutex
std::mutex m_mutex
This mutex is locked when sending the constant data on the first event to ensure thread safety.
Definition: CaloGPUHybridClusterProcessor.h:276
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
CaloRecGPU::EventDataHolder::allocate
void allocate(const bool also_GPU=true)
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
CaloGPUTimed::print_times
void print_times(const std::string &header, const size_t time_size) const
Definition: CaloGPUTimed.h:143
CaloGPUHybridClusterProcessor::m_deferConstantDataToFirstEvent
Gaudi::Property< bool > m_deferConstantDataToFirstEvent
If true, the constant data is only converted and sent to the GPU on the first event,...
Definition: CaloGPUHybridClusterProcessor.h:173
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloGPUHybridClusterProcessor::m_monitorCells
Gaudi::Property< bool > m_monitorCells
Definition: CaloGPUHybridClusterProcessor.h:126
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
CaloGPUHybridClusterProcessor::m_constantDataSent
std::atomic< bool > m_constantDataSent
A flag to signal that the constant data has been adequately sent to the GPU.
Definition: CaloGPUHybridClusterProcessor.h:270
LUCID_EventTPCnv_Dict::t4
std::vector< LUCID_RawDataContainer_p1 > t4
Definition: LUCID_EventTPCnvDict.h:29
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
CaloGPUHybridClusterProcessor::m_clusterCellLinkOutput
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_clusterCellLinkOutput
The name of the key in StoreGate for the output CaloClusterCellLinkContainer.
Definition: CaloGPUHybridClusterProcessor.h:167
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
CaloDetDescrElement::is_tile
bool is_tile() const
cell belongs to Tile
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:442
CaloNoise
Definition: CaloNoise.h:16
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CaloGPUHybridClusterProcessor::m_cellsKey
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
vector of names of the cell containers to use as input.
Definition: CaloGPUHybridClusterProcessor.h:159
CaloDetDescrElement::identifyHash
IdentifierHash identifyHash() const override final
cell subcalo hash same as subcalo_hash(), but kept for backward compatibility
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:424
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
CaloGPUTimed::CaloGPUTimed
CaloGPUTimed(T *ptr)
Definition: CaloGPUTimed.h:55
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
AthenaInterprocess::UpdateAfterFork::type
static const std::string & type()
Incident type.
Definition: Incidents.h:49
CaloGPUHybridClusterProcessor::m_postGPUoperations
ToolHandleArray< CaloClusterCollectionProcessor > m_postGPUoperations
Tools to be applied to the clusters after returning from the GPU.
Definition: CaloGPUHybridClusterProcessor.h:108
CaloGPUTimed::record_times_helper
void record_times_helper(const size_t) const
Definition: CaloGPUTimed.h:64
CaloGPUCUDAInitialization::initialize_CUDA
virtual StatusCode initialize_CUDA()
Initialization that invokes CUDA functions.
Definition: CaloGPUCUDAInitialization.h:39
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
LUCID_EventTPCnv_Dict::t5
std::vector< LUCID_Digit_p2 > t5
Definition: LUCID_EventTPCnvDict.h:31
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
DeMoScan.index
string index
Definition: DeMoScan.py:364
CaloGPUHybridClusterProcessor::m_mDecor_ncells
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_mDecor_ncells
Key to the handle for writing the number of cells as a decoration.
Definition: CaloGPUHybridClusterProcessor.h:147
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloGPUTimed::record_times
void record_times(const size_t event_num, const std::vector< size_t > &times) const
Definition: CaloGPUTimed.h:86
std::sort
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.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloGPUTimed::m_measureTimes
Gaudi::Property< bool > m_measureTimes
If true, times are recorded to the file given by m_timeFileName.
Definition: CaloGPUTimed.h:46
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
CaloRecGPU::ConstantDataHolder
Definition: DataHolders.h:19
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
CaloGPUHybridClusterProcessor::m_numPreAllocatedGPUData
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...
Definition: CaloGPUHybridClusterProcessor.h:154
CaloGPUHybridClusterProcessor::m_preGPUoperations
ToolHandleArray< CaloClusterCollectionProcessor > m_preGPUoperations
Tools to be applied to the clusters before being sent to the GPU for processing.
Definition: CaloGPUHybridClusterProcessor.h:83
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
python.PyAthena.obj
obj
Definition: PyAthena.py:132
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
xAOD::CaloCluster_v1::N_BAD_CELLS
@ N_BAD_CELLS
number of bad cells
Definition: CaloCluster_v1.h:149
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
CaloGPUHybridClusterProcessor::m_clusterOutput
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_clusterOutput
The name of the key in StoreGate for the output CaloClusterContainer.
Definition: CaloGPUHybridClusterProcessor.h:163
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
plot_times.times
def times(fn)
Definition: plot_times.py:11
fitman.k
k
Definition: fitman.py:528
CaloRecGPU::Helpers::separate_thread_accessor
!
Definition: Calorimeter/CaloRecGPU/CaloRecGPU/Helpers.h:1622
CaloGPUHybridClusterProcessor::m_transformConstantData
ToolHandle< ICaloClusterGPUConstantTransformer > m_transformConstantData
The tool that will convert the constant data from the CPU to the GPU.
Definition: CaloGPUHybridClusterProcessor.h:77
ServiceHandle< ICondSvc >
CaloGPUHybridClusterProcessor::m_transformForGPU
ToolHandle< ICaloClusterGPUInputTransformer > m_transformForGPU
The tool that will actually convert the data from the CPU to the GPU.
Definition: CaloGPUHybridClusterProcessor.h:90
dumpTriggerInfo.checker
checker
Definition: dumpTriggerInfo.py:20