WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
HTCondorCentralManagerService.h
1 
10 #ifndef WRENCH_HTCONDORCENTRALMANAGERSERVICE_H
11 #define WRENCH_HTCONDORCENTRALMANAGERSERVICE_H
12 
13 #include <set>
14 #include <deque>
15 #include "wrench/services/compute/ComputeService.h"
16 #include "wrench/services/compute/htcondor/HTCondorCentralManagerServiceMessagePayload.h"
17 
18 namespace wrench {
19  /***********************/
21  /***********************/
22 
27  private:
28  WRENCH_PROPERTY_COLLECTION_TYPE default_property_values = {};
29 
30 WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE default_messagepayload_values = {
45  };
46 
47  public:
48 
49 
50  HTCondorCentralManagerService(const std::string &hostname,
51  double negotiator_startup_overhead,
52  std::set<std::shared_ptr<ComputeService>> compute_services,
53  WRENCH_PROPERTY_COLLECTION_TYPE property_list = {},
54  WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {});
55 
56  virtual bool supportsStandardJobs() override;
57  virtual bool supportsCompoundJobs() override;
58  virtual bool supportsPilotJobs() override;
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);
64 
65  void submitCompoundJob(std::shared_ptr<CompoundJob> job,
66  const std::map<std::string, std::string> &service_specific_arguments) override;
67 
68 // void submitPilotJob(std::shared_ptr<PilotJob> job, const std::map<std::string, std::string> &service_specific_arguments) override;
69 
70 
72 
73 // void terminateStandardJob(std::shared_ptr<StandardJob> job) override;
74 
75  void terminateCompoundJob(std::shared_ptr<CompoundJob> job) override { } ;
76 
77 // void terminatePilotJob(std::shared_ptr<PilotJob> job) override;
78 
79  bool jobKindIsSupported(const std::shared_ptr<Job>& job, std::map<std::string, std::string> service_specific_arguments);
80 
81  bool jobCanRunSomewhere(std::shared_ptr<CompoundJob> job, std::map<std::string, std::string> service_specific_arguments);
82 
83  private:
84 
85  friend class HTCondorComputeService;
86 
87  int main() override;
88 
89  bool processNextMessage();
90 
91  void processSubmitCompoundJob(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr<CompoundJob> job,
92  std::map<std::string, std::string> &service_specific_args);
93 
94  void processSubmitPilotJob(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr<PilotJob> job,
95  std::map<std::string, std::string> &service_specific_args);
96 
97  void processPilotJobStarted(std::shared_ptr<PilotJob>job);
98 
99  void processPilotJobCompletion(std::shared_ptr<PilotJob>job);
100 
101  void processCompoundJobCompletion(std::shared_ptr<CompoundJob>job);
102 
103  void processNegotiatorCompletion(std::vector<std::shared_ptr<Job>> &pending_jobs);
104 
105  void terminate();
106 
107 
109  std::set<std::shared_ptr<ComputeService>> compute_services;
111  std::vector<std::tuple<std::shared_ptr<CompoundJob>, std::map<std::string, std::string>>> pending_jobs;
113  std::map<std::shared_ptr<CompoundJob>, std::shared_ptr<ComputeService>> running_jobs;
115  bool dispatching_jobs = false;
117  bool resources_unavailable = false;
119  double negotiator_startup_overhead = 0.0;
120 
121  };
122 
123  /***********************/
125  /***********************/
126 
127 }
128 
129 #endif //WRENCH_HTCONDORCENTRALMANAGERSERVICE_H
wrench::ComputeServiceMessagePayload::PILOT_JOB_EXPIRED_MESSAGE_PAYLOAD
static const std::string PILOT_JOB_EXPIRED_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to state that a pilot job has expired.
Definition: ComputeServiceMessagePayload.h:60
wrench::Service::property_list
WRENCH_PROPERTY_COLLECTION_TYPE property_list
The service's property list.
Definition: Service.h:110
wrench::ComputeServiceMessagePayload::SUBMIT_COMPOUND_JOB_ANSWER_MESSAGE_PAYLOAD
static const std::string SUBMIT_COMPOUND_JOB_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to acknowledge a compound job submissio...
Definition: ComputeServiceMessagePayload.h:43
wrench::HTCondorCentralManagerService::~HTCondorCentralManagerService
~HTCondorCentralManagerService() override
Destructor.
Definition: HTCondorCentralManagerService.cpp:61
wrench::HTCondorCentralManagerService::jobKindIsSupported
bool jobKindIsSupported(const std::shared_ptr< Job > &job, std::map< std::string, std::string > service_specific_arguments)
Helper function to check whether a job kind is supported.
Definition: HTCondorCentralManagerService.cpp:379
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:27
wrench::HTCondorCentralManagerService::submitCompoundJob
void submitCompoundJob(std::shared_ptr< CompoundJob > job, const std::map< std::string, std::string > &service_specific_arguments) override
Submit a compound job to the HTCondor service.
Definition: HTCondorCentralManagerService.cpp:93
wrench::ComputeServiceMessagePayload::COMPOUND_JOB_DONE_MESSAGE_PAYLOAD
static const std::string COMPOUND_JOB_DONE_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to state that it has completed a compou...
Definition: ComputeServiceMessagePayload.h:45
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:37
wrench::HTCondorCentralManagerService::supportsStandardJobs
virtual bool supportsStandardJobs() override
Returns true if the service supports standard jobs.
Definition: HTCondorCentralManagerService.cpp:490
wrench::HTCondorCentralManagerService::terminateCompoundJob
void terminateCompoundJob(std::shared_ptr< CompoundJob > job) override
Method to terminate a compound job.
Definition: HTCondorCentralManagerService.h:75
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 request information on its resources...
Definition: ComputeServiceMessagePayload.h:74
wrench::HTCondorCentralManagerService::supportsCompoundJobs
virtual bool supportsCompoundJobs() override
Returns true if the service supports compound jobs.
Definition: HTCondorCentralManagerService.cpp:498
wrench::Service::messagepayload_list
WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list
The service's messagepayload list.
Definition: Service.h:113
wrench::ComputeService
The compute service base class.
Definition: ComputeService.h:34
wrench::HTCondorCentralManagerService::addComputeService
void addComputeService(std::shared_ptr< ComputeService > compute_service)
Add a new 'child' compute service.
Definition: HTCondorCentralManagerService.cpp:72
wrench::ComputeServiceMessagePayload::STANDARD_JOB_DONE_MESSAGE_PAYLOAD
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:31
wrench
Definition: Action.cpp:28
wrench::HTCondorCentralManagerService::jobCanRunSomewhere
bool jobCanRunSomewhere(std::shared_ptr< CompoundJob > job, std::map< std::string, std::string > service_specific_arguments)
Helper function to check whether a job can run on at least one child compute service.
Definition: HTCondorCentralManagerService.cpp:414
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:56
wrench::HTCondorCentralManagerService::HTCondorCentralManagerService
HTCondorCentralManagerService(const std::string &hostname, double negotiator_startup_overhead, std::set< std::shared_ptr< ComputeService >> compute_services, WRENCH_PROPERTY_COLLECTION_TYPE property_list={}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list={})
Constructor.
Definition: HTCondorCentralManagerService.cpp:41
wrench::HTCondorCentralManagerService
A HTCondor central manager service implementation.
Definition: HTCondorCentralManagerService.h:26
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:76
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:35
wrench::ComputeServiceMessagePayload::PILOT_JOB_STARTED_MESSAGE_PAYLOAD
static const std::string PILOT_JOB_STARTED_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to state that a pilot job has started.
Definition: ComputeServiceMessagePayload.h:58
wrench::S4U_Daemon::hostname
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:60
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:29
wrench::HTCondorCentralManagerService::supportsPilotJobs
virtual bool supportsPilotJobs() override
Returns true if the service supports pilot jobs.
Definition: HTCondorCentralManagerService.cpp:506
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:54
wrench::ComputeServiceMessagePayload::SUBMIT_COMPOUND_JOB_REQUEST_MESSAGE_PAYLOAD
static const std::string SUBMIT_COMPOUND_JOB_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to submit a pilot job.
Definition: ComputeServiceMessagePayload.h:41