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;
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);
117 std::shared_ptr<FileLocation> dst);
120 std::shared_ptr<FileLocation> dst);
123 std::shared_ptr<FileLocation> dst);
132 int unique_sequence_number);
141 int unique_sequence_number);
157 std::type_index type_index = std::type_index(
typeid(T));
158 if (this->traces.find(type_index) == this->traces.end()) {
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
void addTimestampFileWriteFailure(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file write failure timestamp.
Definition: SimulationOutput.cpp:1692
void addTimestamp(T *timestamp)
Append a simulation timestamp to a simulation output trace.
Definition: SimulationOutput.h:156
void enableFileReadWriteCopyTimestamps(bool enabled)
Enable or Disable the insertion of file-related timestamps in the simulation output (enabled by defau...
Definition: SimulationOutput.cpp:1942
void dumpWorkflowExecutionJSON(Workflow *workflow, std::string file_path, bool generate_host_utilization_layout=false, bool writing_file=true)
Writes WorkflowTask execution history for each task to a file, formatted as a JSON array.
Definition: SimulationOutput.cpp:539
void dumpUnifiedJSON(Workflow *workflow, std::string file_path, bool include_platform=false, bool include_workflow_exec=true, bool include_workflow_graph=false, bool include_energy=false, bool generate_host_utilization_layout=false, bool include_disk=false, bool include_bandwidth=false)
Function that generates a unified JSON file containing the information specified by boolean arguments...
Definition: SimulationOutput.cpp:174
void addTimestampDiskReadFailure(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file read failure timestamp.
Definition: SimulationOutput.cpp:1772
void addTimestampFileReadStart(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file read start timestamp.
Definition: SimulationOutput.cpp:1640
void addTimestampTaskFailure(WorkflowTask *task)
Add a task start failure.
Definition: SimulationOutput.cpp:1607
void addTimestampDiskReadStart(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file read start timestamp.
Definition: SimulationOutput.cpp:1759
void addTimestampDiskWriteFailure(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file write failure timestamp.
Definition: SimulationOutput.cpp:1811
void enableBandwidthTimestamps(bool enabled)
Enable or Disable the insertion of link-usage-related timestamps in the simulation output (enabled by...
Definition: SimulationOutput.cpp:1969
void addTimestampTaskStart(WorkflowTask *task)
Add a task start timestamp.
Definition: SimulationOutput.cpp:1597
void addTimestampPstateSet(std::string hostname, int pstate)
Add a pstate change/set timestamp.
Definition: SimulationOutput.cpp:1835
void addTimestampTaskCompletion(WorkflowTask *task)
Add a task start completion.
Definition: SimulationOutput.cpp:1617
A template class to represent a trace of timestamps.
Definition: SimulationTrace.h:48
void enableDiskTimestamps(bool enabled)
Enable or Disable the insertion of disk-related timestamps in the simulation output (enabled by defau...
Definition: SimulationOutput.cpp:1928
A time-stamped simulation event stored in SimulationOutput.
Definition: SimulationTimestamp.h:26
void dumpPlatformGraphJSON(std::string file_path, bool writing_file=true)
Writes a JSON file containing all hosts, network links, and the routes between each host.
Definition: SimulationOutput.cpp:1031
The storage service base class.
Definition: StorageService.h:36
void addTimestampDiskReadCompletion(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file read completion timestamp.
Definition: SimulationOutput.cpp:1785
void addTimestampFileCopyCompletion(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy completion timestamp.
Definition: SimulationOutput.cpp:1745
std::vector< SimulationTimestamp< T > * > getTrace()
Retrieve a copy of a simulation output trace once the simulation has completed.
Definition: SimulationOutput.h:38
void addTimestampTaskTermination(WorkflowTask *task)
Add a task start termination.
Definition: SimulationOutput.cpp:1627
A workflow (to be executed by a WMS)
Definition: Workflow.h:34
void enableEnergyTimestamps(bool enabled)
Enable or Disable the insertion of energy-related timestamps in the simulation output (enabled by def...
Definition: SimulationOutput.cpp:1959
void dumpHostEnergyConsumptionJSON(std::string file_path, bool writing_file=true)
Writes a JSON file containing host energy consumption information as a JSON array.
Definition: SimulationOutput.cpp:877
void addTimestampDiskWriteStart(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file write start timestamp.
Definition: SimulationOutput.cpp:1798
void addTimestampFileCopyFailure(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy failure timestamp.
Definition: SimulationOutput.cpp:1732
A computational task in a Workflow.
Definition: WorkflowTask.h:31
A class that encodes a file location.
Definition: FileLocation.h:28
void addTimestampDiskWriteCompletion(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file write completion timestamp.
Definition: SimulationOutput.cpp:1824
void addTimestampFileWriteStart(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file write start timestamp.
Definition: SimulationOutput.cpp:1679
void addTimestampFileReadFailure(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file read failure timestamp.
Definition: SimulationOutput.cpp:1653
void dumpLinkUsageJSON(std::string file_path, bool writing_file=true)
Definition: SimulationOutput.cpp:1496
A class that contains post-mortem simulation-generated data.
Definition: SimulationOutput.h:27
void enableWorkflowTaskTimestamps(bool enabled)
Enable or Disable the insertion of task-related timestamps in the simulation output (enabled by defau...
Definition: SimulationOutput.cpp:1916
void addTimestampLinkUsage(std::string linkname, double bytes_per_second)
Add a link usage timestamp.
Definition: SimulationOutput.cpp:1881
void dumpDiskOperationsJSON(std::string file_path, bool writing_file=true)
Writes a JSON file containing disk operation information as a JSON array.
Definition: SimulationOutput.cpp:1331
void addTimestampFileCopyStart(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy start timestamp.
Definition: SimulationOutput.cpp:1719
void dumpWorkflowGraphJSON(wrench::Workflow *workflow, std::string file_path, bool writing_file=true)
Writes a JSON graph representation of the Workflow to a file.
Definition: SimulationOutput.cpp:751
void addTimestampEnergyConsumption(std::string hostname, double joules)
Add an energy consumption timestamp.
Definition: SimulationOutput.cpp:1846
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
void addTimestampFileWriteCompletion(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file write completion timestamp.
Definition: SimulationOutput.cpp:1705
void addTimestampFileReadCompletion(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file read completion timestamp.
Definition: SimulationOutput.cpp:1666