10 #ifndef SIMULATION_COMPUTESERVICE_H
11 #define SIMULATION_COMPUTESERVICE_H
19 #include "wrench/services/Service.h"
20 #include "wrench/workflow/job/WorkflowJob.h"
21 #include "wrench/workflow/job/StandardJob.h"
22 #include "wrench/workflow/job/PilotJob.h"
39 friend class StandardJobExecutorTest;
52 static constexpr
unsigned long ALL_CORES = ULONG_MAX;
57 static constexpr
double ALL_RAM = DBL_MAX;
69 void terminateJob(std::shared_ptr<WorkflowJob> job);
71 bool supportsStandardJobs();
73 bool supportsPilotJobs();
77 unsigned long getNumHosts();
79 std::vector<std::string> getHosts();
81 std::map<std::string, unsigned long> getPerHostNumCores();
83 unsigned long getTotalNumCores();
85 std::map<std::string, unsigned long> getPerHostNumIdleCores();
87 virtual unsigned long getTotalNumIdleCores();
89 std::map<std::string, double> getMemoryCapacity();
91 std::map<std::string, double> getPerHostAvailableMemoryCapacity();
93 std::map<std::string, double> getCoreFlopRate();
97 double getTotalScratchSpaceSize();
99 double getFreeScratchSpaceSize();
117 submitStandardJob(std::shared_ptr<StandardJob> job,
const std::map<std::string, std::string> &service_specific_arguments) = 0;
125 virtual void submitPilotJob(std::shared_ptr<PilotJob> job,
const std::map<std::string, std::string> &service_specific_arguments) = 0;
131 virtual void terminateStandardJob(std::shared_ptr<StandardJob> job) = 0;
137 virtual void terminatePilotJob(std::shared_ptr<PilotJob> job) = 0;
143 std::shared_ptr<StorageService> getScratch();
147 std::string service_name,
148 std::string mailbox_name_prefix,
149 std::string scratch_space_mount_point);
153 friend class JobManager;
155 void submitJob(std::shared_ptr<WorkflowJob> job,
const std::map<std::string, std::string>& = {});
157 ComputeService(
const std::string &hostname,
158 std::string service_name,
159 std::string mailbox_name_prefix,
160 std::shared_ptr<StorageService> scratch_space);
163 std::shared_ptr<StorageService> scratch_space_storage_service;
173 std::shared_ptr<StorageService> getScratchSharedPtr();
182 std::shared_ptr<StorageService> scratch_space_storage_service_shared_ptr;
184 std::map<std::string, std::map<std::string, double>> getServiceResourceInformation();
191 #endif //SIMULATION_COMPUTESERVICE_H