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);
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);
109 std::shared_ptr<FileLocation> dst);
112 std::shared_ptr<FileLocation> dst);
115 std::shared_ptr<FileLocation> dst);
124 int unique_sequence_number);
133 int unique_sequence_number);
147 std::type_index type_index = std::type_index(
typeid(T));
148 if (this->traces.find(type_index) == this->traces.end()) {
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
void addTimestampFileWriteFailure(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file write failure timestamp.
Definition: SimulationOutput.cpp:1559
void addTimestamp(T *timestamp)
Append a simulation timestamp to a simulation output trace.
Definition: SimulationOutput.h:146
void enableFileReadWriteCopyTimestamps(bool enabled)
Enable or Disable the insertion of file-related timestamps in the simulation output (enabled by defau...
Definition: SimulationOutput.cpp:1750
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:508
void addTimestampDiskReadFailure(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file read failure timestamp.
Definition: SimulationOutput.cpp:1639
void addTimestampFileReadStart(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file read start timestamp.
Definition: SimulationOutput.cpp:1507
void addTimestampTaskFailure(WorkflowTask *task)
Add a task start failure.
Definition: SimulationOutput.cpp:1474
void addTimestampDiskReadStart(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file read start timestamp.
Definition: SimulationOutput.cpp:1626
void addTimestampDiskWriteFailure(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file write failure timestamp.
Definition: SimulationOutput.cpp:1678
void addTimestampTaskStart(WorkflowTask *task)
Add a task start timestamp.
Definition: SimulationOutput.cpp:1464
void addTimestampPstateSet(std::string hostname, int pstate)
Add a pstate change/set timestamp.
Definition: SimulationOutput.cpp:1702
void addTimestampTaskCompletion(WorkflowTask *task)
Add a task start completion.
Definition: SimulationOutput.cpp:1484
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:1736
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)
Function that generates a unified JSON file containing the information specified by boolean arguments...
Definition: SimulationOutput.cpp:145
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:995
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:1652
void addTimestampFileCopyCompletion(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy completion timestamp.
Definition: SimulationOutput.cpp:1612
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:1494
A workflow (to be executed by a WMS)
Definition: Workflow.h:33
void enableEnergyTimestamps(bool enabled)
Enable or Disable the insertion of energy-related timestamps in the simulation output (enabled by def...
Definition: SimulationOutput.cpp:1767
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:847
void addTimestampDiskWriteStart(std::string hostname, std::string mount, double bytes, int unique_sequence_number)
Add a file write start timestamp.
Definition: SimulationOutput.cpp:1665
void addTimestampFileCopyFailure(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy failure timestamp.
Definition: SimulationOutput.cpp:1599
A computational task in a Workflow.
Definition: WorkflowTask.h:27
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:1691
void addTimestampFileWriteStart(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file write start timestamp.
Definition: SimulationOutput.cpp:1546
void addTimestampFileReadFailure(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file read failure timestamp.
Definition: SimulationOutput.cpp:1520
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:1724
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:1293
void addTimestampFileCopyStart(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst)
Add a file copy start timestamp.
Definition: SimulationOutput.cpp:1586
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:721
void addTimestampEnergyConsumption(std::string hostname, double joules)
Add an energy consumption timestamp.
Definition: SimulationOutput.cpp:1713
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:1572
void addTimestampFileReadCompletion(WorkflowFile *file, FileLocation *src, StorageService *service, WorkflowTask *task=nullptr)
Add a file read completion timestamp.
Definition: SimulationOutput.cpp:1533