ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaInterprocess
AthenaInterprocess
ProcessGroup.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ATHENAINTERPROCESS_PROCESSGROUP_H
6
#define ATHENAINTERPROCESS_PROCESSGROUP_H
7
8
#include "
AthenaInterprocess/Process.h
"
9
#include "
AthenaInterprocess/IdentifiedSharedQueue.h
"
10
#include "
CxxUtils/checker_macros.h
"
11
#include <vector>
12
13
namespace
AthenaInterprocess
{
14
15
class
IMessageDecoder
;
16
17
struct
ProcessStatus
{
18
pid_t
pid
{};
19
int
exitcode
{};
20
};
21
22
struct
ProcessResult
{
23
pid_t
pid
{};
24
ScheduledWork
output
{};
25
};
26
27
class
ProcessGroup
{
28
public
:
29
explicit
ProcessGroup
(
int
nprocs = -1);
30
31
virtual
~ProcessGroup
();
32
33
pid_t
launchProcess
ATLAS_NOT_THREAD_SAFE
();
// Add one new process to the group
34
35
int
map_async
ATLAS_NOT_THREAD_SAFE
(
const
IMessageDecoder
* func,
const
ScheduledWork
* args,
pid_t
pid=0);
// If pid=0 map on the entire group
36
int
wait
ATLAS_NOT_THREAD_SAFE
(
int
options = 0);
37
pid_t
wait_once
(
bool
& flag);
// flag=true if process succeeded, flag=false otherwise
38
ProcessResult
*
pullOneResult
();
// The caller takes ownership on the result
39
40
pid_t
getGroupID
()
const
;
41
const
std::vector<Process>&
getChildren
()
const
;
42
const
std::vector<ProcessStatus>&
getStatuses
()
const
;
43
44
private
:
45
bool
create
ATLAS_NOT_THREAD_SAFE
();
46
47
std::vector<Process>
m_processes
;
48
std::vector<ProcessStatus>
m_statuses
;
49
IdentifiedSharedQueue
m_inbox
;
50
int
m_nprocs
;
51
pid_t
m_pgid
;
52
int
m_processesCreated
;
// Keep track of total number of created processes
53
// This can be more than m_nprocs if some processes have been launched later on
54
// (restarting failed processes)
55
};
56
57
}
// namespace AthenaInterprocess
58
59
#endif
// !ATHENAINTERPROCESS_PROCESSGROUP_H
pid_t
int32_t pid_t
Definition
FPGATrackSimTypes.h:19
IdentifiedSharedQueue.h
Process.h
checker_macros.h
Define macros for attributes used to control the static checker.
AthenaInterprocess::IMessageDecoder
Definition
IMessageDecoder.h:18
AthenaInterprocess::IdentifiedSharedQueue
Definition
IdentifiedSharedQueue.h:14
AthenaInterprocess::ProcessGroup::getStatuses
const std::vector< ProcessStatus > & getStatuses() const
Definition
ProcessGroup.cxx:204
AthenaInterprocess::ProcessGroup::~ProcessGroup
virtual ~ProcessGroup()
Definition
ProcessGroup.cxx:45
AthenaInterprocess::ProcessGroup::ProcessGroup
ProcessGroup(int nprocs=-1)
Definition
ProcessGroup.cxx:34
AthenaInterprocess::ProcessGroup::wait_once
pid_t wait_once(bool &flag)
Definition
ProcessGroup.cxx:149
AthenaInterprocess::ProcessGroup::m_processesCreated
int m_processesCreated
Definition
ProcessGroup.h:52
AthenaInterprocess::ProcessGroup::pullOneResult
ProcessResult * pullOneResult()
Definition
ProcessGroup.cxx:177
AthenaInterprocess::ProcessGroup::m_inbox
IdentifiedSharedQueue m_inbox
Definition
ProcessGroup.h:49
AthenaInterprocess::ProcessGroup::getChildren
const std::vector< Process > & getChildren() const
Definition
ProcessGroup.cxx:197
AthenaInterprocess::ProcessGroup::m_processes
std::vector< Process > m_processes
Definition
ProcessGroup.h:47
AthenaInterprocess::ProcessGroup::ATLAS_NOT_THREAD_SAFE
bool create ATLAS_NOT_THREAD_SAFE()
AthenaInterprocess::ProcessGroup::ATLAS_NOT_THREAD_SAFE
int wait ATLAS_NOT_THREAD_SAFE(int options=0)
AthenaInterprocess::ProcessGroup::ATLAS_NOT_THREAD_SAFE
pid_t launchProcess ATLAS_NOT_THREAD_SAFE()
AthenaInterprocess::ProcessGroup::m_nprocs
int m_nprocs
Definition
ProcessGroup.h:50
AthenaInterprocess::ProcessGroup::ATLAS_NOT_THREAD_SAFE
int map_async ATLAS_NOT_THREAD_SAFE(const IMessageDecoder *func, const ScheduledWork *args, pid_t pid=0)
AthenaInterprocess::ProcessGroup::getGroupID
pid_t getGroupID() const
Definition
ProcessGroup.cxx:192
AthenaInterprocess::ProcessGroup::m_pgid
pid_t m_pgid
Definition
ProcessGroup.h:51
AthenaInterprocess::ProcessGroup::m_statuses
std::vector< ProcessStatus > m_statuses
Definition
ProcessGroup.h:48
AthenaInterprocess
Definition
FdsRegistry.h:11
AthenaInterprocess::ProcessResult
Definition
ProcessGroup.h:22
AthenaInterprocess::ProcessResult::pid
pid_t pid
Definition
ProcessGroup.h:23
AthenaInterprocess::ProcessResult::output
ScheduledWork output
Definition
ProcessGroup.h:24
AthenaInterprocess::ProcessStatus
Definition
ProcessGroup.h:17
AthenaInterprocess::ProcessStatus::exitcode
int exitcode
Definition
ProcessGroup.h:19
AthenaInterprocess::ProcessStatus::pid
pid_t pid
Definition
ProcessGroup.h:18
AthenaInterprocess::ScheduledWork
Definition
IMessageDecoder.h:12
Generated on
for ATLAS Offline Software by
1.17.0