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  public:
36 
38  enum Type {
44  };
45 
46  Type getType();
47 
48  std::string getTypeAsString();
49 
50  std::string getName();
51 
52  double getSubmitDate();
53 
54  /***********************/
56  /***********************/
57 
58  std::string popCallbackMailbox();
59 
60  void pushCallbackMailbox(std::string);
61 
62  std::string getCallbackMailbox();
63 
64  std::string getOriginCallbackMailbox();
65 
66  void setParentComputeService(std::shared_ptr<ComputeService> compute_service);
67 
68  std::shared_ptr<ComputeService> getParentComputeService();
69 
70  std::map<std::string, std::string> getServiceSpecificArguments();
71 
72  virtual unsigned long getPriority();
73 
74  virtual ~WorkflowJob();
75 
76  protected:
77 
78  friend class JobManager;
79 
81 
82  unsigned long getNewUniqueNumber();
83 
85  std::map<std::string, std::string> service_specific_args;
86 
88  std::stack<std::string> callback_mailbox_stack;
94  std::string name;
96  double submit_date;
98  std::shared_ptr<ComputeService> parent_compute_service;
99 
100 
101  private:
102 // bool forward_notification_to_original_source;
103 
104  /***********************/
106  /***********************/
107  };
108 
109  /***********************/
111  /***********************/
112 
113 };
114 
115 
116 #endif //WRENCH_WORKFLOWJOB_H
std::map< std::string, std::string > service_specific_args
Service-specific arguments used during job submission.
Definition: WorkflowJob.h:85
std::string popCallbackMailbox()
Get the "next" callback mailbox (returns the workflow mailbox if the mailbox stack is empty),...
Definition: WorkflowJob.cpp:108
std::string getTypeAsString()
Get the job type name.
Definition: WorkflowJob.cpp:54
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:88
Type type
The job's type.
Definition: WorkflowJob.h:92
WorkflowJob(Type type)
Constructor.
Definition: WorkflowJob.cpp:33
std::string name
The job's name.
Definition: WorkflowJob.h:94
std::shared_ptr< ComputeService > getParentComputeService()
Get the parent compute service of the job.
Definition: WorkflowJob.cpp:149
std::shared_ptr< ComputeService > parent_compute_service
The compute service to which the job was submitted.
Definition: WorkflowJob.h:98
double getSubmitDate()
Get the date at which the job was last submitted (<0 means "never submitted")
Definition: WorkflowJob.cpp:157
std::string getCallbackMailbox()
Get the "next" callback mailbox (returns the origin (i.e., workflow) mailbox if the mailbox stack is ...
Definition: WorkflowJob.cpp:84
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:122
std::map< std::string, std::string > getServiceSpecificArguments()
Return the service-specific arguments that were used during job submission.
Definition: WorkflowJob.cpp:165
Workflow * workflow
The workflow this job belong to.
Definition: WorkflowJob.h:90
unsigned long getNewUniqueNumber()
Generate a unique number (for each newly generated job)
Definition: WorkflowJob.cpp:131
double submit_date
The date at which the job was last submitted.
Definition: WorkflowJob.h:96
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:140
std::string getOriginCallbackMailbox()
Get the "origin" callback mailbox.
Definition: WorkflowJob.cpp:96
Type
Job types.
Definition: WorkflowJob.h:38
Type getType()
Get the job type.
Definition: WorkflowJob.cpp:44
@ STANDARD
A standard job that can be submitted directly to a ComputeService for execution.
Definition: WorkflowJob.h:40
virtual unsigned long getPriority()
Return default job priority as zero.
Definition: WorkflowJob.cpp:173
virtual ~WorkflowJob()
Destructor.
Definition: WorkflowJob.cpp:25
std::string getName()
Get the job's name.
Definition: WorkflowJob.cpp:74
@ PILOT
A pilot job that can be submitted to a ComputeService and that, once started, will act as a ComputeSe...
Definition: WorkflowJob.h:43