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 
18 namespace wrench {
19 
20 
21  class Workflow;
22  class ComputeService;
23 
24  /***********************/
26  /***********************/
27 
31  class WorkflowJob {
32  public:
33 
35  enum Type {
41  };
42 
43  Type getType();
44 
45  std::string getTypeAsString();
46 
47  std::string getName();
48 
49  double getSubmitDate();
50 
51  /***********************/
53  /***********************/
54 
55  std::string popCallbackMailbox();
56 
57  void pushCallbackMailbox(std::string);
58 
59  std::string getCallbackMailbox();
60 
61  std::string getOriginCallbackMailbox();
62 
63  void setParentComputeService(ComputeService *compute_service);
64 
66 
67  std::map<std::string, std::string> getServiceSpecificArguments();
68 
69  virtual ~WorkflowJob();
70 
71  protected:
72 
73  friend class JobManager;
74 
76 
77  unsigned long getNewUniqueNumber();
78 
80  std::map<std::string, std::string> service_specific_args;
81 
83  std::stack<std::string> callback_mailbox_stack;
89  std::string name;
91  double submit_date;
94 
95  private:
96  bool forward_notification_to_original_source;
97 
98  /***********************/
100  /***********************/
101  };
102 
103  /***********************/
105  /***********************/
106 
107 };
108 
109 
110 #endif //WRENCH_WORKFLOWJOB_H
std::map< std::string, std::string > getServiceSpecificArguments()
Return the service-specific arguments that were used during job submission.
Definition: WorkflowJob.cpp:165
A pilot job that can be submitted to a ComputeService and that, once started, will act as a ComputeSe...
Definition: WorkflowJob.h:40
virtual ~WorkflowJob()
Destructor.
Definition: WorkflowJob.cpp:25
ComputeService * getParentComputeService()
Get the parent compute service of the job.
Definition: WorkflowJob.cpp:149
std::stack< std::string > callback_mailbox_stack
Stack of callback mailboxes (to pop notifications)
Definition: WorkflowJob.h:83
unsigned long getNewUniqueNumber()
Generate a unique number (for each newly generated job)
Definition: WorkflowJob.cpp:131
std::string popCallbackMailbox()
Get the "next" callback mailbox (returns the workflow mailbox if the mailbox stack is empty)...
Definition: WorkflowJob.cpp:108
std::string name
The job&#39;s name.
Definition: WorkflowJob.h:89
ComputeService * parent_compute_service
The compute service to which the job was submitted.
Definition: WorkflowJob.h:93
std::string getOriginCallbackMailbox()
Get the "origin" callback mailbox.
Definition: WorkflowJob.cpp:96
std::map< std::string, std::string > service_specific_args
Service-specific arguments used during job submission.
Definition: WorkflowJob.h:80
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:31
A workflow (to be executed by a WMS)
Definition: Workflow.h:30
A standard job that can be submitted directly to a ComputeService for execution.
Definition: WorkflowJob.h:37
std::string getCallbackMailbox()
Get the "next" callback mailbox (returns the origin (i.e., workflow) mailbox if the mailbox stack is ...
Definition: WorkflowJob.cpp:84
Type getType()
Get the job type.
Definition: WorkflowJob.cpp:44
Workflow * workflow
The workflow this job belong to.
Definition: WorkflowJob.h:85
std::string getName()
Get the job&#39;s name.
Definition: WorkflowJob.cpp:74
double submit_date
The date at which the job was last submitted.
Definition: WorkflowJob.h:91
The compute service base class.
Definition: ComputeService.h:35
std::string getTypeAsString()
Get the job type name.
Definition: WorkflowJob.cpp:54
void pushCallbackMailbox(std::string)
Pushes a callback mailbox.
Definition: WorkflowJob.cpp:122
Type
Job types.
Definition: WorkflowJob.h:35
WorkflowJob(Type type)
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
double getSubmitDate()
Get the date at which the job was last submitted (<0 means "never submitted")
Definition: WorkflowJob.cpp:157
Type type
The job&#39;s type.
Definition: WorkflowJob.h:87
void setParentComputeService(ComputeService *compute_service)
Set the parent compute service of the job.
Definition: WorkflowJob.cpp:140
Definition: TerminalOutput.cpp:15