WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
HTCondorComputeService.h
1 
10 #ifndef WRENCH_HTCONDOR_H
11 #define WRENCH_HTCONDOR_H
12 
13 #include "wrench/services/compute/ComputeServiceMessage.h"
14 #include "wrench/services/compute/ComputeService.h"
15 #include "wrench/services/compute/htcondor/HTCondorCentralManagerService.h"
16 #include "wrench/services/compute/htcondor/HTCondorComputeServiceProperty.h"
17 #include "wrench/services/compute/htcondor/HTCondorComputeServiceMessagePayload.h"
18 #include "wrench/workflow/job/PilotJob.h"
19 #include "wrench/workflow/job/StandardJob.h"
20 
21 namespace wrench {
22 
28  private:
29  std::map<std::string, std::string> default_property_values = {
35  };
36 
37  std::map<std::string, double> default_messagepayload_values = {
48  };
49 
50  public:
51  HTCondorComputeService(const std::string &hostname,
52  std::set<std::shared_ptr<ComputeService>> compute_services,
53  std::map<std::string, std::string> property_list = {},
54  std::map<std::string, double> messagepayload_list = {});
55 
56  /***********************/
58  /***********************/
59 
60  void addComputeService(std::shared_ptr<ComputeService> compute_service);
61 
62  void submitStandardJob(std::shared_ptr<StandardJob> job,
63  const std::map<std::string, std::string> &service_specific_arguments) override;
64 
65  void submitPilotJob(std::shared_ptr<PilotJob> job, const std::map<std::string, std::string> &service_specific_arguments) override;
66 
67  std::shared_ptr<StorageService> getLocalStorageService() const;
68 
69  void setLocalStorageService(std::shared_ptr<StorageService> local_storage_service);
70 
71  /***********************/
73  /***********************/
74 
75 
76  /***********************/
78  /***********************/
79 
80  ~HTCondorComputeService() override;
81 
82  void terminateStandardJob(std::shared_ptr<StandardJob> job) override;
83 
84  void terminatePilotJob(std::shared_ptr<PilotJob> job) override;
85 
86  /***********************/
88  /***********************/
89 
90  private:
91  int main() override;
92 
93  bool processNextMessage();
94 
95  void processSubmitStandardJob(const std::string &answer_mailbox, std::shared_ptr<StandardJob>job,
96  const std::map<std::string, std::string> &service_specific_args);
97 
98  void processSubmitPilotJob(const std::string &answer_mailbox, std::shared_ptr<PilotJob>job,
99  const std::map<std::string, std::string> &service_specific_args);
100 
101  void processIsThereAtLeastOneHostWithAvailableResources(const std::string &answer_mailbox, unsigned long num_cores, double ram);
102 
103  void terminate();
104 
105  std::string pool_name;
106  std::shared_ptr<StorageService> local_storage_service;
107  std::shared_ptr<HTCondorCentralManagerService> central_manager;
108  };
109 }
110 
111 #endif //WRENCH_HTCONDOR_H
wrench::ComputeServiceMessagePayload::IS_THERE_AT_LEAST_ONE_HOST_WITH_AVAILABLE_RESOURCES_ANSWER_MESSAGE_PAYLOAD
static const std::string IS_THERE_AT_LEAST_ONE_HOST_WITH_AVAILABLE_RESOURCES_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to ask is one host has some resources a...
Definition: ComputeServiceMessagePayload.h:60
wrench::HTCondorComputeServiceProperty::NON_GRID_POST_EXECUTION_DELAY
static const std::string NON_GRID_POST_EXECUTION_DELAY
Overhead (in seconds) between condor and a bare-metal compute for the completion of execution of non-...
Definition: HTCondorComputeServiceProperty.h:42
wrench::HTCondorComputeService::submitPilotJob
void submitPilotJob(std::shared_ptr< PilotJob > job, const std::map< std::string, std::string > &service_specific_arguments) override
Asynchronously submit a pilot job to the cloud service.
Definition: HTCondorComputeService.cpp:189
wrench::ComputeServiceMessagePayload::SUBMIT_STANDARD_JOB_REQUEST_MESSAGE_PAYLOAD
static const std::string SUBMIT_STANDARD_JOB_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to submit a standard job.
Definition: ComputeServiceMessagePayload.h:26
wrench::HTCondorComputeService
A workload management framework compute service.
Definition: HTCondorComputeService.h:27
wrench::ServiceMessagePayload::DAEMON_STOPPED_MESSAGE_PAYLOAD
static const std::string DAEMON_STOPPED_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to confirm it has terminated.
Definition: ServiceMessagePayload.h:33
wrench::ComputeServiceMessagePayload::RESOURCE_DESCRIPTION_REQUEST_MESSAGE_PAYLOAD
static const std::string RESOURCE_DESCRIPTION_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to ask it for information on its resour...
Definition: ComputeServiceMessagePayload.h:56
wrench::ComputeServiceMessagePayload::IS_THERE_AT_LEAST_ONE_HOST_WITH_AVAILABLE_RESOURCES_REQUEST_MESSAGE_PAYLOAD
static const std::string IS_THERE_AT_LEAST_ONE_HOST_WITH_AVAILABLE_RESOURCES_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message by the the daemon to state whether one host has some resou...
Definition: ComputeServiceMessagePayload.h:62
wrench::HTCondorComputeService::terminatePilotJob
void terminatePilotJob(std::shared_ptr< PilotJob > job) override
Terminate a pilot job to the compute service.
Definition: HTCondorComputeService.cpp:242
wrench::ComputeService
The compute service base class.
Definition: ComputeService.h:33
wrench::HTCondorComputeServiceProperty::NEGOTIATOR_OVERHEAD
static const std::string NEGOTIATOR_OVERHEAD
Overhead, in seconds, of the HTCondor Negotiator, which is invoked each time a new job is submitted o...
Definition: HTCondorComputeServiceProperty.h:26
wrench
Definition: Alarm.cpp:20
wrench::HTCondorComputeService::setLocalStorageService
void setLocalStorageService(std::shared_ptr< StorageService > local_storage_service)
Set the service's local storage service.
Definition: HTCondorComputeService.cpp:258
wrench::ComputeServiceMessagePayload::SUBMIT_PILOT_JOB_ANSWER_MESSAGE_PAYLOAD
static const std::string SUBMIT_PILOT_JOB_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent from the daemon to acknowledge a pilot job submission...
Definition: ComputeServiceMessagePayload.h:40
wrench::HTCondorComputeService::terminateStandardJob
void terminateStandardJob(std::shared_ptr< StandardJob > job) override
Terminate a standard job to the compute service (virtual)
Definition: HTCondorComputeService.cpp:232
wrench::HTCondorComputeServiceProperty::NON_GRID_PRE_EXECUTION_DELAY
static const std::string NON_GRID_PRE_EXECUTION_DELAY
Overhead (in seconds) between condor and a bare-metal compute service for the start of execution of n...
Definition: HTCondorComputeServiceProperty.h:38
wrench::HTCondorComputeServiceProperty::GRID_POST_EXECUTION_DELAY
static const std::string GRID_POST_EXECUTION_DELAY
Overhead (in seconds) between condor and a batch compute service for the completion of execution of g...
Definition: HTCondorComputeServiceProperty.h:34
wrench::Service::messagepayload_list
std::map< std::string, double > messagepayload_list
The service's messagepayload list.
Definition: Service.h:112
wrench::ComputeServiceMessagePayload::RESOURCE_DESCRIPTION_ANSWER_MESSAGE_PAYLOAD
static const std::string RESOURCE_DESCRIPTION_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to state information on its resources.
Definition: ComputeServiceMessagePayload.h:58
wrench::ServiceMessagePayload::STOP_DAEMON_MESSAGE_PAYLOAD
static const std::string STOP_DAEMON_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to terminate it.
Definition: ServiceMessagePayload.h:31
wrench::HTCondorComputeService::addComputeService
void addComputeService(std::shared_ptr< ComputeService > compute_service)
Add a new 'child' compute service.
Definition: HTCondorComputeService.cpp:127
wrench::S4U_Daemon::hostname
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:51
wrench::HTCondorComputeService::~HTCondorComputeService
~HTCondorComputeService() override
Destructor.
Definition: HTCondorComputeService.cpp:117
wrench::ComputeServiceMessagePayload::SUBMIT_STANDARD_JOB_ANSWER_MESSAGE_PAYLOAD
static const std::string SUBMIT_STANDARD_JOB_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to acknowledge a standard job submissio...
Definition: ComputeServiceMessagePayload.h:28
wrench::ComputeServiceMessagePayload::SUBMIT_PILOT_JOB_REQUEST_MESSAGE_PAYLOAD
static const std::string SUBMIT_PILOT_JOB_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to submit a pilot job.
Definition: ComputeServiceMessagePayload.h:38
wrench::HTCondorComputeService::HTCondorComputeService
HTCondorComputeService(const std::string &hostname, std::set< std::shared_ptr< ComputeService >> compute_services, std::map< std::string, std::string > property_list={}, std::map< std::string, double > messagepayload_list={})
Constructor.
Definition: HTCondorComputeService.cpp:42
wrench::HTCondorComputeService::submitStandardJob
void submitStandardJob(std::shared_ptr< StandardJob > job, const std::map< std::string, std::string > &service_specific_arguments) override
Submit a standard job to the HTCondor service.
Definition: HTCondorComputeService.cpp:140
wrench::HTCondorComputeService::getLocalStorageService
std::shared_ptr< StorageService > getLocalStorageService() const
Get the service's local storage service.
Definition: HTCondorComputeService.cpp:250
wrench::Service::property_list
std::map< std::string, std::string > property_list
The service's property list.
Definition: Service.h:109
wrench::HTCondorComputeServiceProperty::GRID_PRE_EXECUTION_DELAY
static const std::string GRID_PRE_EXECUTION_DELAY
Overhead (in seconds) between condor and a batch compute service for the start of execution of grid-u...
Definition: HTCondorComputeServiceProperty.h:30