WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
ComputeServiceMessage.h
1 
11 #ifndef WRENCH_COMPUTESERVICEMESSAGE_H
12 #define WRENCH_COMPUTESERVICEMESSAGE_H
13 
14 #include <memory>
15 #include <vector>
16 #include "wrench/failure_causes/FailureCause.h"
17 #include "wrench/services/ServiceMessage.h"
18 
19 namespace wrench {
20 
21  class StandardJob;
22 
23  class PilotJob;
24 
25  /***********************/
27  /***********************/
28 
32  class ComputeServiceMessage : public ServiceMessage {
33  protected:
34  ComputeServiceMessage(double payload);
35  };
36 
37 
38 // /**
39 // * @brief A message sent to a ComputeService to submit a StandardJob for execution
40 // */
41 // class ComputeServiceSubmitStandardJobRequestMessage : public ComputeServiceMessage {
42 // public:
43 // ComputeServiceSubmitStandardJobRequestMessage(const std::string answer_mailbox, std::shared_ptr<StandardJob> ,
44 // const std::map<std::string, std::string> service_specific_args,
45 // double payload);
46 //
47 // /** @brief The mailbox to which the answer message should be sent */
48 // std::string answer_mailbox;
49 // /** @brief The submitted job */
50 // std::shared_ptr<StandardJob> job;
51 // /** @brief Service specific arguments */
52 // std::map<std::string, std::string> service_specific_args;
53 // };
54 
55 // /**
56 // * @brief A message sent by a ComputeService in answer to a StandardJob submission request
57 // */
58 // class ComputeServiceSubmitStandardJobAnswerMessage : public ComputeServiceMessage {
59 // public:
60 // ComputeServiceSubmitStandardJobAnswerMessage(std::shared_ptr<StandardJob> , std::shared_ptr<ComputeService>, bool success,
61 // std::shared_ptr<FailureCause> failure_cause, double payload);
62 //
63 // /** @brief The standard job that was submitted */
64 // std::shared_ptr<StandardJob> job;
65 // /** @brief The compute service to which the job was submitted */
66 // std::shared_ptr<ComputeService> compute_service;
67 // /** @brief Whether to job submission was successful */
68 // bool success;
69 // /** @brief The cause of the failure, or nullptr on success */
70 // std::shared_ptr<FailureCause> failure_cause;
71 // };
72 
73 // /**
74 // * @brief A message sent by a ComputeService when a StandardJob has completed execution
75 // */
76 // class ComputeServiceStandardJobDoneMessage : public ComputeServiceMessage {
77 // public:
78 // ComputeServiceStandardJobDoneMessage(std::shared_ptr<StandardJob> , std::shared_ptr<ComputeService>, double payload);
79 //
80 // /** @brief The job that has completed */
81 // std::shared_ptr<StandardJob> job;
82 // /** @brief The compute service on which the job has completed */
83 // std::shared_ptr<ComputeService> compute_service;
84 // };
85 //
86 // /**
87 // * @brief A message sent by a ComputeService when a StandardJob has failed to execute
88 // */
89 // class ComputeServiceStandardJobFailedMessage : public ComputeServiceMessage {
90 // public:
91 // ComputeServiceStandardJobFailedMessage(std::shared_ptr<StandardJob> , std::shared_ptr<ComputeService>,
92 // std::shared_ptr<FailureCause> cause,
93 // double payload);
94 //
95 // /** @brief The job that has failed */
96 // std::shared_ptr<StandardJob> job;
97 // /** @brief The compute service on which the job has failed */
98 // std::shared_ptr<ComputeService> compute_service;
99 // /** @brief The cause of the failure */
100 // std::shared_ptr<FailureCause> cause;
101 // };
102 //
103 // /**
104 // * @brief A message sent to a ComputeService to terminate a StandardJob previously submitted for execution
105 // */
106 // class ComputeServiceTerminateStandardJobRequestMessage : public ComputeServiceMessage {
107 // public:
108 // ComputeServiceTerminateStandardJobRequestMessage(std::string answer_mailbox, std::shared_ptr<StandardJob> , double payload);
109 //
110 // /** @brief The mailbox to which the answer message should be sent */
111 // std::string answer_mailbox;
112 // /** @brief The job to terminate*/
113 // std::shared_ptr<StandardJob> job;
114 // };
115 //
116 // /**
117 // * @brief A message sent by a ComputeService in answer to a StandardJob termination request
118 // */
119 // class ComputeServiceTerminateStandardJobAnswerMessage : public ComputeServiceMessage {
120 // public:
121 // ComputeServiceTerminateStandardJobAnswerMessage(std::shared_ptr<StandardJob> , std::shared_ptr<ComputeService>, bool success,
122 // std::shared_ptr<FailureCause> failure_cause, double payload);
123 //
124 // /** @brief The standard job to terminate */
125 // std::shared_ptr<StandardJob> job;
126 // /** @brief The compute service to which the job had been submitted */
127 // std::shared_ptr<ComputeService> compute_service;
128 // /** @brief Whether to job termination was successful */
129 // bool success;
130 // /** @brief The cause of the failure, or nullptr on success */
131 // std::shared_ptr<FailureCause> failure_cause;
132 // };
133 
137  class ComputeServiceSubmitCompoundJobRequestMessage : public ComputeServiceMessage {
138  public:
139  ComputeServiceSubmitCompoundJobRequestMessage(simgrid::s4u::Mailbox *answer_mailbox,
140  std::shared_ptr<CompoundJob> job,
141  const std::map<std::string, std::string> service_specific_args,
142  double payload);
143 
145  simgrid::s4u::Mailbox *answer_mailbox;
147  std::shared_ptr<CompoundJob> job;
149  std::map<std::string, std::string> service_specific_args;
150  };
151 
155  class ComputeServiceSubmitCompoundJobAnswerMessage : public ComputeServiceMessage {
156  public:
157  ComputeServiceSubmitCompoundJobAnswerMessage(std::shared_ptr<CompoundJob> , std::shared_ptr<ComputeService>, bool success,
158  std::shared_ptr<FailureCause> failure_cause, double payload);
159 
161  std::shared_ptr<CompoundJob> job;
163  std::shared_ptr<ComputeService> compute_service;
165  bool success;
167  std::shared_ptr<FailureCause> failure_cause;
168  };
169 
173  class ComputeServiceCompoundJobDoneMessage : public ComputeServiceMessage {
174  public:
175  ComputeServiceCompoundJobDoneMessage(std::shared_ptr<CompoundJob> , std::shared_ptr<ComputeService>, double payload);
176 
178  std::shared_ptr<CompoundJob> job;
180  std::shared_ptr<ComputeService> compute_service;
181  };
182 
186  class ComputeServiceCompoundJobFailedMessage : public ComputeServiceMessage {
187  public:
188  ComputeServiceCompoundJobFailedMessage(std::shared_ptr<CompoundJob> , std::shared_ptr<ComputeService>,
189  double payload);
190 
192  std::shared_ptr<CompoundJob> job;
194  std::shared_ptr<ComputeService> compute_service;
195  };
196 
200  class ComputeServiceTerminateCompoundJobRequestMessage : public ComputeServiceMessage {
201  public:
202  ComputeServiceTerminateCompoundJobRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr<CompoundJob> , double payload);
203 
205  simgrid::s4u::Mailbox *answer_mailbox;
207  std::shared_ptr<CompoundJob> job;
208  };
209 
213  class ComputeServiceTerminateCompoundJobAnswerMessage : public ComputeServiceMessage {
214  public:
215  ComputeServiceTerminateCompoundJobAnswerMessage(std::shared_ptr<CompoundJob> , std::shared_ptr<ComputeService>, bool success,
216  std::shared_ptr<FailureCause> failure_cause, double payload);
217 
219  std::shared_ptr<CompoundJob> job;
221  std::shared_ptr<ComputeService> compute_service;
223  bool success;
225  std::shared_ptr<FailureCause> failure_cause;
226  };
227 
228 // /**
229 // * @brief A message sent to a ComputeService to submit a PilotJob for execution
230 // */
231 // class ComputeServiceSubmitPilotJobRequestMessage : public ComputeServiceMessage {
232 // public:
233 // ComputeServiceSubmitPilotJobRequestMessage(std::string answer_mailbox, std::shared_ptr<PilotJob> ,
234 // const std::map<std::string, std::string> service_specific_args,
235 // double payload);
236 //
237 // /** @brief The mailbox to which the answer message should be sent */
238 // std::string answer_mailbox;
239 // /** @brief The submitted pilot job */
240 // std::shared_ptr<PilotJob> job;
241 // /** @brief Service specific arguments */
242 // std::map<std::string, std::string> service_specific_args;
243 // };
244 //
245 // /**
246 // * @brief A message sent by a ComputeService in answer to a PilotJob submission request
247 // */
248 // class ComputeServiceSubmitPilotJobAnswerMessage : public ComputeServiceMessage {
249 // public:
250 // ComputeServiceSubmitPilotJobAnswerMessage(std::shared_ptr<PilotJob> , std::shared_ptr<ComputeService>, bool success,
251 // std::shared_ptr<FailureCause> cause,
252 // double payload);
253 //
254 // /** @brief The submitted pilot job */
255 // std::shared_ptr<PilotJob> job;
256 // /** @brief The compute service to which the job was submitted */
257 // std::shared_ptr<ComputeService> compute_service;
258 // /** @brief Whether the job submission was successful or not */
259 // bool success;
260 // /** @brief The cause of the failure, or nullptr on success */
261 // std::shared_ptr<FailureCause> failure_cause;
262 // };
263 
264 
268  class ComputeServicePilotJobStartedMessage : public ComputeServiceMessage {
269  public:
270  ComputeServicePilotJobStartedMessage(std::shared_ptr<PilotJob> , std::shared_ptr<ComputeService>, double payload);
271 
273  std::shared_ptr<PilotJob> job;
275  std::shared_ptr<ComputeService> compute_service;
276  };
277 
281  class ComputeServicePilotJobExpiredMessage : public ComputeServiceMessage {
282  public:
283  ComputeServicePilotJobExpiredMessage(std::shared_ptr<PilotJob> , std::shared_ptr<ComputeService>, double payload);
284 
286  std::shared_ptr<PilotJob> job;
288  std::shared_ptr<ComputeService> compute_service;
289  };
290 
294  class ComputeServicePilotJobFailedMessage : public ComputeServiceMessage {
295  public:
296  ComputeServicePilotJobFailedMessage(std::shared_ptr<PilotJob> ,
297  std::shared_ptr<ComputeService>,
298  std::shared_ptr<FailureCause> cause,
299  double payload);
300 
302  std::shared_ptr<PilotJob> job;
304  std::shared_ptr<ComputeService> compute_service;
306  std::shared_ptr<FailureCause> cause;
307  };
308 
312  class ComputeServiceTerminatePilotJobRequestMessage : public ComputeServiceMessage {
313  public:
314  ComputeServiceTerminatePilotJobRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, std::shared_ptr<PilotJob> , double payload);
315 
317  simgrid::s4u::Mailbox *answer_mailbox;
319  std::shared_ptr<PilotJob> job;
320  };
321 
325  class ComputeServiceTerminatePilotJobAnswerMessage : public ComputeServiceMessage {
326  public:
327  ComputeServiceTerminatePilotJobAnswerMessage(std::shared_ptr<PilotJob> , std::shared_ptr<ComputeService> compute_service,
328  bool success,
329  std::shared_ptr<FailureCause> failure_cause, double payload);
330 
332  std::shared_ptr<PilotJob> job;
334  std::shared_ptr<ComputeService> compute_service;
336  bool success;
338  std::shared_ptr<FailureCause> failure_cause;
339  };
340 
341 
345  class ComputeServiceResourceInformationRequestMessage : public ComputeServiceMessage {
346  public:
347  ComputeServiceResourceInformationRequestMessage(simgrid::s4u::Mailbox *answer_mailbox, const std::string &key, double payload);
348 
350  simgrid::s4u::Mailbox *answer_mailbox;
352  const std::string &key;
353  };
354 
358  class ComputeServiceResourceInformationAnswerMessage : public ComputeServiceMessage {
359  public:
360  ComputeServiceResourceInformationAnswerMessage(std::map<std::string, double> info,
361  double payload);
362 
364  std::map<std::string, double> info;
365  };
366 
370  class ComputeServiceIsThereAtLeastOneHostWithAvailableResourcesRequestMessage : public ComputeServiceMessage {
371  public:
372  ComputeServiceIsThereAtLeastOneHostWithAvailableResourcesRequestMessage(simgrid::s4u::Mailbox *answer_mailbox,
373  unsigned long num_cores,
374  double ram, double payload);
375 
377  simgrid::s4u::Mailbox *answer_mailbox;
379  unsigned long num_cores;
381  double ram;
382  };
383 
387  class ComputeServiceIsThereAtLeastOneHostWithAvailableResourcesAnswerMessage : public ComputeServiceMessage {
388  public:
389  ComputeServiceIsThereAtLeastOneHostWithAvailableResourcesAnswerMessage(bool answer, double payload);
390 
392  bool answer;
393  };
394 
395  /***********************/
397  /***********************/
398 
399 };
400 
401 #endif //WRENCH_COMPUTESERVICEMESSAGE_H
wrench
Definition: Action.cpp:28