10 #ifndef WRENCH_HTCONDORCENTRALMANAGERSERVICE_H
11 #define WRENCH_HTCONDORCENTRALMANAGERSERVICE_H
15 #include "wrench/services/compute/ComputeService.h"
16 #include "wrench/services/compute/htcondor/HTCondorCentralManagerServiceMessagePayload.h"
28 WRENCH_PROPERTY_COLLECTION_TYPE default_property_values = {};
30 WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE default_messagepayload_values = {
51 double negotiator_startup_overhead,
52 std::set<std::shared_ptr<ComputeService>> compute_services,
66 const std::map<std::string, std::string> &service_specific_arguments)
override;
79 bool jobKindIsSupported(
const std::shared_ptr<Job>& job, std::map<std::string, std::string> service_specific_arguments);
81 bool jobCanRunSomewhere(std::shared_ptr<CompoundJob> job, std::map<std::string, std::string> service_specific_arguments);
89 bool processNextMessage();
91 void processSubmitCompoundJob(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr<CompoundJob> job,
92 std::map<std::string, std::string> &service_specific_args);
94 void processSubmitPilotJob(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr<PilotJob> job,
95 std::map<std::string, std::string> &service_specific_args);
97 void processPilotJobStarted(std::shared_ptr<PilotJob>job);
99 void processPilotJobCompletion(std::shared_ptr<PilotJob>job);
101 void processCompoundJobCompletion(std::shared_ptr<CompoundJob>job);
103 void processNegotiatorCompletion(std::vector<std::shared_ptr<Job>> &pending_jobs);
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;
129 #endif //WRENCH_HTCONDORCENTRALMANAGERSERVICE_H
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_PROPERTY_COLLECTION_TYPE property_list
The service's property list.
Definition: Service.h:110
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
~HTCondorCentralManagerService() override
Destructor.
Definition: HTCondorCentralManagerService.cpp:61
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
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
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
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
A workload management framework compute service.
Definition: HTCondorComputeService.h:27
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
virtual bool supportsStandardJobs() override
Returns true if the service supports standard jobs.
Definition: HTCondorCentralManagerService.cpp:490
void terminateCompoundJob(std::shared_ptr< CompoundJob > job) override
Method to terminate a compound job.
Definition: HTCondorCentralManagerService.h:75
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
virtual bool supportsCompoundJobs() override
Returns true if the service supports compound jobs.
Definition: HTCondorCentralManagerService.cpp:498
WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list
The service's messagepayload list.
Definition: Service.h:113
The compute service base class.
Definition: ComputeService.h:34
void addComputeService(std::shared_ptr< ComputeService > compute_service)
Add a new 'child' compute service.
Definition: HTCondorCentralManagerService.cpp:72
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
Definition: Action.cpp:28
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
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
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
A HTCondor central manager service implementation.
Definition: HTCondorCentralManagerService.h:26
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
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
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
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:60
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
virtual bool supportsPilotJobs() override
Returns true if the service supports pilot jobs.
Definition: HTCondorCentralManagerService.cpp:506
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
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