WRENCH  1.11
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/job/PilotJob.h"
19 #include "wrench/job/StandardJob.h"
20 
21 namespace wrench {
22 
28  private:
29  WRENCH_PROPERTY_COLLECTION_TYPE default_property_values = {
35  };
36 
37 WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE default_messagepayload_values = {
51  };
52 
53  public:
54  HTCondorComputeService(const std::string &hostname,
55  std::set<std::shared_ptr<ComputeService>> compute_services,
56  WRENCH_PROPERTY_COLLECTION_TYPE property_list = {},
57  WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {});
58 
59  virtual bool supportsStandardJobs() override;
60  virtual bool supportsCompoundJobs() override;
61  virtual bool supportsPilotJobs() override;
62 
63  /***********************/
65  /***********************/
66 
67  void validateJobsUseOfScratch(std::map<std::string, std::string> &service_specific_args) override;
68 
69  void validateServiceSpecificArguments(std::shared_ptr<CompoundJob> compound_job,
70  std::map<std::string, std::string> &service_specific_args) override;
71 
72  void addComputeService(std::shared_ptr<ComputeService> compute_service);
73 
74 // void submitStandardJob(std::shared_ptr<StandardJob> job,
75 // const std::map<std::string, std::string> &service_specific_arguments);
76 
77  void submitCompoundJob(std::shared_ptr<CompoundJob> job,
78  const std::map<std::string, std::string> &service_specific_arguments) override;
79 
80 
81 // void submitPilotJob(std::shared_ptr<PilotJob> job, const std::map<std::string, std::string> &service_specific_arguments) override;
82 
83  std::shared_ptr<StorageService> getLocalStorageService() const;
84 
85  void setLocalStorageService(std::shared_ptr<StorageService> local_storage_service);
86 
87  /***********************/
89  /***********************/
90 
91 
92  /***********************/
94  /***********************/
95 
96  ~HTCondorComputeService() override;
97 
98 // void terminateStandardJob(std::shared_ptr<StandardJob> job) override;
99 
100  void terminateCompoundJob(std::shared_ptr<CompoundJob> job) override {};
101 
102 // void terminatePilotJob(std::shared_ptr<PilotJob> job) override;
103 
104  /***********************/
106  /***********************/
107 
108  private:
109  int main() override;
110 
111 
112 
113  bool processNextMessage();
114 
115  void processSubmitCompoundJob(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr<CompoundJob>job,
116  const std::map<std::string, std::string> &service_specific_args);
117 
118 
119 // void processSubmitStandardJob(const std::string &answer_mailbox, std::shared_ptr<StandardJob>job,
120 // const std::map<std::string, std::string> &service_specific_args);
121 //
122 // void processSubmitPilotJob(const std::string &answer_mailbox, std::shared_ptr<PilotJob>job,
123 // const std::map<std::string, std::string> &service_specific_args);
124 
125  void processIsThereAtLeastOneHostWithAvailableResources(simgrid::s4u::Mailbox *answer_mailbox, unsigned long num_cores, double ram);
126 
127  void terminate();
128 
129  std::string pool_name;
130  std::shared_ptr<StorageService> local_storage_service;
131  std::shared_ptr<HTCondorCentralManagerService> central_manager;
132  };
133 }
134 
135 #endif //WRENCH_HTCONDOR_H
wrench::Service::property_list
WRENCH_PROPERTY_COLLECTION_TYPE property_list
The service's property list.
Definition: Service.h:110
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:78
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::HTCondorComputeService::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: HTCondorComputeService.cpp:130
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::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::HTCondorComputeService::supportsCompoundJobs
virtual bool supportsCompoundJobs() override
Returns true if the service supports compound jobs.
Definition: HTCondorComputeService.cpp:467
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::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::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:80
wrench::Service::messagepayload_list
WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list
The service's messagepayload list.
Definition: Service.h:113
wrench::HTCondorComputeService::validateServiceSpecificArguments
void validateServiceSpecificArguments(std::shared_ptr< CompoundJob > compound_job, std::map< std::string, std::string > &service_specific_args) override
Method the validates service-specific arguments (throws std::invalid_argument if invalid)
Definition: HTCondorComputeService.cpp:396
wrench::ComputeService
The compute service base class.
Definition: ComputeService.h:34
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: Action.cpp:28
wrench::HTCondorComputeService::setLocalStorageService
void setLocalStorageService(std::shared_ptr< StorageService > local_storage_service)
Set the service's local storage service.
Definition: HTCondorComputeService.cpp:182
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::HTCondorComputeService::validateJobsUseOfScratch
void validateJobsUseOfScratch(std::map< std::string, std::string > &service_specific_args) override
Determine whether compute service has scratch.
Definition: HTCondorComputeService.cpp:386
wrench::HTCondorComputeService::supportsPilotJobs
virtual bool supportsPilotJobs() override
Returns true if the service supports pilot jobs.
Definition: HTCondorComputeService.cpp:475
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_standard_and_pilot_jobs compute service for the comp...
Definition: HTCondorComputeServiceProperty.h:34
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::HTCondorComputeService::addComputeService
void addComputeService(std::shared_ptr< ComputeService > compute_service)
Add a new 'child' compute service.
Definition: HTCondorComputeService.cpp:117
wrench::S4U_Daemon::hostname
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:60
wrench::HTCondorComputeService::~HTCondorComputeService
~HTCondorComputeService() override
Destructor.
Definition: HTCondorComputeService.cpp:107
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::HTCondorComputeService::supportsStandardJobs
virtual bool supportsStandardJobs() override
Returns true if the service supports standard jobs.
Definition: HTCondorComputeService.cpp:459
wrench::HTCondorComputeService::HTCondorComputeService
HTCondorComputeService(const std::string &hostname, std::set< std::shared_ptr< ComputeService >> compute_services, WRENCH_PROPERTY_COLLECTION_TYPE property_list={}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list={})
Constructor.
Definition: HTCondorComputeService.cpp:42
wrench::HTCondorComputeService::terminateCompoundJob
void terminateCompoundJob(std::shared_ptr< CompoundJob > job) override
Method to terminate a compound job.
Definition: HTCondorComputeService.h:100
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
wrench::HTCondorComputeService::getLocalStorageService
std::shared_ptr< StorageService > getLocalStorageService() const
Get the service's local storage service.
Definition: HTCondorComputeService.cpp:174
wrench::HTCondorComputeServiceProperty::GRID_PRE_EXECUTION_DELAY
static const std::string GRID_PRE_EXECUTION_DELAY
Overhead (in seconds) between condor and a batch_standard_and_pilot_jobs compute service for the star...
Definition: HTCondorComputeServiceProperty.h:30