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:1705
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:1995
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:526
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:169
void addTimestampDiskReadFailure(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file read failure timestamp.
Definition: SimulationOutput.cpp:1801
void addTimestampFileReadStart(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file read start timestamp.
Definition: SimulationOutput.cpp:1636
void addTimestampTaskFailure(WorkflowTask *task)
Add a task start failure.
Definition: SimulationOutput.cpp:1603
void addTimestampDiskReadStart(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file read start timestamp.
Definition: SimulationOutput.cpp:1784
void addTimestampDiskWriteFailure(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file write failure timestamp.
Definition: SimulationOutput.cpp:1852
void enableBandwidthTimestamps(bool enabled)
Enable or Disable the insertion of link-usage-related timestamps in the simulation output (enabled by...
Definition: SimulationOutput.cpp:2022
void addTimestampTaskStart(WorkflowTask *task)
Add a task start timestamp.
Definition: SimulationOutput.cpp:1593
void addTimestampPstateSet(std::string hostname, int pstate)
Add a pstate change/set timestamp.
Definition: SimulationOutput.cpp:1884
void addTimestampTaskCompletion(WorkflowTask *task)
Add a task start completion.
Definition: SimulationOutput.cpp:1613
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:1981
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:1818
void addTimestampFileCopyCompletion(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy completion timestamp.
Definition: SimulationOutput.cpp:1768
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:1623
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:2012
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:876
void addTimestampDiskWriteStart(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file write start timestamp.
Definition: SimulationOutput.cpp:1835
void addTimestampFileCopyFailure(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy failure timestamp.
Definition: SimulationOutput.cpp:1753
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:1869
void addTimestampFileWriteStart(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file write start timestamp.
Definition: SimulationOutput.cpp:1688
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:1491
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:1969
void addTimestampLinkUsage(std::string linkname, double bytes_per_second)
Add a link usage timestamp.
Definition: SimulationOutput.cpp:1933
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:1327
void addTimestampFileCopyStart(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy start timestamp.
Definition: SimulationOutput.cpp:1739
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:1896
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:1723
void addTimestampFileReadCompletion(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file read completion timestamp.
Definition: SimulationOutput.cpp:1671