WorkflowJob.h
1 
10 #ifndef WRENCH_WORKFLOWJOB_H
11 #define WRENCH_WORKFLOWJOB_H
12 
13 
14 #include <string>
15 #include <stack>
16 #include <map>
17 #include <memory>
18 
19 //#include "wrench/services/compute/ComputeService.h"
20 
21 namespace wrench {
22 
23 
24  class Workflow;
25  class ComputeService;
26 
27  /***********************/
29  /***********************/
30 
34  class WorkflowJob {
35 
36  public:
37 
38 // /** @brief Job types */
39 // enum Type {
40 // /** @brief A standard job that can be submitted directly to a ComputeService for execution */
41 // STANDARD,
42 // /** @brief A pilot job that can be submitted to a ComputeService and that, once started, will act as a ComputeService
43 // * (likely a bare_metal) with an expiration date */
44 // PILOT
45 // };
46 
47 // Type getType();
48 
49 // std::string getTypeAsString();
50 
51  std::string getName();
52 
53  double getSubmitDate();
54 
55  /***********************/
57  /***********************/
58 
59  std::string popCallbackMailbox();
60 
61  void pushCallbackMailbox(std::string);
62 
63  std::string getCallbackMailbox();
64 
65  std::string getOriginCallbackMailbox();
66 
67  void setParentComputeService(std::shared_ptr<ComputeService> compute_service);
68 
69  std::shared_ptr<ComputeService> getParentComputeService();
70 
71  std::map<std::string, std::string> getServiceSpecificArguments();
72 
73  virtual unsigned long getPriority();
74 
75  virtual ~WorkflowJob();
76 
77  protected:
78 
79  friend class JobManager;
80 
81  WorkflowJob();
82 
83  unsigned long getNewUniqueNumber();
84 
86  std::map<std::string, std::string> service_specific_args;
87 
89  std::stack<std::string> callback_mailbox_stack;
93  std::string name;
95  double submit_date;
97  std::shared_ptr<ComputeService> parent_compute_service;
98 
99 
100  private:
101 // bool forward_notification_to_original_source;
102 
103  /***********************/
105  /***********************/
106  };
107 
108  /***********************/
110  /***********************/
111 
112 };
113 
114 
115 #endif //WRENCH_WORKFLOWJOB_H
std::map< std::string, std::string > service_specific_args
Service-specific arguments used during job submission.
Definition: WorkflowJob.h:86
std::string popCallbackMailbox()
Get the "next" callback mailbox (returns the workflow mailbox if the mailbox stack is empty),...
Definition: WorkflowJob.cpp:77
WorkflowJob()
Constructor.
Definition: WorkflowJob.cpp:33
A helper daemon (co-located with and explicitly started by a WMS), which is used to handle all job ex...
Definition: JobManager.h:40
std::stack< std::string > callback_mailbox_stack
Stack of callback mailboxes (to pop notifications)
Definition: WorkflowJob.h:89
std::string name
The job's name.
Definition: WorkflowJob.h:93
std::shared_ptr< ComputeService > getParentComputeService()
Get the parent compute service of the job.
Definition: WorkflowJob.cpp:118
std::shared_ptr< ComputeService > parent_compute_service
The compute service to which the job was submitted.
Definition: WorkflowJob.h:97
double getSubmitDate()
Get the date at which the job was last submitted (<0 means "never submitted")
Definition: WorkflowJob.cpp:126
std::string getCallbackMailbox()
Get the "next" callback mailbox (returns the origin (i.e., workflow) mailbox if the mailbox stack is ...
Definition: WorkflowJob.cpp:53
Definition: Alarm.cpp:20
A workflow (to be executed by a WMS)
Definition: Workflow.h:34
void pushCallbackMailbox(std::string)
Pushes a callback mailbox.
Definition: WorkflowJob.cpp:91
std::map< std::string, std::string > getServiceSpecificArguments()
Return the service-specific arguments that were used during job submission.
Definition: WorkflowJob.cpp:134
Workflow * workflow
The workflow this job belong to.
Definition: WorkflowJob.h:91
unsigned long getNewUniqueNumber()
Generate a unique number (for each newly generated job)
Definition: WorkflowJob.cpp:100
double submit_date
The date at which the job was last submitted.
Definition: WorkflowJob.h:95
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
void setParentComputeService(std::shared_ptr< ComputeService > compute_service)
Set the parent compute service of the job.
Definition: WorkflowJob.cpp:109
std::string getOriginCallbackMailbox()
Get the "origin" callback mailbox.
Definition: WorkflowJob.cpp:65
virtual unsigned long getPriority()
Return default job priority as zero.
Definition: WorkflowJob.cpp:142
virtual ~WorkflowJob()
Destructor.
Definition: WorkflowJob.cpp:25
std::string getName()
Get the job's name.
Definition: WorkflowJob.cpp:43