WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Job.h
1 
10 #ifndef WRENCH_JOB_H
11 #define WRENCH_JOB_H
12 
13 
14 #include <string>
15 #include <stack>
16 #include <map>
17 #include <memory>
18 
19 #include "wrench/managers/JobManager.h"
20 
21 namespace wrench {
22 
23 
24  class Workflow;
25  class ComputeService;
26 
27  /***********************/
29  /***********************/
30 
34  class Job {
35 
36  public:
37 
38  std::string getName();
39 
40  double getSubmitDate();
41  double getEndDate();
42 
43  /***********************/
45  /***********************/
46 
47  simgrid::s4u::Mailbox *popCallbackMailbox();
48 
50 
51  void pushCallbackMailbox(simgrid::s4u::Mailbox *mailbox);
52 
53  simgrid::s4u::Mailbox *getCallbackMailbox();
54 
55  simgrid::s4u::Mailbox *getOriginCallbackMailbox();
56 
57  void setParentComputeService(std::shared_ptr<ComputeService> compute_service);
58 
59  std::shared_ptr<ComputeService> getParentComputeService();
60 
61 
62  virtual ~Job();
63 
64  virtual void setPriority(double priority);
65 
66  double getPriority() const;
67 
68  std::map<std::string, std::string> &getServiceSpecificArguments();
69 
70  protected:
71 
72  friend class JobManager;
73 
74  Job(std::string name, std::shared_ptr<JobManager> job_manager);
75 
76  void setServiceSpecificArguments(std::map<std::string, std::string> args);
77 
78  unsigned long getNewUniqueNumber();
79 
81  std::map<std::string, std::string> service_specific_args;
82 
84  std::stack<simgrid::s4u::Mailbox *> callback_mailbox_stack;
86  std::shared_ptr<JobManager> job_manager;
88  simgrid::s4u::Mailbox *originator_mailbox;
89 
90 // /** @brief The workflow this job belong to */
91 // Workflow *workflow;
93  std::string name;
95  double submit_date;
97  double end_date;
99  std::shared_ptr<ComputeService> parent_compute_service;
100 
103 
105  double priority = 0.0;
106 
107  private:
108 // bool forward_notification_to_original_source;
109 
110 
111  /***********************/
113  /***********************/
114  };
115 
116  /***********************/
118  /***********************/
119 
120 };
121 
122 
123 #endif //WRENCH_JOB_H
wrench::Job::originator_mailbox
simgrid::s4u::Mailbox * originator_mailbox
The originator's mailbox.
Definition: Job.h:88
wrench::Job::getOriginCallbackMailbox
simgrid::s4u::Mailbox * getOriginCallbackMailbox()
Get the "origin" callback mailbox.
Definition: Job.cpp:64
wrench::Job::getServiceSpecificArguments
std::map< std::string, std::string > & getServiceSpecificArguments()
Return the service-specific arguments that are used during job submission.
Definition: Job.cpp:164
wrench::Job::~Job
virtual ~Job()
Destructor.
Definition: Job.cpp:26
wrench::Job
Abstraction of a job used for executing tasks in a Workflow.
Definition: Job.h:34
wrench::Job::getCallbackMailbox
simgrid::s4u::Mailbox * getCallbackMailbox()
Get the job's "next" callback mailbox, without popping it.
Definition: Job.cpp:101
wrench::JobManager
A helper daemon (co-located with and explicitly started by an execution controller),...
Definition: JobManager.h:56
wrench::Job::already_submitted_to_job_manager
bool already_submitted_to_job_manager
Whether the job has already been submitted to the job manager.
Definition: Job.h:102
wrench::Job::printCallbackMailboxStack
void printCallbackMailboxStack()
Method to print the call back stack.
Definition: Job.cpp:72
wrench::Job::popCallbackMailbox
simgrid::s4u::Mailbox * popCallbackMailbox()
Get the "next" callback mailbox (returns the workflow mailbox if the mailbox stack is empty),...
Definition: Job.cpp:88
wrench::Job::setPriority
virtual void setPriority(double priority)
Set the job's priority (the higher the priority value, the higher the priority)
Definition: Job.cpp:188
wrench::Job::parent_compute_service
std::shared_ptr< ComputeService > parent_compute_service
The compute service to which the job was submitted.
Definition: Job.h:99
wrench::Job::Job
Job(std::string name, std::shared_ptr< JobManager > job_manager)
Constructor.
Definition: Job.cpp:35
wrench::Job::end_date
double end_date
The date at which the job ended (with success or failure)
Definition: Job.h:97
wrench
Definition: Action.cpp:28
wrench::Job::name
std::string name
The job's name.
Definition: Job.h:93
wrench::Job::pushCallbackMailbox
void pushCallbackMailbox(simgrid::s4u::Mailbox *mailbox)
Pushes a callback mailbox.
Definition: Job.cpp:113
wrench::Job::job_manager
std::shared_ptr< JobManager > job_manager
The Job Manager in charge of this job.
Definition: Job.h:86
wrench::Job::getPriority
double getPriority() const
Get the job's priority (the higher the priority value, the higher the priority)
Definition: Job.cpp:180
wrench::Job::getName
std::string getName()
Get the job's name.
Definition: Job.cpp:55
wrench::Job::priority
double priority
The job's priority (the higher the number, the higher the priority)
Definition: Job.h:105
wrench::Job::getEndDate
double getEndDate()
Get the date at which the job ended (<0 means "never submitted")
Definition: Job.cpp:156
wrench::Job::getNewUniqueNumber
unsigned long getNewUniqueNumber()
Generate a unique number (for each newly generated job)
Definition: Job.cpp:122
wrench::Job::callback_mailbox_stack
std::stack< simgrid::s4u::Mailbox * > callback_mailbox_stack
Stack of callback mailboxes (to pop notifications)
Definition: Job.h:84
wrench::Job::setParentComputeService
void setParentComputeService(std::shared_ptr< ComputeService > compute_service)
Set the parent compute service of the job.
Definition: Job.cpp:131
wrench::Job::service_specific_args
std::map< std::string, std::string > service_specific_args
Service-specific arguments used during job submission.
Definition: Job.h:81
wrench::Job::getSubmitDate
double getSubmitDate()
Get the date at which the job was last submitted (<0 means "never submitted")
Definition: Job.cpp:148
wrench::Job::submit_date
double submit_date
The date at which the job was last submitted.
Definition: Job.h:95
wrench::Job::setServiceSpecificArguments
void setServiceSpecificArguments(std::map< std::string, std::string > args)
Sets the service-specific arguments that are used during job submission.
Definition: Job.cpp:172
wrench::Job::getParentComputeService
std::shared_ptr< ComputeService > getParentComputeService()
Get the compute service that is running /ran the job.
Definition: Job.cpp:140