wrench::SimulationOutput Class Reference

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

#include <SimulationOutput.h>

Public Member Functions

void dumpHostEnergyConsumptionJSON (std::string file_path)
 Writes a JSON file containing host energy consumption information as a JSON array. The JSON array has the following format: More...
 
void dumpPlatformGraphJSON (std::string file_path)
 Writes a JSON file containing all hosts, network links, and the routes between each host. The JSON array has the following format: More...
 
void dumpWorkflowExecutionJSON (Workflow *workflow, std::string file_path, bool generate_host_utilization_layout=false)
 Writes WorkflowTask execution history for each task to a file, formatted as a JSON array. The JSON array has the following format: More...
 
void dumpWorkflowGraphJSON (wrench::Workflow *workflow, std::string file_path)
 Writes a JSON graph representation of the Workflow to a file. A node is added for each WorkflowTask and WorkflowFile. A WorkflowTask will have the type "task" and a WorkflowFile will have the type "file". A directed link is added for each dependency in the Workflow. More...
 
template<class T >
std::vector< SimulationTimestamp< T > * > getTrace ()
 Retrieve a copy of a simulation output trace once the simulation has completed. More...
 

Detailed Description

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

Member Function Documentation

◆ dumpHostEnergyConsumptionJSON()

void wrench::SimulationOutput::dumpHostEnergyConsumptionJSON ( std::string  file_path)

Writes a JSON file containing host energy consumption information as a JSON array. The JSON array has the following format:

[
     {
         hostname: <string>,
         pstates: [                 <-- if this host is a single core host, items in this list will be formatted as
             {                          the first item, else if this is a multi core host, items will be formatted as
                 pstate: <int>,         the second item
                 idle: <double>,
                 running: <double>,   <-- if single core host
                 speed: <double>
             },
             {
                 pstate: <int>,
                 idle: <double>,
                 one_core: <double>,  <-- if multi core host
                 all_cores: <double>, <-- if multi core host
                 speed: <double>
             } ...
         ],
         watts_off: <double>,
         pstate_trace: [
             {
                 time: <double>,
                 pstate: <int>
             }, ...
         ],
         consumed_energy_trace: [
             {
                 time: <double>,
                 joules: <double>
             }, ...
         ]
     }, ...
]
Parameters
file_paththe path to write the file
Exceptions
std::invalid_argument
std::runtime_error

◆ dumpPlatformGraphJSON()

void wrench::SimulationOutput::dumpPlatformGraphJSON ( std::string  file_path)

Writes a JSON file containing all hosts, network links, and the routes between each host. The JSON array has the following format:

{
   vertices: [
       {
           type: <"host">,
           id: <string>,
           flop_rate: <double (flops per second)>,
           memory: <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_paththe path to write the file
Exceptions
std::invalid_argument

◆ dumpWorkflowExecutionJSON()

void wrench::SimulationOutput::dumpWorkflowExecutionJSON ( Workflow workflow,
std::string  file_path,
bool  generate_host_utilization_layout = false 
)

Writes WorkflowTask execution history for each task to a file, formatted as a JSON array. The JSON array has the following format:

   [
     {
         task_id: <string>,
         execution_host: {
             hostname: <string>,
             flop_rate: <double>,
             memory: <double>,
             cores: <unsigned_long>
         },
         num_cores_allocated: <unsigned_long>,
         vertical_position: <unsigned_long>,
         whole_task: { start: <double>, end: <double> },
         read:       { start: <double>, end: <double> },
         compute:    { start: <double>, end: <double> },
         write:      { start: <double>, end: <double> },
         failed: <double>,
         terminated: <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
workflowa pointer to the Workflow
file_paththe path to write the file
generate_host_utilization_layoutboolean specifying whether or not you would like a possible host utilization layout to be generated
Exceptions
std::invalid_argument

◆ dumpWorkflowGraphJSON()

void wrench::SimulationOutput::dumpWorkflowGraphJSON ( wrench::Workflow workflow,
std::string  file_path 
)

Writes a JSON graph representation of the Workflow to a file. A node is added for each WorkflowTask and WorkflowFile. A WorkflowTask will have the type "task" and a WorkflowFile will have the type "file". A directed link is added for each dependency in the Workflow.

{
     vertices: [
         {
             type: <"task">,
             id: <string>,
             flops: <double>,
             min_cores: <unsigned_long>,
             max_cores: <unsigned_long>,
             parallel_efficiency: <double>,
             memory: <double>,
         },
         {
             type: <"file">,
             id: <string>,
             size: <double>
         }, . . .
     ],
     edges: [
         {
             source: <string>,
             target: <string>
         }, . . .
     ]
 }
 
Parameters
workflowa pointer to the workflow
file_paththe path to write the file
Exceptions
std::invalid_argument

◆ getTrace()

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

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

Template Parameters
aparticular SimulationTimestampXXXX class (defined in SimulationTimestampTypes.h)
Returns
a vector of pointers to SimulationTimestampXXXX instances

The documentation for this class was generated from the following files:
  • /home/wrench/wrench/include/wrench/simulation/SimulationOutput.h
  • /home/wrench/wrench/src/wrench/simulation/SimulationOutput.cpp