The Gaudi Framework  master (37c0b60a)
ConcurrencyFlags.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_CONCURRENCYFLAGS_H
12 #define GAUDIKERNEL_CONCURRENCYFLAGS_H 1
13 
14 #include <cstddef>
15 
16 #include <GaudiKernel/Kernel.h>
17 
18 class ThreadPoolSvc;
19 class HiveWhiteBoard;
20 class SGHiveMgrSvc;
21 class AthMpEvtLoopMgr;
22 class EvtStoreSvc;
23 
34 namespace SG {
35  class HiveMgrSvc;
36 }
37 
38 namespace Gaudi {
39 
40  namespace Concurrency {
41 
43 
44  friend class ::ThreadPoolSvc;
45  friend class ::HiveWhiteBoard;
46  friend class ::EvtStoreSvc;
47  friend class SG::HiveMgrSvc; // ATLAS
48  friend class ::AthMpEvtLoopMgr; // ATLAS
49 
50  public:
54 
58 
61  static GAUDI_API std::size_t numProcs() { return n_procs; }
62 
65  static GAUDI_API bool concurrent() { return ( n_threads || n_concEvts || n_procs ); }
66 
67  private:
68  static GAUDI_API void setNumThreads( const std::size_t& nT ) { n_threads = nT; }
69  static GAUDI_API void setNumConcEvents( const std::size_t& nE ) { n_concEvts = nE; }
70  static GAUDI_API void setNumProcs( const std::size_t& nP ) { n_procs = nP; }
71 
72  private:
73  static std::size_t n_threads; // worker threads for MT
74  static std::size_t n_concEvts; // concurrent events for MT
75  static std::size_t n_procs; // child processes for MP
76  };
77  } // namespace Concurrency
78 } // namespace Gaudi
79 
80 #endif
Gaudi::Concurrency::ConcurrencyFlags::setNumThreads
static GAUDI_API void setNumThreads(const std::size_t &nT)
Definition: ConcurrencyFlags.h:68
Gaudi::Concurrency::ConcurrencyFlags
Definition: ConcurrencyFlags.h:42
Gaudi::Concurrency::ConcurrencyFlags::numProcs
static GAUDI_API std::size_t numProcs()
number of forked child processes (for MP)
Definition: ConcurrencyFlags.h:61
Gaudi::Concurrency::ConcurrencyFlags::setNumProcs
static GAUDI_API void setNumProcs(const std::size_t &nP)
Definition: ConcurrencyFlags.h:70
Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents
static GAUDI_API std::size_t numConcurrentEvents()
number of Concurrent Events (for MT)
Definition: ConcurrencyFlags.h:57
Gaudi::Concurrency::ConcurrencyFlags::concurrent
static GAUDI_API bool concurrent()
serial operation, or some form of concurrency
Definition: ConcurrencyFlags.h:65
EvtStoreSvc
Definition: EvtStoreSvc.cpp:237
Gaudi::Concurrency::ConcurrencyFlags::n_concEvts
static std::size_t n_concEvts
Definition: ConcurrencyFlags.h:74
Gaudi::Concurrency::ConcurrencyFlags::HiveMgrSvc
friend class SG::HiveMgrSvc
Definition: ConcurrencyFlags.h:47
Gaudi::Concurrency::ConcurrencyFlags::n_threads
static std::size_t n_threads
Definition: ConcurrencyFlags.h:73
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
Gaudi::Concurrency::ConcurrencyFlags::n_procs
static std::size_t n_procs
Definition: ConcurrencyFlags.h:75
Kernel.h
Gaudi::Concurrency::ConcurrencyFlags::numThreads
static GAUDI_API std::size_t numThreads()
number of Worker Threads (for MT)
Definition: ConcurrencyFlags.h:53
std::size_t
Gaudi::Concurrency::ConcurrencyFlags::setNumConcEvents
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
Definition: ConcurrencyFlags.h:69
SG
Definition: ConcurrencyFlags.h:34
HiveWhiteBoard
Definition: HiveWhiteBoard.cpp:128
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
ThreadPoolSvc
A service which initializes a TBB thread pool.
Definition: ThreadPoolSvc.h:38