WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
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  double getEndDate();
55 
56  /***********************/
58  /***********************/
59 
60  std::string popCallbackMailbox();
61 
62  void pushCallbackMailbox(std::string);
63 
64  std::string getCallbackMailbox();
65 
66  std::string getOriginCallbackMailbox();
67 
68  void setParentComputeService(std::shared_ptr<ComputeService> compute_service);
69 
70  std::shared_ptr<ComputeService> getParentComputeService();
71 
72  std::map<std::string, std::string> getServiceSpecificArguments();
73 
74  virtual unsigned long getPriority();
75 
76  virtual ~WorkflowJob();
77 
78  protected:
79 
80  friend class JobManager;
81 
82  WorkflowJob();
83 
84  unsigned long getNewUniqueNumber();
85 
87  std::map<std::string, std::string> service_specific_args;
88 
90  std::stack<std::string> callback_mailbox_stack;
94  std::string name;
96  double submit_date;
98  double end_date;
100  std::shared_ptr<ComputeService> parent_compute_service;
101 
102 
103  private:
104 // bool forward_notification_to_original_source;
105 
106  /***********************/
108  /***********************/
109  };
110 
111  /***********************/
113  /***********************/
114 
115 };
116 
117 
118 #endif //WRENCH_WORKFLOWJOB_H
wrench::WorkflowJob::service_specific_args
std::map< std::string, std::string > service_specific_args
Service-specific arguments used during job submission.
Definition: WorkflowJob.h:87
wrench::WorkflowJob::popCallbackMailbox
std::string popCallbackMailbox()
Get the "next" callback mailbox (returns the workflow mailbox if the mailbox stack is empty),...
Definition: WorkflowJob.cpp:78
wrench::WorkflowJob::WorkflowJob
WorkflowJob()
Constructor.
Definition: WorkflowJob.cpp:33
wrench::JobManager
A helper daemon (co-located with and explicitly started by a WMS), which is used to handle all job ex...
Definition: JobManager.h:48
wrench::WorkflowJob::callback_mailbox_stack
std::stack< std::string > callback_mailbox_stack
Stack of callback mailboxes (to pop notifications)
Definition: WorkflowJob.h:90
wrench::WorkflowJob::getEndDate
double getEndDate()
Get the date at which the job ended (<0 means "never submitted")
Definition: WorkflowJob.cpp:135
wrench::WorkflowJob::name
std::string name
The job's name.
Definition: WorkflowJob.h:94
wrench::WorkflowJob::getParentComputeService
std::shared_ptr< ComputeService > getParentComputeService()
Get the parent compute service of the job.
Definition: WorkflowJob.cpp:119
wrench::WorkflowJob::parent_compute_service
std::shared_ptr< ComputeService > parent_compute_service
The compute service to which the job was submitted.
Definition: WorkflowJob.h:100
wrench::WorkflowJob::getSubmitDate
double getSubmitDate()
Get the date at which the job was last submitted (<0 means "never submitted")
Definition: WorkflowJob.cpp:127
wrench::WorkflowJob::getCallbackMailbox
std::string getCallbackMailbox()
Get the "next" callback mailbox (returns the origin (i.e., workflow) mailbox if the mailbox stack is ...
Definition: WorkflowJob.cpp:54
wrench
Definition: Alarm.cpp:20
wrench::Workflow
A workflow (to be executed by a WMS)
Definition: Workflow.h:34
wrench::WorkflowJob::pushCallbackMailbox
void pushCallbackMailbox(std::string)
Pushes a callback mailbox.
Definition: WorkflowJob.cpp:92
wrench::WorkflowJob::getServiceSpecificArguments
std::map< std::string, std::string > getServiceSpecificArguments()
Return the service-specific arguments that were used during job submission.
Definition: WorkflowJob.cpp:143
wrench::WorkflowJob::workflow
Workflow * workflow
The workflow this job belong to.
Definition: WorkflowJob.h:92
wrench::WorkflowJob::getNewUniqueNumber
unsigned long getNewUniqueNumber()
Generate a unique number (for each newly generated job)
Definition: WorkflowJob.cpp:101
wrench::WorkflowJob::submit_date
double submit_date
The date at which the job was last submitted.
Definition: WorkflowJob.h:96
wrench::WorkflowJob
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
wrench::WorkflowJob::setParentComputeService
void setParentComputeService(std::shared_ptr< ComputeService > compute_service)
Set the parent compute service of the job.
Definition: WorkflowJob.cpp:110
wrench::WorkflowJob::getOriginCallbackMailbox
std::string getOriginCallbackMailbox()
Get the "origin" callback mailbox.
Definition: WorkflowJob.cpp:66
wrench::WorkflowJob::getPriority
virtual unsigned long getPriority()
Return default job priority as zero.
Definition: WorkflowJob.cpp:151
wrench::WorkflowJob::~WorkflowJob
virtual ~WorkflowJob()
Destructor.
Definition: WorkflowJob.cpp:25
wrench::WorkflowJob::getName
std::string getName()
Get the job's name.
Definition: WorkflowJob.cpp:44
wrench::WorkflowJob::end_date
double end_date
The date at which the job ended (with success or failure)
Definition: WorkflowJob.h:98