wrench::SimulationOutput

class SimulationOutput

A class that contains post-mortem simulation-generated data.

Public Functions

void dumpDiskOperationsJSON(const std::string &file_path, bool writing_file = true)

Writes a JSON file containing disk operation information as a JSON array.

>NOTE<<<< The timestamps the JSON is generated from are disabled by default. Enable them with SimulationOutput::enableDiskTimestamps() to use.

The JSON array has the following format:

{

“disk_operations”: {

“io_host”: { <— Hostname

”/”: { <— Mount

”reads”: [

{

“bytes”: <double>,

”end”: <double>,

”failed”: <double>,

”start”: <double>

},

{

…

}

],

”writes”: [

{

“bytes”: <double>,

”end”: <double>,

”failed”: <double>,

”start”: <double>

},

{

…

}

]

}

}

}

}

Parameters:
  • file_path – - path to save JSON at

  • writing_file – - boolean, default true, to write the JSON to the specified file path. Used for unified output.

void dumpHostEnergyConsumptionJSON(const std::string &file_path, bool writing_file = true)

Writes a JSON file containing host energy consumption information as a JSON array.

The JSON array has the following format:

{

“energy_consumption”: {

{

hostname: <string>,

pstates: [

{

pstate: <int>,

idle: <double>,

epsilon: <double>,

all_cores: <double>,

speed: <double>

},

{

pstate: <int>,

idle: <double>,

epsilon: <double>,

all_cores: <double>,

speed: <double>

} …

],

watts_off: <double>,

pstate_trace: [

{

time: <double>,

pstate: <int>

}, …

],

consumed_energy_trace: [

{

time: <double>,

joules: <double>

}, …

]

}, …

}

Parameters:
  • file_path – the path to write the file

  • writing_file – whether or not the file is written, true by default but will be false when utilized as part of dumpUnifiedJSON

void dumpLinkUsageJSON(const std::string &file_path, bool writing_file = true)

Writes a JSON file containing link usage information as a JSON array.

This information will not be generated without using the bandwidth meter service and providing it with link names to monitor.

{

“link_usage”: {

“links”: [

{

“link_usage_trace”: [

{

“bytes per second”: <double>,

”time”: <double>

},

{

…

},

],

”linkname”: <string>

},

{

…

}

]

}

}

Parameters:
  • file_path – path where json file is written

  • writing_file – whether to write file to disk. Enabled by default.

void dumpPlatformGraphJSON(const std::string &file_path, bool writing_file = true)

Writes a JSON file containing all hosts, network links, and the routes between each host.

The JSON array has the following format:

{

“platform”:{

vertices: [

{

type: <”host”>,

id: <string>,

flop_rate: <double (flops per second)>,

memory_manager_service: <double (bytes)>,

cores: <unsigned_long>

},

{

type: <”link”>,

id: <string>,

bandwidth: <double (bytes per second)>,

latency: <double (in seconds)>

}, …

],

edges: [

{

source: {

type: <string>,

id: <string>

}

target: {

type: <string>,

id: <string>

}

}, …

],

routes: [

{

source: <string>,

target: <string>,

latency: <double (in seconds)>

route: [

link_id, …

]

}

],

}

}

Parameters:
  • file_path – the path to write the file

  • writing_file – whether or not the file is written, true by default but will be false when utilized as part of dumpUnifiedJSON

void dumpWorkflowExecutionJSON(const std::shared_ptr<Workflow> &workflow, const 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.

The JSON array has the following format:

{

“workflow_execution”: {

“tasks”: [

{

“compute”: {

“end”: <double>,

”start”: <double>

},

”execution_host”: {

“cores”: <unsigned_long>,

”flop_rate”: <double>,

”hostname”: <string>,

”memory_manager_service”: <double>

},

”failed”: <double>,

”num_cores_allocated”: <unsigned_long>,

”read”: [

{

“end”: <double>,

”start”: <double>

},

{

…

}

],

”task_id”: <string>,

”color”: <string>,

”terminated”: <double>,

”whole_task”: {

“end”: <double>,

”start”: <double>

},

”write”: [

{

“end”: <double>,

”start”: <double>

},

{

…

}

],

},

{

…

}

]

}

}

If generate_host_utilization_layout is set to true, a recursive function searches for a possible host utilization layout where tasks are assumed to use contiguous numbers of cores on their execution hosts. Note that each ComputeService does not enforce this, and such a layout may not exist for some workflow executions. In this situation, the function will go through the entire search space until all possible layouts are evaluated. For a large Workflow, this may take a very long time.

If a host utilization layout is able to be generated, the ‘vertical_position’ values will be set for each task run, and the task can be plotted as a rectangle on a graph where the y-axis denotes the number of cores - 1, and the x-axis denotes the workflow execution timeline. The vertical_position specifies the bottom of the rectangle. num_cores_allocated specifies the height of the rectangle.

Parameters:
  • workflow – a pointer to the Workflow

  • file_path – the path to write the file

  • generate_host_utilization_layout – boolean specifying whether or not you would like a possible host utilization layout to be generated

  • writing_file – whether or not the file is written, true by default but will be false when utilized as part of dumpUnifiedJSON

void dumpWorkflowGraphJSON(const std::shared_ptr<Workflow> &workflow, const std::string &file_path, bool writing_file = true)

Writes a JSON graph representation of the Workflow to a file, in the WfFormat format which is defined at: https://wfcommons.org/format.

Note that in the output JSON, the machines::cpu::speed is give as a GHz clock rate while in WRENCH core speeds are in Flop/sec. The GHz clock rate is computed by dividing the flop rate by 10^9 (so it’s not really a clock rate).

Parameters:
  • workflow – a pointer to the workflow

  • file_path – the path to write the file

  • writing_file – whether or not the file is written, true by default but will be false when utilized as part of dumpUnifiedJSON

void enableBandwidthTimestamps(bool enabled)

Enable or Disable the insertion of link-usage-related timestamps in the simulation output (enabled by default).

Parameters:

enabled – true to enable, false to disable

void enableDiskTimestamps(bool enabled)

Enable or Disable the insertion of disk-related timestamps in the simulation output (enabled by default).

Parameters:

enabled – true to enable, false to disable

void enableEnergyTimestamps(bool enabled)

Enable or Disable the insertion of energy-related timestamps in the simulation output (enabled by default).

Parameters:

enabled – true to enable, false to disable

void enableFileReadWriteCopyTimestamps(bool enabled)

Enable or Disable the insertion of file-related timestamps in the simulation output (enabled by default).

Parameters:

enabled – true to enable, false to disable

void enableWorkflowTaskTimestamps(bool enabled)

Enable or Disable the insertion of task-related timestamps in the simulation output (enabled by default).

Parameters:

enabled – true to enable, false to disable

template<class T>
inline std::vector<SimulationTimestamp<T>*> getTrace()

Retrieve a copy of a simulation output trace once the simulation has completed.

Template Parameters:

a – particular SimulationTimestampXXXX class (defined in SimulationTimestampTypes.h)

Returns:

a vector of pointers to SimulationTimestampXXXX instances