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 
49  void printCallbackMailboxStack();
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 
102  bool already_submitted_to_job_manager = false;
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
Abstraction of a job used for executing tasks in a Workflow.
Definition: Job.h:34
wrench::JobManager
A helper daemon (co-located with and explicitly started by an execution controller),...
Definition: JobManager.h:56
wrench
Definition: Action.cpp:28
wrench::Job::getName
std::string getName()
Get the job's name.
Definition: Job.cpp:55
wrench::Job::getEndDate
double getEndDate()
Get the date at which the job ended (<0 means "never submitted")
Definition: Job.cpp:156
wrench::Job::getSubmitDate
double getSubmitDate()
Get the date at which the job was last submitted (<0 means "never submitted")
Definition: Job.cpp:148