26namespace MultiProcess {
75 queue_ptr_ = std::make_unique<PriorityQueue>();
117 if (
instance_->process_manager().is_initialized()) {
118 std::stringstream
ss;
119 ss <<
"Cannot add Job to JobManager instantiation, forking has already taken place! Instance object at raw "
122 throw std::logic_error(
"Cannot add Job to JobManager instantiation, forking has already taken place! Call "
123 "terminate() on the instance before adding new Jobs.");
136 throw std::runtime_error(
"JobManager::get_job_object: unknown job ID " + std::to_string(
job_object_id) +
137 ", the interprocess message stream may be corrupted");
139 return found->second;
179 throw std::runtime_error(
"JobManager::retrieve: received a task result message that is too short to "
180 "contain a job ID, the interprocess message stream may be corrupted");
190 throw std::logic_error(
"in JobManager::retrieve: master received a SIGTERM, aborting");
219 }
catch (
const std::exception &
e) {
229 }
catch (
const std::exception &
e) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
const_iterator end() const
static unsigned int getDefaultNWorkers()
Main point of access for all MultiProcess infrastructure.
std::unique_ptr< Messenger > messenger_ptr_
std::unique_ptr< Queue > queue_ptr_
static std::size_t add_job_object(Job *job_object)
Messenger & messenger() const
static JobManager * instance()
static std::size_t job_counter_
static Job * get_job_object(std::size_t job_object_id)
ProcessManager & process_manager() const
JobManager(std::size_t N_workers)
Don't construct JobManager objects manually, use the static instance if you need to run multiple jobs...
std::unique_ptr< ProcessManager > process_manager_ptr_
static std::map< std::size_t, Job * > job_objects_
static bool remove_job_object(std::size_t job_object_id)
static std::unique_ptr< JobManager > instance_
void retrieve(std::size_t requesting_job_id)
Retrieve results for a Job.
bool is_activated() const
void activate()
Start queue and worker loops on child processes.
static bool is_instantiated()
interface class for defining the actual work that must be done
A contiguous byte buffer used as the unit of interprocess communication.
Manages the interprocess communication channels and wraps send and receive calls.
value_t receive_from_worker_on_master(bool *more=nullptr)
Fork processes for queue and workers.
Keeps a queue of tasks for workers and manages the queue process through its event loop.
void loop()
The queue process's event loop.
Thrown when a blocking wait on a Channel is interrupted, e.g.
void worker_loop()
The worker processes' event loop.
bool is_worker_loop_running()
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
static QueueType getQueueType()