The Gaudi Framework
master (9f3f8895)
Toggle main menu visibility
Loading...
Searching...
No Matches
ConcurrencyFlags.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 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/IInterface.h
>
16
#include <
GaudiKernel/Kernel.h
>
17
18
class
AthMpEvtLoopMgr;
19
20
namespace
SG
{
21
class
HiveMgrSvc;
22
}
23
33
34
namespace
Gaudi
{
35
36
namespace
Concurrency {
37
38
class
ConcurrencyManager;
39
40
class
ConcurrencyFlags
{
41
42
friend
class
ConcurrencyManager
;
43
friend
class
SG::HiveMgrSvc
;
// ATLAS
44
friend
class ::AthMpEvtLoopMgr;
// ATLAS
45
46
public
:
49
static
GAUDI_API
std::size_t
numThreads
() {
return
n_threads
; }
50
53
static
GAUDI_API
std::size_t
numConcurrentEvents
() {
return
n_concEvts
; }
54
57
static
GAUDI_API
std::size_t
numProcs
() {
return
n_procs
; }
58
61
static
GAUDI_API
bool
concurrent
() {
return
(
n_threads
||
n_concEvts
||
n_procs
); }
62
63
private
:
64
static
GAUDI_API
void
setNumThreads
(
const
std::size_t& nT ) {
n_threads
= nT; }
65
static
GAUDI_API
void
setNumConcEvents
(
const
std::size_t& nE ) {
n_concEvts
= nE; }
66
static
GAUDI_API
void
setNumProcs
(
const
std::size_t& nP ) {
n_procs
= nP; }
67
68
private
:
69
static
std::size_t
n_threads
;
// worker threads for MT
70
static
std::size_t
n_concEvts
;
// concurrent events for MT
71
static
std::size_t
n_procs
;
// child processes for MP
72
};
73
83
class
GAUDI_API
ConcurrencyManager
:
virtual
public
IInterface
{
84
public
:
86
DeclareInterfaceID
(
ConcurrencyManager
, 1, 0 );
87
88
protected
:
90
static
void
setNumThreads
(
const
std::size_t& nT ) {
ConcurrencyFlags::setNumThreads
( nT ); }
91
93
static
void
setNumConcEvents
(
const
std::size_t& nE ) {
ConcurrencyFlags::setNumConcEvents
( nE ); }
94
96
static
void
setNumProcs
(
const
std::size_t& nP ) {
ConcurrencyFlags::setNumProcs
( nP ); }
97
};
98
99
}
// namespace Concurrency
100
}
// namespace Gaudi
IInterface.h
Kernel.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
Gaudi::Concurrency::ConcurrencyFlags
Definition
ConcurrencyFlags.h:40
Gaudi::Concurrency::ConcurrencyFlags::n_concEvts
static std::size_t n_concEvts
Definition
ConcurrencyFlags.h:70
Gaudi::Concurrency::ConcurrencyFlags::numConcurrentEvents
static GAUDI_API std::size_t numConcurrentEvents()
number of Concurrent Events (for MT)
Definition
ConcurrencyFlags.h:53
Gaudi::Concurrency::ConcurrencyFlags::setNumConcEvents
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
Definition
ConcurrencyFlags.h:65
Gaudi::Concurrency::ConcurrencyFlags::setNumThreads
static GAUDI_API void setNumThreads(const std::size_t &nT)
Definition
ConcurrencyFlags.h:64
Gaudi::Concurrency::ConcurrencyFlags::HiveMgrSvc
friend class SG::HiveMgrSvc
Definition
ConcurrencyFlags.h:43
Gaudi::Concurrency::ConcurrencyFlags::concurrent
static GAUDI_API bool concurrent()
serial operation, or some form of concurrency
Definition
ConcurrencyFlags.h:61
Gaudi::Concurrency::ConcurrencyFlags::setNumProcs
static GAUDI_API void setNumProcs(const std::size_t &nP)
Definition
ConcurrencyFlags.h:66
Gaudi::Concurrency::ConcurrencyFlags::ConcurrencyManager
friend class ConcurrencyManager
Definition
ConcurrencyFlags.h:42
Gaudi::Concurrency::ConcurrencyFlags::numThreads
static GAUDI_API std::size_t numThreads()
number of Worker Threads (for MT)
Definition
ConcurrencyFlags.h:49
Gaudi::Concurrency::ConcurrencyFlags::n_procs
static std::size_t n_procs
Definition
ConcurrencyFlags.h:71
Gaudi::Concurrency::ConcurrencyFlags::numProcs
static GAUDI_API std::size_t numProcs()
number of forked child processes (for MP)
Definition
ConcurrencyFlags.h:57
Gaudi::Concurrency::ConcurrencyFlags::n_threads
static std::size_t n_threads
Definition
ConcurrencyFlags.h:69
Gaudi::Concurrency::ConcurrencyManager
Interface implemented by components that are allowed to set the concurrency flags of the running job.
Definition
ConcurrencyFlags.h:83
Gaudi::Concurrency::ConcurrencyManager::DeclareInterfaceID
DeclareInterfaceID(ConcurrencyManager, 1, 0)
InterfaceID.
Gaudi::Concurrency::ConcurrencyManager::setNumConcEvents
static void setNumConcEvents(const std::size_t &nE)
Set the number of concurrent events (for MT).
Definition
ConcurrencyFlags.h:93
Gaudi::Concurrency::ConcurrencyManager::setNumThreads
static void setNumThreads(const std::size_t &nT)
Set the number of worker threads (for MT).
Definition
ConcurrencyFlags.h:90
Gaudi::Concurrency::ConcurrencyManager::setNumProcs
static void setNumProcs(const std::size_t &nP)
Set the number of forked child processes (for MP).
Definition
ConcurrencyFlags.h:96
IInterface
Definition of the basic interface.
Definition
IInterface.h:225
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
SG
Definition
ConcurrencyFlags.h:20
GaudiKernel
include
GaudiKernel
ConcurrencyFlags.h
Generated on
for The Gaudi Framework by
1.17.0