13 #include <wrench/managers/EnergyMeter.h> 14 #include "wrench/services/Service.h" 15 #include "wrench/wms/DynamicOptimization.h" 16 #include "wrench/wms/StaticOptimization.h" 17 #include "wrench/wms/scheduler/PilotJobScheduler.h" 18 #include "wrench/wms/scheduler/StandardJobScheduler.h" 19 #include "wrench/services/compute/cloud/CloudComputeService.h" 20 #include "wrench/workflow/Workflow.h" 26 class CloudComputeService;
27 class VirtualizedClusterComputeService;
29 class NetworkProximityService;
30 class FileRegistryService;
54 WMS(std::unique_ptr<StandardJobScheduler> standard_job_scheduler,
55 std::unique_ptr<PilotJobScheduler> pilot_job_scheduler,
56 const std::set<std::shared_ptr<ComputeService>> &compute_services,
57 const std::set<std::shared_ptr<StorageService>> &storage_services,
58 const std::set<std::shared_ptr<NetworkProximityService>> &network_proximity_services,
59 std::shared_ptr<FileRegistryService> file_registry_service,
60 const std::string &hostname,
61 const std::string suffix);
64 void checkDeferredStart();
66 void setTimer(
double date, std::string message);
68 std::shared_ptr<JobManager> createJobManager();
69 std::shared_ptr<DataMovementManager> createDataMovementManager();
70 std::shared_ptr<EnergyMeter> createEnergyMeter(
const std::map<std::string, double> &measurement_periods);
71 std::shared_ptr<EnergyMeter> createEnergyMeter(
const std::vector<std::string> &hostnames,
double measurement_period);
73 void runDynamicOptimizations();
75 void runStaticOptimizations();
83 std::set<std::shared_ptr<T>> getAvailableComputeServices() {
84 bool is_cloud = (std::type_index(
typeid(T)) == std::type_index(
typeid(
CloudComputeService)));
85 std::set<std::shared_ptr<T>> to_return;
86 for (
auto const &h : this->compute_services) {
88 auto shared_ptr = std::dynamic_pointer_cast<T>(h);
90 to_return.insert(shared_ptr);
93 auto shared_ptr_cloud = std::dynamic_pointer_cast<T>(h);
95 if (shared_ptr_cloud and (not shared_ptr_vc)) {
96 to_return.insert(shared_ptr_cloud);
125 std::set<std::shared_ptr<StorageService>> getAvailableStorageServices();
126 std::set<std::shared_ptr<NetworkProximityService>> getAvailableNetworkProximityServices();
127 std::shared_ptr<FileRegistryService> getAvailableFileRegistryService();
129 void waitForAndProcessNextEvent();
130 bool waitForAndProcessNextEvent(
double timeout);
132 virtual void processEventStandardJobCompletion(std::shared_ptr<StandardJobCompletedEvent>);
134 virtual void processEventStandardJobFailure(std::shared_ptr<StandardJobFailedEvent>);
136 virtual void processEventPilotJobStart(std::shared_ptr<PilotJobStartedEvent>);
138 virtual void processEventPilotJobExpiration(std::shared_ptr<PilotJobExpiredEvent>);
140 virtual void processEventFileCopyCompletion(std::shared_ptr<FileCopyCompletedEvent>);
142 virtual void processEventFileCopyFailure(std::shared_ptr<FileCopyFailedEvent>);
144 virtual void processEventTimer(std::shared_ptr<TimerEvent>);
156 friend class DataMovementManager;
157 friend class JobManager;
164 std::set<std::shared_ptr<ComputeService>> compute_services;
166 std::set<std::shared_ptr<StorageService>> storage_services;
168 std::set<std::shared_ptr<NetworkProximityService>> network_proximity_services;
170 std::shared_ptr<FileRegistryService> file_registry_service;
173 std::shared_ptr<StandardJobScheduler> standard_job_scheduler;
175 std::shared_ptr<PilotJobScheduler> pilot_job_scheduler;
178 std::vector<std::unique_ptr<DynamicOptimization>> dynamic_optimizations;
180 std::vector<std::unique_ptr<StaticOptimization>> static_optimizations;
187 virtual int main() = 0;
194 #endif //WRENCH_WMS_H PilotJobScheduler * getPilotJobScheduler()
Get the WMS's pilot scheduler.
Definition: WMS.cpp:381
A (mostly virtual) base class for implementing PilotJob scheduling algorithms to be used by a WMS...
Definition: PilotJobScheduler.h:26
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:26
A cloud-based compute service that manages a set of physical hosts and controls access to their resou...
Definition: CloudComputeService.h:37
A virtualized cluster-based compute service.
Definition: VirtualizedClusterComputeService.h:28
A workflow (to be executed by a WMS)
Definition: Workflow.h:30
StandardJobScheduler * getStandardJobScheduler()
Get the WMS's pilot scheduler.
Definition: WMS.cpp:390
void addWorkflow(Workflow *workflow, double start_time=0)
Assign a workflow to the WMS.
Definition: WMS.cpp:272
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:45
void addDynamicOptimization(std::unique_ptr< DynamicOptimization >)
Add a dynamic optimization to the list of optimizations. Optimizations are executed in order of inser...
Definition: WMS.cpp:67
A (mostly virtual) base class for implementing StandardJob scheduling algorithms to be used by a WMS...
Definition: StandardJobScheduler.h:31
Workflow * getWorkflow()
Get the workflow that was assigned to the WMS.
Definition: WMS.cpp:297
A workflow management system (WMS)
Definition: WMS.h:35
void addStaticOptimization(std::unique_ptr< StaticOptimization >)
Add a static optimization to the list of optimizations. Optimizations are executed in order of insert...
Definition: WMS.cpp:77