13#ifndef ROOT_ROOFIT_MultiProcess_ProcessManager
14#define ROOT_ROOFIT_MultiProcess_ProcessManager
25namespace MultiProcess {
Fork processes for queue and workers.
std::vector< pid_t > get_worker_pids()
void initialize_processes(bool cpu_pinning=true)
Fork processes and activate CPU pinning.
std::vector< pid_t > worker_pids_
std::array< int, 2 > mq_fds_
std::vector< std::array< int, 2 > > qw_fds_
std::size_t N_workers() const
pid_t get_queue_pid() const
void close_channel_fds()
Close all channel ends still owned by this ProcessManager (i.e.
static void handle_sigterm(int signum)
We need this to tell the children to die, because we can't talk to them anymore during JobManager des...
static int sigterm_wake_read_fd_
bool is_initialized() const
int claim_mw_fd(std::size_t worker_ix)
Hand over the master-worker channel end for the current process type.
void close_unused_channel_fds()
Close the channel ends that do not belong to the current process type.
static bool sigterm_received()
int claim_mq_fd()
Hand over the master-queue channel end for the current process type.
void wait_for_sigterm_then_exit()
static int sigterm_wake_write_fd_
std::vector< std::array< int, 2 > > mw_fds_
void identify_processes() const
Print to stdout which type of process we are on and what its PID is (for debugging)
static int sigterm_wake_fd()
Read end of the self-pipe that the SIGTERM handler writes to (or -1 on the master process,...
void terminate() noexcept
Shutdown forked processes if on master and if this process manager is initialized.
ProcessManager(std::size_t N_workers)
void shutdown_processes()
Shutdown forked processes if on master.
static volatile sig_atomic_t sigterm_received_
int claim_qw_fd(std::size_t worker_ix)
Hand over the queue-worker channel end for the current process type.
void create_channel_fds()
Create the socketpairs that connect the processes.
std::size_t worker_id() const
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...