10 #ifndef WRENCH_SIMULATIONOUTPUT_H
11 #define WRENCH_SIMULATIONOUTPUT_H
17 #include "wrench/simulation/SimulationTimestamp.h"
18 #include "wrench/simulation/SimulationTrace.h"
38 std::vector<SimulationTimestamp<T> *>
getTrace() {
39 std::type_index type_index = std::type_index(
typeid(T));
42 if (this->traces.find(type_index) == this->traces.end()) {
46 std::vector<SimulationTimestamp<T> *> non_generic_vector;
47 auto trace = (SimulationTrace<T> *) (this->traces[type_index]);
48 for (
auto ts : trace->getTrace()) {
51 return non_generic_vector;
55 bool generate_host_utilization_layout =
false,
bool writing_file =
true);
68 bool include_platform =
false,
69 bool include_workflow_exec =
true,
70 bool include_workflow_graph =
false,
71 bool include_energy =
false,
72 bool generate_host_utilization_layout =
false,
73 bool include_disk =
false,
74 bool include_bandwidth =
false);
116 void addTimestampFileCopyStart(
WorkflowFile *file, std::shared_ptr<FileLocation> src,
117 std::shared_ptr<FileLocation> dst);
119 void addTimestampFileCopyFailure(
WorkflowFile *file, std::shared_ptr<FileLocation> src,
120 std::shared_ptr<FileLocation> dst);
122 void addTimestampFileCopyCompletion(
WorkflowFile *file, std::shared_ptr<FileLocation> src,
123 std::shared_ptr<FileLocation> dst);
126 addTimestampDiskReadStart(std::string hostname, std::string mount,
double bytes,
int unique_sequence_number);
129 addTimestampDiskReadFailure(std::string hostname, std::string mount,
double bytes,
int unique_sequence_number);
131 void addTimestampDiskReadCompletion(std::string hostname, std::string mount,
double bytes,
132 int unique_sequence_number);
135 addTimestampDiskWriteStart(std::string hostname, std::string mount,
double bytes,
int unique_sequence_number);
138 addTimestampDiskWriteFailure(std::string hostname, std::string mount,
double bytes,
int unique_sequence_number);
140 void addTimestampDiskWriteCompletion(std::string hostname, std::string mount,
double bytes,
141 int unique_sequence_number);
143 void addTimestampPstateSet(std::string hostname,
int pstate);
145 void addTimestampEnergyConsumption(std::string hostname,
double joules);
147 void addTimestampLinkUsage(std::string linkname,
double bytes_per_second);
156 void addTimestamp(T *timestamp) {
157 std::type_index type_index = std::type_index(
typeid(T));
158 if (this->traces.find(type_index) == this->traces.end()) {
159 this->traces[type_index] =
new SimulationTrace<T>();
161 ((SimulationTrace<T> *) (this->traces[type_index]))->addTimestamp(
new SimulationTimestamp<T>(timestamp));
181 std::map<std::type_index, GenericSimulationTrace *> traces;
182 nlohmann::json platform_json_part;
183 nlohmann::json workflow_exec_json_part;
184 nlohmann::json workflow_graph_json_part;
185 nlohmann::json energy_json_part;
186 nlohmann::json disk_json_part;
187 nlohmann::json bandwidth_json_part;
189 std::map<std::type_index, bool> enabledStatus;
198 std::type_index type_index = std::type_index(
typeid(T));
199 return this->enabledStatus[type_index];
208 void setEnabled(
bool enabled) {
209 std::type_index type_index = std::type_index(
typeid(T));
210 this->enabledStatus[type_index] = enabled;
215 #endif //WRENCH_SIMULATIONOUTPUT_H