WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
ExecutionController.h
1 
10 #ifndef WRENCH_EXECUTIONCONTROLLER_H
11 #define WRENCH_EXECUTIONCONTROLLER_H
12 
13 #include "wrench/services/metering/EnergyMeterService.h"
14 #include "wrench/services/metering/BandwidthMeterService.h"
15 #include "wrench/services/Service.h"
16 #include "wrench/managers/DataMovementManager.h"
17 #include "wrench/services/compute/cloud/CloudComputeService.h"
18 #include "wrench/execution_events/CompoundJobFailedEvent.h"
19 #include "wrench/execution_events/CompoundJobCompletedEvent.h"
20 #include "wrench/execution_events/StandardJobCompletedEvent.h"
21 #include "wrench/execution_events/StandardJobFailedEvent.h"
22 #include "wrench/execution_events/PilotJobStartedEvent.h"
23 #include "wrench/execution_events/PilotJobExpiredEvent.h"
24 #include "wrench/execution_events/FileCopyCompletedEvent.h"
25 #include "wrench/execution_events/FileCopyFailedEvent.h"
26 #include "wrench/execution_events/TimerEvent.h"
27 #include "wrench/workflow/Workflow.h"
28 
29 namespace wrench {
30 
31  class Simulation;
32 
37  class ExecutionController : public Service {
38 
39  /***********************/
41  /***********************/
42 
43  public:
44  virtual std::shared_ptr<JobManager> createJobManager();
45  virtual std::shared_ptr<DataMovementManager> createDataMovementManager();
46  std::shared_ptr<EnergyMeterService> createEnergyMeter(const std::map<std::string, double> &measurement_periods);
47  std::shared_ptr<EnergyMeterService> createEnergyMeter(const std::vector<std::string> &hostnames, double measurement_period);
48  std::shared_ptr<BandwidthMeterService> createBandwidthMeter(const std::map<std::string, double> &measurement_periods);
49  std::shared_ptr<BandwidthMeterService> createBandwidthMeter(const std::vector<std::string> &linknames, double measurement_period);
50 
51 
52  std::shared_ptr<ExecutionEvent> waitForNextEvent();
53  std::shared_ptr<ExecutionEvent> waitForNextEvent(double timeout);
54 
56  bool waitForAndProcessNextEvent(double timeout);
57 
58  virtual void processEventCompoundJobFailure(std::shared_ptr<CompoundJobFailedEvent>);
59  virtual void processEventCompoundJobCompletion(std::shared_ptr<CompoundJobCompletedEvent>);
60 
61  virtual void processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent>);
62  virtual void processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent>);
63 
64 
65  virtual void processEventPilotJobStart(std::shared_ptr<PilotJobStartedEvent>);
66  virtual void processEventPilotJobExpiration(std::shared_ptr<PilotJobExpiredEvent>);
67 
68  virtual void processEventFileCopyCompletion(std::shared_ptr<FileCopyCompletedEvent>);
69  virtual void processEventFileCopyFailure(std::shared_ptr<FileCopyFailedEvent>);
70 
71  virtual void processEventTimer(std::shared_ptr<TimerEvent>);
72 
73  protected:
74 
76  const std::string &hostname,
77  const std::string suffix);
78 
79 
80  void setTimer(double date, std::string message);
81 
82  /***********************/
84  /***********************/
85 
86  /***********************/
88  /***********************/
89 
90  private:
91  friend class Simulation;
92  friend class DataMovementManager;
93  friend class JobManager;
94 
95  /***********************/
97  /***********************/
98 
99  private:
100  virtual int main() = 0;
101 
102  };
103 
104 };
105 
106 
107 #endif //WRENCH_EXECUTIONCONTROLLER_H
wrench::ExecutionController::createDataMovementManager
virtual std::shared_ptr< DataMovementManager > createDataMovementManager()
Instantiate and start a data movement manager.
Definition: ExecutionController.cpp:57
wrench::ExecutionController::createEnergyMeter
std::shared_ptr< EnergyMeterService > createEnergyMeter(const std::map< std::string, double > &measurement_periods)
Instantiate and start an energy meter.
Definition: ExecutionController.cpp:73
wrench::ExecutionController::processEventPilotJobStart
virtual void processEventPilotJobStart(std::shared_ptr< PilotJobStartedEvent >)
Process a pilot job start event.
Definition: ExecutionController.cpp:226
wrench::ExecutionController::processEventCompoundJobFailure
virtual void processEventCompoundJobFailure(std::shared_ptr< CompoundJobFailedEvent >)
Process a standard job failure event.
Definition: ExecutionController.cpp:280
wrench::ExecutionController
An abstraction of an execution controller, i.e., a running process that interacts with other services...
Definition: ExecutionController.h:37
wrench::ExecutionController::createJobManager
virtual std::shared_ptr< JobManager > createJobManager()
Instantiate and start a job manager.
Definition: ExecutionController.cpp:44
wrench::JobManager
A helper daemon (co-located with and explicitly started by an execution controller),...
Definition: JobManager.h:56
wrench::ExecutionController::processEventFileCopyCompletion
virtual void processEventFileCopyCompletion(std::shared_ptr< FileCopyCompletedEvent >)
Process a file copy completion event.
Definition: ExecutionController.cpp:244
wrench::ExecutionController::ExecutionController
ExecutionController(const std::string &hostname, const std::string suffix)
Constructor.
Definition: ExecutionController.cpp:33
wrench::ExecutionController::waitForNextEvent
std::shared_ptr< ExecutionEvent > waitForNextEvent()
Wait for an execution event.
Definition: ExecutionController.cpp:152
wrench
Definition: Action.cpp:28
wrench::DataMovementManager
A helper daemon (co-located with an execution controler) that handles data movement operations.
Definition: DataMovementManager.h:35
wrench::ExecutionController::setTimer
void setTimer(double date, std::string message)
Sets a timer (which, when it goes off, will generate a TimerEvent)
Definition: ExecutionController.cpp:134
wrench::ExecutionController::processEventPilotJobExpiration
virtual void processEventPilotJobExpiration(std::shared_ptr< PilotJobExpiredEvent >)
Process a pilot job expiration event.
Definition: ExecutionController.cpp:235
wrench::ExecutionController::createBandwidthMeter
std::shared_ptr< BandwidthMeterService > createBandwidthMeter(const std::map< std::string, double > &measurement_periods)
Instantiate and start a bandwidth meter.
Definition: ExecutionController.cpp:103
wrench::ExecutionController::processEventTimer
virtual void processEventTimer(std::shared_ptr< TimerEvent >)
Process a timer event.
Definition: ExecutionController.cpp:262
wrench::S4U_Daemon::hostname
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:60
wrench::ExecutionController::processEventStandardJobFailure
virtual void processEventStandardJobFailure(std::shared_ptr< StandardJobFailedEvent >)
Process a standard job failure event.
Definition: ExecutionController.cpp:217
wrench::Simulation
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:48
wrench::ExecutionController::processEventCompoundJobCompletion
virtual void processEventCompoundJobCompletion(std::shared_ptr< CompoundJobCompletedEvent >)
Process a standard job completion event.
Definition: ExecutionController.cpp:271
wrench::Service
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:31
wrench::ExecutionController::waitForAndProcessNextEvent
void waitForAndProcessNextEvent()
Wait for an execution event and then call the associated function to process that event.
Definition: ExecutionController.cpp:159
wrench::ExecutionController::processEventStandardJobCompletion
virtual void processEventStandardJobCompletion(std::shared_ptr< StandardJobCompletedEvent >)
Process a standard job completion event.
Definition: ExecutionController.cpp:207
wrench::ExecutionController::processEventFileCopyFailure
virtual void processEventFileCopyFailure(std::shared_ptr< FileCopyFailedEvent >)
Process a file copy failure event.
Definition: ExecutionController.cpp:253