Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v28r2p1 (f1a77ff4)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ConcurrencyFlags.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_CONCURRENCYFLAGS_H
2 #define GAUDIKERNEL_CONCURRENCYFLAGS_H 1
3 
4 #include <cstddef>
5 
6 #include "GaudiKernel/Kernel.h"
7 
8 class ThreadPoolSvc;
11 
22 namespace Gaudi {
23 
24  namespace Concurrency {
25 
27 
28  friend class ::ThreadPoolSvc;
29  friend class ::ForwardSchedulerSvc;
30  friend class ::AvalancheSchedulerSvc;
31 
32  public:
33 
37 
41 
44  static GAUDI_API std::size_t numProcs() { return n_procs; }
45 
48  static GAUDI_API bool concurrent() {
49  return ( n_threads || n_concEvts || n_procs );
50  }
51 
52  private:
53 
54  static GAUDI_API void setNumThreads(const std::size_t& nT) {n_threads=nT;}
55  static GAUDI_API void setNumConcEvents(const std::size_t& nE) {n_concEvts=nE;}
56  static GAUDI_API void setNumProcs(const std::size_t& nP) {n_procs=nP;}
57 
58  private:
59  static std::size_t n_threads; // worker threads for MT
60  static std::size_t n_concEvts; // concurrent events for MT
61  static std::size_t n_procs; // child processes for MP
62  };
63 
64  }
65 }
66 
67 #endif
static GAUDI_API void setNumThreads(const std::size_t &nT)
static GAUDI_API std::size_t numThreads()
number of Worker Threads (for MT)
static GAUDI_API void setNumProcs(const std::size_t &nP)
The SchedulerSvc implements the IScheduler interface.
static GAUDI_API std::size_t numProcs()
number of forked child processes (for MP)
static GAUDI_API bool concurrent()
serial operation, or some form of concurrency
A service which initializes a TBB thread pool.
Definition: ThreadPoolSvc.h:26
#define GAUDI_API
Definition: Kernel.h:107
Helper functions to set/get the application return code.
Definition: __init__.py:1
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
static GAUDI_API std::size_t numConcurrentEvents()
number of Concurrent Events (for MT)