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::map<std::string, unsigned long> getPerHostNumCores();
81 unsigned long getTotalNumCores();
83 std::map<std::string, unsigned long> getPerHostNumIdleCores();
85 virtual unsigned long getTotalNumIdleCores();
87 std::map<std::string, double> getMemoryCapacity();
89 std::map<std::string, double> getPerHostAvailableMemoryCapacity();
91 std::map<std::string, double> getCoreFlopRate();
95 double getTotalScratchSpaceSize();
97 double getFreeScratchSpaceSize();
115 submitStandardJob(std::shared_ptr<StandardJob> job,
const std::map<std::string, std::string> &service_specific_arguments) = 0;
123 virtual void submitPilotJob(std::shared_ptr<PilotJob> job,
const std::map<std::string, std::string> &service_specific_arguments) = 0;
129 virtual void terminateStandardJob(std::shared_ptr<StandardJob> job) = 0;
135 virtual void terminatePilotJob(std::shared_ptr<PilotJob> job) = 0;
141 std::shared_ptr<StorageService> getScratch();
145 std::string service_name,
146 std::string mailbox_name_prefix,
147 std::string scratch_space_mount_point);
151 friend class JobManager;
153 void submitJob(std::shared_ptr<WorkflowJob> job,
const std::map<std::string, std::string>& = {});
155 ComputeService(
const std::string &hostname,
156 std::string service_name,
157 std::string mailbox_name_prefix,
158 std::shared_ptr<StorageService> scratch_space);
161 std::shared_ptr<StorageService> scratch_space_storage_service;
171 std::shared_ptr<StorageService> getScratchSharedPtr();
180 std::shared_ptr<StorageService> scratch_space_storage_service_shared_ptr;
182 std::map<std::string, std::map<std::string, double>> getServiceResourceInformation();
189 #endif //SIMULATION_COMPUTESERVICE_H