HTCondorCentralManagerService.h
1 
10 #ifndef WRENCH_HTCONDORCENTRALMANAGERSERVICE_H
11 #define WRENCH_HTCONDORCENTRALMANAGERSERVICE_H
12 
13 #include <set>
14 #include "wrench/services/compute/ComputeService.h"
15 #include "wrench/services/compute/htcondor/HTCondorCentralManagerServiceMessagePayload.h"
16 
17 namespace wrench {
18 
20  private:
21  std::map<std::string, std::string> default_property_values = {};
22 
23  std::map<std::string, std::string> default_messagepayload_values = {
31  };
32 
33  public:
34  HTCondorCentralManagerService(const std::string &hostname,
35  std::set<ComputeService *> compute_resources,
36  std::map<std::string, std::string> property_list = {},
37  std::map<std::string, std::string> messagepayload_list = {});
38 
39  /***********************/
41  /***********************/
42 
43  void submitStandardJob(StandardJob *job,
44  std::map<std::string, std::string> &service_specific_arguments) override;
45 
46  void submitPilotJob(PilotJob *job, std::map<std::string, std::string> &service_specific_arguments) override;
47 
48  /***********************/
50  /***********************/
51 
53 
54  void terminateStandardJob(StandardJob *job) override;
55 
56  void terminatePilotJob(PilotJob *job) override;
57 
58  /***********************/
60  /***********************/
61 
62  private:
63  int main() override;
64 
65  bool processNextMessage();
66 
67  void processSubmitStandardJob(const std::string &answer_mailbox, StandardJob *job,
68  std::map<std::string, std::string> &service_specific_args);
69 
70  void processStandardJobCompletion(StandardJob *job);
71 
72  void processNegotiatorCompletion(std::vector<StandardJob *> pending_jobs);
73 
74  void terminate();
75 
77  std::set<ComputeService *> compute_resources;
79  std::vector<StandardJob *> pending_jobs;
81  bool dispatching_jobs = false;
83  bool resources_unavailable = false;
85  std::map<ComputeService *, unsigned long> compute_resources_map;
87  std::map<StandardJob *, ComputeService *> running_jobs;
88  };
89 
90 }
91 
92 #endif //WRENCH_HTCONDORCENTRALMANAGERSERVICE_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_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
HTCondorCentralManagerService(const std::string &hostname, std::set< ComputeService *> compute_resources, std::map< std::string, std::string > property_list={}, std::map< std::string, std::string > messagepayload_list={})
Constructor.
Definition: HTCondorCentralManagerService.cpp:33
static const std::string STANDARD_JOB_DONE_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to state that it has completed a standa...
Definition: ComputeServiceMessagePayload.h:30
The compute service base class.
Definition: ComputeService.h:35
Definition: HTCondorCentralManagerService.h:19
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 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
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
Definition: TerminalOutput.cpp:15