SimulationTimestampTypes.h
1 
10 #ifndef WRENCH_SIMULATIONTIMESTAMPTYPES_H
11 #define WRENCH_SIMULATIONTIMESTAMPTYPES_H
12 
13 #include "wrench/workflow/WorkflowTask.h"
14 
15 namespace wrench {
16 
17  class WorkflowTask;
18  class StorageService;
19 
21  public:
23  double getDate();
24 
25  private:
26  double date = -0.1;
27  };
28 
33  public:
34  /***********************/
36  /***********************/
39  virtual ~SimulationTimestampPair() {}
40  /***********************/
42  /***********************/
43 
44  virtual SimulationTimestampPair *getEndpoint();
45 
46  protected:
47  SimulationTimestampPair *endpoint = nullptr;
48  };
49 
54 
55  public:
56 
57  /***********************/
59  /***********************/
61  /***********************/
63  /***********************/
64 
65  WorkflowTask *getTask();
66  SimulationTimestampTask *getEndpoint() override;
67 
68  protected:
69  static std::map<std::string, SimulationTimestampTask *> pending_task_timestamps;
70 
71  void setEndpoints();
72 
73  private:
74  WorkflowTask *task;
75  };
76 
81  public:
82  /***********************/
84  /***********************/
86  /***********************/
88  /***********************/
89  };
90 
95  public:
96  /***********************/
98  /***********************/
100  /***********************/
102  /***********************/
103 
104  };
105 
110  public:
111  /***********************/
113  /***********************/
115  /***********************/
117  /***********************/
118  };
119 
124  public:
125  /***********************/
127  /***********************/
129  /***********************/
131  /***********************/
132  };
133 
135 
140  public:
141 
142  /***********************/
144  /***********************/
145  SimulationTimestampFileCopy(WorkflowFile *file, StorageService *src, std::string src_partition, StorageService *dst, std::string dst_partition, SimulationTimestampFileCopyStart *start_timestamp = nullptr);
146  /***********************/
148  /***********************/
149 
153  struct FileLocation {
154  StorageService *storage_service;
155  std::string partition;
156 
157  FileLocation(StorageService *storage_service, std::string partition) : storage_service(storage_service), partition(partition) {
158 
159  }
160 
161  bool operator==(const FileLocation &rhs) {
162  return (this->storage_service == rhs.storage_service) && (this->partition == rhs.partition);
163  }
164 
165  bool operator!=(const FileLocation &rhs) {
166  return !FileLocation::operator==(rhs);
167  }
168  };
169 
170  SimulationTimestampFileCopy *getEndpoint() override;
171  WorkflowFile *getFile();
172  FileLocation getSource();
173  FileLocation getDestination();
174 
175  protected:
176  WorkflowFile *file;
177 
182 
187  };
188 
191 
196  public:
197  /***********************/
199  /***********************/
200  SimulationTimestampFileCopyStart(WorkflowFile *file, StorageService *src, std::string src_partition, StorageService *dst, std::string dst_partition);
201  /***********************/
203  /***********************/
204 
207  };
208 
213  public:
214  /***********************/
216  /***********************/
218  /***********************/
220  /***********************/
221  };
222 
227  public:
228  /***********************/
230  /***********************/
232  /***********************/
234  /***********************/
235  };
236 
241  public:
242  /***********************/
244  /***********************/
245  SimulationTimestampPstateSet(std::string hostname, int pstate);
246  /***********************/
248  /***********************/
249 
250  std::string getHostname();
251  int getPstate();
252  private:
253  std::string hostname;
254  int pstate;
255  };
256 
258  public:
259  /***********************/
261  /***********************/
262  SimulationTimestampEnergyConsumption(std::string hostname, double joules);
263  /***********************/
265  /***********************/
266 
267  std::string getHostname();
268  double getConsumption();
269 
270  private:
271  std::string hostname;
272  double joules;
273  };
274 };
275 
276 #endif //WRENCH_SIMULATIONTIMESTAMPTYPES_H
Definition: SimulationTimestampTypes.h:257
double getDate()
Retrieve the date recorded for this timestamp.
Definition: SimulationTimestampTypes.cpp:14
A computational task in a Workflow.
Definition: WorkflowTask.h:26
A simulation timestamp class for WorkflowTask failure times.
Definition: SimulationTimestampTypes.h:94
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
A simulation timestamp class for WorkflowTask start times.
Definition: SimulationTimestampTypes.h:80
FileLocation source
The location where the WorkflowFile was being copied from.
Definition: SimulationTimestampTypes.h:181
A simulation timestamp class for WorkflowTask termination times.
Definition: SimulationTimestampTypes.h:123
A simulation timestamp class for file copy failure times.
Definition: SimulationTimestampTypes.h:212
A simulation timestamp class for WorkflowTask completion times.
Definition: SimulationTimestampTypes.h:109
A simulation timestamp class for changes in a host&#39;s pstate.
Definition: SimulationTimestampTypes.h:240
A simulation timestamp class for file copy completions.
Definition: SimulationTimestampTypes.h:226
Definition: SimulationTimestampTypes.h:20
A base class for simulation timestamps regarding file copies.
Definition: SimulationTimestampTypes.h:139
A simulation timestamp class for file copy start times.
Definition: SimulationTimestampTypes.h:195
A base class for simulation timestamps.
Definition: SimulationTimestampTypes.h:32
The storage service base class.
Definition: StorageService.h:35
A file location struct that contains the storage service and partition where a file is located...
Definition: SimulationTimestampTypes.h:153
FileLocation destination
The intended location where the WorkflowFile was being copied to.
Definition: SimulationTimestampTypes.h:186
static std::map< std::string, SimulationTimestampTask * > pending_task_timestamps
A static map of SimulationTimestampTaskStart objects that have yet to matched with SimulationTimestam...
Definition: SimulationTimestampTypes.h:69
Definition: TerminalOutput.cpp:15
A base class for simulation timestamps regarding workflow tasks.
Definition: SimulationTimestampTypes.h:53