ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
BasicGPUClusterInfoCalculator Class Reference

Standard tool to calculate cluster info (energy, transverse energy, pseudo-rapidity and azimuthal angle) and apply E/ET cuts on clusters if desired. More...

#include <BasicGPUClusterInfoCalculator.h>

Inheritance diagram for BasicGPUClusterInfoCalculator:
Collaboration diagram for BasicGPUClusterInfoCalculator:

Public Member Functions

 BasicGPUClusterInfoCalculator (const std::string &type, const std::string &name, const IInterface *parent)
 
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 CaloRecGPU::ConstantDataHolder &constant_data, CaloRecGPU::EventDataHolder &event_data, void *temporary_buffer) const override
 Process the clusters on GPU. More...
 
virtual StatusCode finalize () override
 
virtual ~BasicGPUClusterInfoCalculator ()=default
 
virtual size_t size_of_temporaries () const override
 The size (in bytes) of the temporary object(s) that the algorithm will use. More...
 
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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 
 DeclareInterfaceID (CaloClusterGPUProcessor, 1, 0)
 
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::mutex m_timeMutex
 Mutex that is locked when recording times. More...
 
std::vector< size_t > m_times ATLAS_THREAD_SAFE
 Vector to hold execution times to be recorded if necessary. More...
 
std::vector< size_t > m_eventNumbers ATLAS_THREAD_SAFE
 Vector to hold the event numbers to be recorded if necessary. 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 (size_t) const
 
void record_times_helper (size_t index, size_t t) const
 
template<class ... Args>
void record_times_helper (size_t index, size_t t, Args &&... args) const
 

Private Attributes

Gaudi::Property< bool > m_preserveClusterMoments {this, "PreserveClusterMoments", false, "Do not use cluster moments array as temporary storage"}
 If set to true, allocates a temporary array to store some temporary intermediate results instead of using cluster moments. More...
 
Gaudi::Property< bool > m_cutClustersInAbsE {this, "ClusterCutsInAbsEt", true, "Do cluster cuts in Abs Et instead of Et"}
 if set to true cluster cuts are on \(|E|_\perp\), if false on \(E_\perp\). More...
 
Gaudi::Property< float > m_clusterETThreshold {this, "ClusterEtorAbsEtCut", 0.*CLHEP::MeV, "Cluster E_t or Abs E_t cut"}
 \(E_\perp\) cut on the clusters. More...
 
ServiceHandle< IGPUKernelSizeOptimizerSvcm_kernelSizeOptimizer { this, "KernelSizeOptimizer", "GPUKernelSizeOptimizerSvc", "CUDA kernel size optimization service." }
 Handle to the CUDA kernel block and grid size optimization service. 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

Standard tool to calculate cluster info (energy, transverse energy, pseudo-rapidity and azimuthal angle) and apply E/ET cuts on clusters if desired.

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
11 August 2022

Definition at line 34 of file BasicGPUClusterInfoCalculator.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ BasicGPUClusterInfoCalculator()

BasicGPUClusterInfoCalculator::BasicGPUClusterInfoCalculator ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 16 of file BasicGPUClusterInfoCalculator.cxx.

16  :
18  CaloGPUTimed(this)
19 {
20  declareInterface<CaloClusterGPUProcessor> (this);
21 }

◆ ~BasicGPUClusterInfoCalculator()

virtual BasicGPUClusterInfoCalculator::~BasicGPUClusterInfoCalculator ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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  }

◆ DeclareInterfaceID()

CaloClusterGPUProcessor::DeclareInterfaceID ( CaloClusterGPUProcessor  ,
,
 
)
inherited

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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 BasicGPUClusterInfoCalculator::execute ( const EventContext &  ctx,
const CaloRecGPU::ConstantDataHolder constant_data,
CaloRecGPU::EventDataHolder event_data,
void *  temporary_buffer 
) const
overridevirtual

Process the clusters on GPU.

Parameters
ctxThe event context.
constant_dataData held in GPU memory that is common to all events (cell noise and geometry).
event_dataData held in GPU memory that is specific to this event (including the description of the clusters themselves).
temporary_bufferA pointer to an \array in GPU memory that is at least as large as size_of_temporaries(), to hold temporary information for the algorithms. Given the way CUDA memory allocations work, casting this to a pointer (or a CaloRecGPU::Helpers::CUDA_kernel_object) to the intended type and then using it will be perfectly valid.

Implements CaloClusterGPUProcessor.

Definition at line 35 of file BasicGPUClusterInfoCalculator.cxx.

37 {
38  using clock_type = boost::chrono::thread_clock;
39  auto time_cast = [](const auto & before, const auto & after)
40  {
41  return boost::chrono::duration_cast<boost::chrono::microseconds>(after - before).count();
42  };
43 
44  const auto start = clock_type::now();
45 
46  void * temp_store = (m_preserveClusterMoments ? temporary_buffer : (ClusterMomentsArr *) event_data.m_moments_dev);
47 
49 
50  const auto before_seed_properties = clock_type::now();
51 
52  updateSeedCellProperties(event_data, temporaries, constant_data, *(m_kernelSizeOptimizer.get()), m_measureTimes);
53 
54  const auto before_calculating = clock_type::now();
55 
57 
58  const auto end = clock_type::now();
59 
60 
61  if (m_measureTimes)
62  {
63  record_times(ctx.evt(),
64  time_cast(start, before_seed_properties),
65  time_cast(before_seed_properties, before_calculating),
66  time_cast(before_calculating, end)
67  );
68  }
69 
70 
71  return StatusCode::SUCCESS;
72 
73 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ finalize()

StatusCode BasicGPUClusterInfoCalculator::finalize ( )
overridevirtual

Definition at line 76 of file BasicGPUClusterInfoCalculator.cxx.

77 {
78  if (m_measureTimes)
79  {
80  print_times("Preprocessing Seed_Cell_Properties_Updating Cluster_Properties_Calculation", 3);
81  }
82  return StatusCode::SUCCESS;
83 }

◆ 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 BasicGPUClusterInfoCalculator::initialize ( )
inlineoverridevirtual

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 41 of file BasicGPUClusterInfoCalculator.h.

42  {
44  }

◆ initialize_CUDA()

StatusCode BasicGPUClusterInfoCalculator::initialize_CUDA ( )
overridevirtual

Initialization that invokes CUDA functions.

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 29 of file BasicGPUClusterInfoCalculator.cxx.

30 {
32  return StatusCode::SUCCESS;
33 }

◆ initialize_non_CUDA()

StatusCode BasicGPUClusterInfoCalculator::initialize_non_CUDA ( )
overridevirtual

Initialization that does not invoke CUDA functions.

Reimplemented from CaloGPUCUDAInitialization.

Definition at line 23 of file BasicGPUClusterInfoCalculator.cxx.

24 {
25  ATH_CHECK( m_kernelSizeOptimizer.retrieve() );
26  return StatusCode::SUCCESS;
27 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::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< AlgTool > >::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 138 of file CaloGPUTimed.h.

139  {
140  if (m_timeFileName.size() == 0)
141  {
142  return;
143  }
144 
145  std::vector<size_t> indices(m_eventNumbers.size());
146  std::iota(indices.begin(), indices.end(), 0);
147  std::sort(indices.begin(), indices.end(), [&](size_t a, size_t b)
148  {
149  return m_eventNumbers[a] < m_eventNumbers[b];
150  }
151  );
152  std::ofstream out(m_timeFileName);
153 
154  out << "Event_Number Total " << header << "\n";
155 
156  for (const size_t idx : indices)
157  {
158  out << m_eventNumbers[idx] << " ";
159 
160  size_t total = 0;
161 
162  for (size_t i = 0; i < time_size; ++i)
163  {
164  total += m_times[idx * time_size + i];
165  }
166 
167  out << total << " ";
168 
169  for (size_t i = 0; i < time_size; ++i)
170  {
171  out << m_times[idx * time_size + i] << " ";
172  }
173  out << "\n";
174  }
175 
176  out << std::endl;
177 
178  out.close();
179  }

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

103  {
104  const size_t time_size = 1;
105 
106  size_t old_size;
107 
108  //Scope just for the lock_guard.
109  {
110  std::lock_guard<std::mutex> lock_guard(m_timeMutex);
111  old_size = m_times.size();
112  m_times.resize(old_size + time_size);
113  m_eventNumbers.push_back(event_num);
114  }
115 
116  record_times_helper(old_size, value);
117  }

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

121  {
122  const size_t time_size = sizeof...(args) + 1;
123 
124  size_t old_size;
125 
126  //Scope just for the lock_guard.
127  {
128  std::lock_guard<std::mutex> lock_guard(m_timeMutex);
129  old_size = m_times.size();
130  m_times.resize(old_size + time_size);
131  m_eventNumbers.push_back(event_num);
132  }
133 
134  record_times_helper(old_size, value, std::forward<Args>(args)...);
135 
136  }

◆ record_times() [3/3]

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

Definition at line 84 of file CaloGPUTimed.h.

85  {
86  size_t old_size;
87  //Scope just for the lock_guard.
88  {
89  std::lock_guard<std::mutex> lock_guard(m_timeMutex);
90  old_size = m_times.size();
91  m_times.resize(old_size + times.size());
92  m_eventNumbers.push_back(event_num);
93  }
94 
95  for (size_t i = 0; i < times.size(); ++i)
96  {
97  m_times[old_size + i] = times[i];
98  }
99  }

◆ record_times_helper() [1/3]

void CaloGPUTimed::record_times_helper ( size_t  index,
size_t  t 
) const
inlineprivateinherited

Definition at line 70 of file CaloGPUTimed.h.

71  {
72  m_times[index] = t;
73  }

◆ record_times_helper() [2/3]

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

Definition at line 76 of file CaloGPUTimed.h.

77  {
79  record_times_helper(index + 1, std::forward<Args>(args)...);
80  }

◆ record_times_helper() [3/3]

void CaloGPUTimed::record_times_helper ( size_t  ) const
inlineprivateinherited

Definition at line 64 of file CaloGPUTimed.h.

65  {
66  //Do nothing
67  }

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

◆ size_of_temporaries()

virtual size_t BasicGPUClusterInfoCalculator::size_of_temporaries ( ) const
inlineoverridevirtual

The size (in bytes) of the temporary object(s) that the algorithm will use.

Reimplemented from CaloClusterGPUProcessor.

Definition at line 59 of file BasicGPUClusterInfoCalculator.h.

60  {
62  {
64  }
65  else
66  {
67  return 0;
68  }
69  };

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

std::vector<size_t> m_times CaloGPUTimed::ATLAS_THREAD_SAFE
mutableprotectedinherited

Vector to hold execution times to be recorded if necessary.

Definition at line 35 of file CaloGPUTimed.h.

◆ ATLAS_THREAD_SAFE [2/2]

std::vector<size_t> m_eventNumbers CaloGPUTimed::ATLAS_THREAD_SAFE
mutableprotectedinherited

Vector to hold the event numbers to be recorded if necessary.

Definition at line 40 of file CaloGPUTimed.h.

◆ m_clusterETThreshold

Gaudi::Property<float> BasicGPUClusterInfoCalculator::m_clusterETThreshold {this, "ClusterEtorAbsEtCut", 0.*CLHEP::MeV, "Cluster E_t or Abs E_t cut"}
private

\(E_\perp\) cut on the clusters.

The clusters have to pass this cut (which is on \(E_\perp\) or \(|E|_\perp\) of the cluster depending on the above switch) in order to be inserted into the CaloClusterContainer.

Definition at line 93 of file BasicGPUClusterInfoCalculator.h.

◆ m_cutClustersInAbsE

Gaudi::Property<bool> BasicGPUClusterInfoCalculator::m_cutClustersInAbsE {this, "ClusterCutsInAbsEt", true, "Do cluster cuts in Abs Et instead of Et"}
private

if set to true cluster cuts are on \(|E|_\perp\), if false on \(E_\perp\).

Default is true.

Definition at line 84 of file BasicGPUClusterInfoCalculator.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_kernelSizeOptimizer

ServiceHandle<IGPUKernelSizeOptimizerSvc> BasicGPUClusterInfoCalculator::m_kernelSizeOptimizer { this, "KernelSizeOptimizer", "GPUKernelSizeOptimizerSvc", "CUDA kernel size optimization service." }
private

Handle to the CUDA kernel block and grid size optimization service.

Definition at line 96 of file BasicGPUClusterInfoCalculator.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_preserveClusterMoments

Gaudi::Property<bool> BasicGPUClusterInfoCalculator::m_preserveClusterMoments {this, "PreserveClusterMoments", false, "Do not use cluster moments array as temporary storage"}
private

If set to true, allocates a temporary array to store some temporary intermediate results instead of using cluster moments.

Default is false.

Definition at line 78 of file BasicGPUClusterInfoCalculator.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::mutex CaloGPUTimed::m_timeMutex
mutableprotectedinherited

Mutex that is locked when recording times.

Definition at line 32 of file CaloGPUTimed.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
BasicGPUClusterInfoCalculator::m_kernelSizeOptimizer
ServiceHandle< IGPUKernelSizeOptimizerSvc > m_kernelSizeOptimizer
Handle to the CUDA kernel block and grid size optimization service.
Definition: BasicGPUClusterInfoCalculator.h:96
BasicClusterInfoCalculator::calculateClusterProperties
void calculateClusterProperties(CaloRecGPU::EventDataHolder &holder, CaloRecGPU::Helpers::CUDA_kernel_object< ClusterInfoCalculatorTemporaries > temps, const CaloRecGPU::ConstantDataHolder &instance_data, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, const bool cut_in_absolute_ET=true, const float absolute_ET_threshold=-1, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
header
Definition: hcg.cxx:526
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
BasicGPUClusterInfoCalculator::m_clusterETThreshold
Gaudi::Property< float > m_clusterETThreshold
cut on the clusters.
Definition: BasicGPUClusterInfoCalculator.h:93
CaloRecGPU::EventDataHolder::m_moments_dev
CaloRecGPU::Helpers::CUDA_object< CaloRecGPU::ClusterMomentsArr > m_moments_dev
Definition: DataHolders.h:91
index
Definition: index.py:1
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
BasicClusterInfoCalculator::updateSeedCellProperties
void updateSeedCellProperties(CaloRecGPU::EventDataHolder &holder, CaloRecGPU::Helpers::CUDA_kernel_object< ClusterInfoCalculatorTemporaries > temps, const CaloRecGPU::ConstantDataHolder &instance_data, const IGPUKernelSizeOptimizer &optimizer, const bool synchronize=false, CaloRecGPU::CUDA_Helpers::CUDAStreamPtrHolder stream_to_use={})
BasicClusterInfoCalculator::ClusterInfoCalculatorTemporaries
Definition: BasicGPUClusterInfoCalculatorImpl.h:19
CaloRecGPU::Helpers::SimpleHolder
Holds one objects of type \T in memory context Context.
Definition: Calorimeter/CaloRecGPU/CaloRecGPU/Helpers.h:1069
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
athena.value
value
Definition: athena.py:122
CaloGPUTimed::record_times_helper
void record_times_helper(size_t) const
Definition: CaloGPUTimed.h:64
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
CaloGPUCUDAInitialization::initialize
virtual StatusCode initialize()
Definition: CaloGPUCUDAInitialization.h:44
python.handimod.now
now
Definition: handimod.py:675
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloGPUTimed::print_times
void print_times(const std::string &header, const size_t time_size) const
Definition: CaloGPUTimed.h:138
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CaloGPUTimed::m_timeMutex
std::mutex m_timeMutex
Mutex that is locked when recording times.
Definition: CaloGPUTimed.h:32
CaloGPUTimed::CaloGPUTimed
CaloGPUTimed(T *ptr)
Definition: CaloGPUTimed.h:55
CaloRecGPU::ClusterMomentsArr
Definition: EventInfoDefinitions.h:342
AthenaInterprocess::UpdateAfterFork::type
static const std::string & type()
Incident type.
Definition: Incidents.h:49
CaloGPUCUDAInitialization::initialize_CUDA
virtual StatusCode initialize_CUDA()
Initialization that invokes CUDA functions.
Definition: CaloGPUCUDAInitialization.h:39
DeMoScan.index
string index
Definition: DeMoScan.py:362
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:84
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
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
BasicClusterInfoCalculator::register_kernels
void register_kernels(IGPUKernelSizeOptimizer &optimizer)
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:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
BasicGPUClusterInfoCalculator::m_cutClustersInAbsE
Gaudi::Property< bool > m_cutClustersInAbsE
if set to true cluster cuts are on , if false on .
Definition: BasicGPUClusterInfoCalculator.h:84
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
BasicGPUClusterInfoCalculator::m_preserveClusterMoments
Gaudi::Property< bool > m_preserveClusterMoments
If set to true, allocates a temporary array to store some temporary intermediate results instead of u...
Definition: BasicGPUClusterInfoCalculator.h:78
plot_times.times
def times(fn)
Definition: plot_times.py:11
fitman.k
k
Definition: fitman.py:528