Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Job.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * PB, Patrick Bos, Netherlands eScience Center, p.bos@esciencecenter.nl
5 * IP, Inti Pelupessy, Netherlands eScience Center, i.pelupessy@esciencecenter.nl
6 *
7 * Copyright (c) 2021, CERN
8 *
9 * Redistribution and use in source and binary forms,
10 * with or without modification, are permitted according to the terms
11 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
12 */
13#ifndef ROOT_ROOFIT_MultiProcess_Job_decl
14#define ROOT_ROOFIT_MultiProcess_Job_decl
15
17
18#include <string>
19
20namespace RooFit {
21namespace MultiProcess {
22
23// forward declaration
24class JobManager;
25
26class Job {
27public:
28 explicit Job();
29 Job(const Job &other);
30
31 ~Job();
32
33 virtual void evaluate_task(std::size_t task) = 0;
34 virtual void update_state();
35
36 virtual void send_back_task_result_from_worker(std::size_t task) = 0;
37 virtual bool receive_task_result_on_master(const Message &message) = 0;
38
40
41 std::size_t get_state_id();
42
43protected:
45
46 std::size_t id_;
47 std::size_t state_id_ = 0;
48
49private:
50 // do not use _manager directly, it must first be initialized! use get_manager()
51 JobManager *_manager = nullptr;
52};
53
54} // namespace MultiProcess
55} // namespace RooFit
56
57#endif // ROOT_ROOFIT_MultiProcess_Job_decl
Main point of access for all MultiProcess infrastructure.
Definition JobManager.h:30
interface class for defining the actual work that must be done
Definition Job.h:26
std::size_t get_state_id()
Get the current state identifier.
Definition Job.cxx:141
std::size_t id_
Definition Job.h:46
virtual bool receive_task_result_on_master(const Message &message)=0
virtual void send_back_task_result_from_worker(std::size_t task)=0
std::size_t state_id_
Definition Job.h:47
virtual void update_state()
Virtual function to update any necessary state on workers.
Definition Job.cxx:138
JobManager * _manager
Definition Job.h:51
JobManager * get_manager()
Get JobManager instance; create and activate if necessary.
Definition Job.cxx:112
virtual void evaluate_task(std::size_t task)=0
void gather_worker_results()
Wait for all tasks to be retrieved for the current Job.
Definition Job.cxx:126
A contiguous byte buffer used as the unit of interprocess communication.
Definition Message.h:30
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition CodegenImpl.h:73