The Gaudi Framework  v40r0 (475e45c1)
ConcurrencyFlags.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 #pragma once
12 
13 #include <cstddef>
14 
15 #include <GaudiKernel/Kernel.h>
16 
17 class ThreadPoolSvc;
18 class HiveWhiteBoard;
19 class SGHiveMgrSvc;
20 class AthMpEvtLoopMgr;
21 class EvtStoreSvc;
22 
33 namespace SG {
34  class HiveMgrSvc;
35 }
36 
37 namespace Gaudi {
38 
39  namespace Concurrency {
40 
42 
43  friend class ::ThreadPoolSvc;
44  friend class ::HiveWhiteBoard;
45  friend class ::EvtStoreSvc;
46  friend class SG::HiveMgrSvc; // ATLAS
47  friend class ::AthMpEvtLoopMgr; // ATLAS
48 
49  public:
52  static GAUDI_API std::size_t numThreads() { return n_threads; }
53 
56  static GAUDI_API std::size_t numConcurrentEvents() { return n_concEvts; }
57 
60  static GAUDI_API std::size_t numProcs() { return n_procs; }
61 
64  static GAUDI_API bool concurrent() { return ( n_threads || n_concEvts || n_procs ); }
65 
66  private:
67  static GAUDI_API void setNumThreads( const std::size_t& nT ) { n_threads = nT; }
68  static GAUDI_API void setNumConcEvents( const std::size_t& nE ) { n_concEvts = nE; }
69  static GAUDI_API void setNumProcs( const std::size_t& nP ) { n_procs = nP; }
70 
71  private:
72  static std::size_t n_threads; // worker threads for MT
73  static std::size_t n_concEvts; // concurrent events for MT
74  static std::size_t n_procs; // child processes for MP
75  };
76  } // namespace Concurrency
77 } // namespace Gaudi
Gaudi::Concurrency::ConcurrencyFlags::setNumThreads
static GAUDI_API void setNumThreads(const std::size_t &nT)
Definition: ConcurrencyFlags.h:67
Gaudi::Concurrency::ConcurrencyFlags
Definition: ConcurrencyFlags.h:41
Gaudi::Concurrency::ConcurrencyFlags::numProcs
static GAUDI_API std::size_t numProcs()
number of forked child processes (for MP)
Definition: ConcurrencyFlags.h:60
Gaudi::Concurrency::ConcurrencyFlags::setNumProcs
static GAUDI_API void setNumProcs(const std::size_t &nP)
Definition: ConcurrencyFlags.h:69
Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents
static GAUDI_API std::size_t numConcurrentEvents()
number of Concurrent Events (for MT)
Definition: ConcurrencyFlags.h:56
Gaudi::Concurrency::ConcurrencyFlags::concurrent
static GAUDI_API bool concurrent()
serial operation, or some form of concurrency
Definition: ConcurrencyFlags.h:64
EvtStoreSvc
Definition: EvtStoreSvc.cpp:237
Gaudi::Concurrency::ConcurrencyFlags::n_concEvts
static std::size_t n_concEvts
Definition: ConcurrencyFlags.h:73
Gaudi::Concurrency::ConcurrencyFlags::HiveMgrSvc
friend class SG::HiveMgrSvc
Definition: ConcurrencyFlags.h:46
Gaudi::Concurrency::ConcurrencyFlags::n_threads
static std::size_t n_threads
Definition: ConcurrencyFlags.h:72
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:74
Kernel.h
Gaudi::Concurrency::ConcurrencyFlags::numThreads
static GAUDI_API std::size_t numThreads()
number of Worker Threads (for MT)
Definition: ConcurrencyFlags.h:52
Gaudi::Concurrency::ConcurrencyFlags::setNumConcEvents
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
Definition: ConcurrencyFlags.h:68
SG
Definition: ConcurrencyFlags.h:33
HiveWhiteBoard
Definition: HiveWhiteBoard.cpp:128
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:83
ThreadPoolSvc
A service which initializes a TBB thread pool.
Definition: ThreadPoolSvc.h:37