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;
69 void submitJob(WorkflowJob *job, std::map<std::string, std::string> = {});
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, std::map<std::string, std::string> &service_specific_arguments) = 0;
125 virtual void submitPilotJob(PilotJob *job, 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();
146 ComputeService(
const std::string &hostname,
147 std::string service_name,
148 std::string mailbox_name_prefix,
149 std::string scratch_space_mount_point);
153 ComputeService(
const std::string &hostname,
154 std::string service_name,
155 std::string mailbox_name_prefix,
156 std::shared_ptr<StorageService> scratch_space);
159 std::shared_ptr<StorageService> scratch_space_storage_service;
169 std::shared_ptr<StorageService> getScratchSharedPtr();
177 std::shared_ptr<StorageService> scratch_space_storage_service_shared_ptr;
179 std::map<std::string, std::map<std::string, double>> getServiceResourceInformation();
186 #endif //SIMULATION_COMPUTESERVICE_H