ATLAS Offline Software
Loading...
Searching...
No Matches
ProcessGroup.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ATHENAINTERPROCESS_PROCESSGROUP_H
6#define ATHENAINTERPROCESS_PROCESSGROUP_H
7
11#include <vector>
12
13namespace AthenaInterprocess {
14
15class IMessageDecoder;
16
21
26
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;
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
int32_t pid_t
Define macros for attributes used to control the static checker.
const std::vector< ProcessStatus > & getStatuses() const
IdentifiedSharedQueue m_inbox
const std::vector< Process > & getChildren() const
std::vector< Process > m_processes
int wait ATLAS_NOT_THREAD_SAFE(int options=0)
pid_t launchProcess ATLAS_NOT_THREAD_SAFE()
int map_async ATLAS_NOT_THREAD_SAFE(const IMessageDecoder *func, const ScheduledWork *args, pid_t pid=0)
std::vector< ProcessStatus > m_statuses