The Gaudi Framework  v29r0 (ff2e7097)
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 
25  namespace Concurrency
26  {
27 
29  {
30 
31  friend class ::ThreadPoolSvc;
32  friend class ::ForwardSchedulerSvc;
33  friend class ::AvalancheSchedulerSvc;
34 
35  public:
39 
43 
46  static GAUDI_API std::size_t numProcs() { return n_procs; }
47 
50  static GAUDI_API bool concurrent() { return ( n_threads || n_concEvts || n_procs ); }
51 
52  private:
53  static GAUDI_API void setNumThreads( const std::size_t& nT ) { n_threads = nT; }
54  static GAUDI_API void setNumConcEvents( const std::size_t& nE ) { n_concEvts = nE; }
55  static GAUDI_API void setNumProcs( const std::size_t& nP ) { n_procs = nP; }
56 
57  private:
58  static std::size_t n_threads; // worker threads for MT
59  static std::size_t n_concEvts; // concurrent events for MT
60  static std::size_t n_procs; // child processes for MP
61  };
62  }
63 }
64 
65 #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:110
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)