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);
66 bool include_workflow_exec =
true,
67 bool include_workflow_graph =
false,
bool include_energy =
false,
68 bool generate_host_utilization_layout =
false,
bool include_disk =
false);
108 void addTimestampFileCopyStart(
WorkflowFile *file, std::shared_ptr<FileLocation> src,
109 std::shared_ptr<FileLocation> dst);
111 void addTimestampFileCopyFailure(
WorkflowFile *file, std::shared_ptr<FileLocation> src,
112 std::shared_ptr<FileLocation> dst);
114 void addTimestampFileCopyCompletion(
WorkflowFile *file, std::shared_ptr<FileLocation> src,
115 std::shared_ptr<FileLocation> dst);
118 addTimestampDiskReadStart(std::string hostname, std::string mount,
double bytes,
int unique_sequence_number);
121 addTimestampDiskReadFailure(std::string hostname, std::string mount,
double bytes,
int unique_sequence_number);
123 void addTimestampDiskReadCompletion(std::string hostname, std::string mount,
double bytes,
124 int unique_sequence_number);
127 addTimestampDiskWriteStart(std::string hostname, std::string mount,
double bytes,
int unique_sequence_number);
130 addTimestampDiskWriteFailure(std::string hostname, std::string mount,
double bytes,
int unique_sequence_number);
132 void addTimestampDiskWriteCompletion(std::string hostname, std::string mount,
double bytes,
133 int unique_sequence_number);
135 void addTimestampPstateSet(std::string hostname,
int pstate);
137 void addTimestampEnergyConsumption(std::string hostname,
double joules);
146 void addTimestamp(T *timestamp) {
147 std::type_index type_index = std::type_index(
typeid(T));
148 if (this->traces.find(type_index) == this->traces.end()) {
149 this->traces[type_index] =
new SimulationTrace<T>();
151 ((SimulationTrace<T> *) (this->traces[type_index]))->addTimestamp(
new SimulationTimestamp<T>(timestamp));
171 std::map<std::type_index, GenericSimulationTrace *> traces;
172 nlohmann::json platform_json_part;
173 nlohmann::json workflow_exec_json_part;
174 nlohmann::json workflow_graph_json_part;
175 nlohmann::json energy_json_part;
176 nlohmann::json disk_json_part;
178 std::map<std::type_index, bool> enabledStatus;
187 std::type_index type_index = std::type_index(
typeid(T));
188 return this->enabledStatus[type_index];
197 void setEnabled(
bool enabled) {
198 std::type_index type_index = std::type_index(
typeid(T));
199 this->enabledStatus[type_index] = enabled;
204 #endif //WRENCH_SIMULATIONOUTPUT_H