ATLAS Offline Software
Loading...
Searching...
No Matches
IAthenaMPTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ATHENAMPTOOLS_IATHENAMPTOOL_H
6#define ATHENAMPTOOLS_IATHENAMPTOOL_H
7
8#include "GaudiKernel/IAlgTool.h"
11
12#include <memory>
13#include <vector>
14#include <map>
15
16namespace AthenaInterprocess {
17 class IMPRunStop;
18}
19
20namespace AthenaMP {
22 std::string filename;
23 std::string technology;
24 std::string description;
25 std::string access_mode;
26 bool shared;
27 };
28 typedef std::vector<WorkerOutput> SingleWorkerOutputs;
29 typedef std::map<std::string,SingleWorkerOutputs> AllWorkerOutputs;
30 typedef AllWorkerOutputs::iterator AllWorkerOutputsIterator;
31
32 typedef std::unique_ptr<AllWorkerOutputs> AllWorkerOutputs_ptr;
33}
34
35static const InterfaceID IID_IAthenaMPTool( "IAthenaMPTool", 1, 0 );
36
37class IAthenaMPTool : virtual public IAlgTool
38{
39 public:
40 static const InterfaceID& interfaceID() { return IID_IAthenaMPTool; }
41
42 // Returns number of children processes in the pool. -1 in case of failure
43 virtual int makePool ATLAS_NOT_THREAD_SAFE (int maxevt, int nprocs, const std::string& topdir) = 0;
44
45 virtual StatusCode exec ATLAS_NOT_THREAD_SAFE () = 0;
46
47 // Pid of the finished process, 0 if no process finished, <0 if wait on the group failed
48 virtual StatusCode wait_once ATLAS_NOT_THREAD_SAFE (pid_t& pid) = 0;
49
50 virtual void reportSubprocessStatuses() = 0;
51 virtual void subProcessLogs(std::vector<std::string>&) = 0;
53
54 virtual void useFdsRegistry(std::shared_ptr<AthenaInterprocess::FdsRegistry>) = 0;
55 virtual void setRandString(const std::string& randStr) = 0;
56 virtual void setMaxEvt(int maxEvt) = 0;
57 virtual void setMPRunStop(const AthenaInterprocess::IMPRunStop* runStop) = 0;
58
59 // Brute force: kill all children
60 virtual void killChildren() = 0;
61};
62
63#endif
int32_t pid_t
static const InterfaceID IID_IAthenaMPTool("IAthenaMPTool", 1, 0)
Define macros for attributes used to control the static checker.
virtual StatusCode exec ATLAS_NOT_THREAD_SAFE()=0
virtual AthenaMP::AllWorkerOutputs_ptr generateOutputReport()=0
virtual int makePool ATLAS_NOT_THREAD_SAFE(int maxevt, int nprocs, const std::string &topdir)=0
virtual StatusCode wait_once ATLAS_NOT_THREAD_SAFE(pid_t &pid)=0
virtual void reportSubprocessStatuses()=0
virtual void setMPRunStop(const AthenaInterprocess::IMPRunStop *runStop)=0
virtual void subProcessLogs(std::vector< std::string > &)=0
virtual void killChildren()=0
virtual void setRandString(const std::string &randStr)=0
virtual void useFdsRegistry(std::shared_ptr< AthenaInterprocess::FdsRegistry >)=0
static const InterfaceID & interfaceID()
virtual void setMaxEvt(int maxEvt)=0
std::map< std::string, SingleWorkerOutputs > AllWorkerOutputs
std::unique_ptr< AllWorkerOutputs > AllWorkerOutputs_ptr
AllWorkerOutputs::iterator AllWorkerOutputsIterator
std::vector< WorkerOutput > SingleWorkerOutputs