10 #ifndef SIMULATION_COMPUTESERVICE_H
11 #define SIMULATION_COMPUTESERVICE_H
19 #include "wrench/services/Service.h"
20 #include "wrench/workflow/job/WorkflowJob.h"
41 friend class StandardJobExecutorTest;
54 static constexpr
unsigned long ALL_CORES = ULONG_MAX;
59 static constexpr
double ALL_RAM = DBL_MAX;
71 void terminateJob(WorkflowJob *job);
73 bool supportsStandardJobs();
75 bool supportsPilotJobs();
79 unsigned long getNumHosts();
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(StandardJob *job,
const std::map<std::string, std::string> &service_specific_arguments) = 0;
125 virtual void submitPilotJob(PilotJob *job,
const std::map<std::string, std::string> &service_specific_arguments) = 0;
131 virtual void terminateStandardJob(StandardJob *job) = 0;
137 virtual void terminatePilotJob(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(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