HTCondorService.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/HTCondorServiceProperty.h"
17 #include "wrench/services/compute/htcondor/HTCondorServiceMessagePayload.h"
18 #include "wrench/workflow/job/StandardJob.h"
19 
20 namespace wrench {
21 
27  private:
28  std::map<std::string, std::string> default_property_values = {
31  };
32 
33  std::map<std::string, std::string> default_messagepayload_values = {
42  };
43 
44  public:
45  HTCondorService(const std::string &hostname,
46  const std::string &pool_name,
47  std::set<ComputeService *> compute_resources,
48  std::map<std::string, std::string> property_list = {},
49  std::map<std::string, std::string> messagepayload_list = {});
50 
51  /***********************/
53  /***********************/
54 
56  std::map<std::string, std::string> &service_specific_arguments) override;
57 
58  void submitPilotJob(PilotJob *job, std::map<std::string, std::string> &service_specific_arguments) override;
59 
61 
62  void setLocalStorageService(StorageService *local_storage_service);
63 
64  /***********************/
66  /***********************/
67 
68  ~HTCondorService() override;
69 
70  void terminateStandardJob(StandardJob *job) override;
71 
72  void terminatePilotJob(PilotJob *job) override;
73 
74  /***********************/
76  /***********************/
77 
78  private:
79  int main() override;
80 
81  bool processNextMessage();
82 
83  void processSubmitStandardJob(const std::string &answer_mailbox, StandardJob *job,
84  std::map<std::string, std::string> &service_specific_args);
85 
86  void terminate();
87 
88  std::string pool_name;
89  StorageService *local_storage_service;
90  std::shared_ptr <HTCondorCentralManagerService> central_manager;
91  };
92 }
93 
94 #endif //WRENCH_HTCONDOR_H
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
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
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
StorageService * getLocalStorageService() const
Definition: HTCondorService.cpp:148
A pilot (i.e., non-standard) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: PilotJob.h:29
A standard (i.e., non-pilot) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: StandardJob.h:38
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
The compute service base class.
Definition: ComputeService.h:35
A workload management framework compute service.
Definition: HTCondorService.h:26
static const std::string SUPPORTS_PILOT_JOBS
Whether the compute service supports pilot jobs (true or false)
Definition: ComputeServiceProperty.h:26
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
static const std::string SUPPORTS_STANDARD_JOBS
Whether the compute service supports standard jobs (true or false)
Definition: ComputeServiceProperty.h:24
The storage service base class.
Definition: StorageService.h:35
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
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
void submitStandardJob(StandardJob *job, std::map< std::string, std::string > &service_specific_arguments) override
Submit a standard job to the HTCondor service.
Definition: HTCondorService.cpp:72
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
HTCondorService(const std::string &hostname, const std::string &pool_name, std::set< ComputeService *> compute_resources, std::map< std::string, std::string > property_list={}, std::map< std::string, std::string > messagepayload_list={})
Constructor.
Definition: HTCondorService.cpp:31
Definition: TerminalOutput.cpp:15
void submitPilotJob(PilotJob *job, std::map< std::string, std::string > &service_specific_arguments) override
Asynchronously submit a pilot job to the cloud service.
Definition: HTCondorService.cpp:120