wiki:Visualization

Version 3 (modified by binoy, 54 years ago) (diff)

--

Code Visualization

Execution graph generated in one of HydraVM's four phases can be a useful utility in day-to-day development or in tuning and optimization, as it can give hints about parallel execution patterns or hot-spot code, which is a candidate for further manual optimization and code rewriting. We also generate a graphical representation of the execution graph. (This is an optional feature of HydraVM.)

The following commands shows an example of using HydraVM's visualization feature. The second line uses the generated representation from HydraVM to generate graph using the GraphViz tool.

./<hydra vm directory>/rvm -X:hydra:dumb=true -X:hydra:class=Test Test > plotXX
dot -Tps plotXX -o graphXX.ps

We can narrow the visualization output to the scope of one class or certain package using '-X:hydra:class=...' and '-X:hydra:package=...' respectively.

The generated graph is composed of nodes that represent blocks and variables, and edges that show the access frequency or the type of operation on variables (read or write). Nodes starting with 'B' represent basic blocks, and it is followed by a number in which the higher order digits constitute the method identifier and the lower order digits constitute the block identifier. Nodes with prefix 'V' are the variables. The number following 'V' indicates whether the variable is global or local: global if the number is larger than 1000; local otherwise. Edges connecting the blocks are weighted with the number of times program flow has moved between the respective two blocks. Edges connecting the blocks to the variables represent memory access from the blocks to the variables: green edge represent a read and red represent a write.

The graph can be simplified by filtering out memory access (i.e., variable access) and favoring control flow by the following command.

./<hydra vm directory>/rvm -X:hydra:dumb=true -X:hydra:class=Test -X:hydra:novar=true Test > plotXX

Examples

We used HydraVM to generate execution graphs of the JOlden benchmark, which is a Java version of the Olden Benchmark. The following links display the execution graphs for a sample set of applications:

  • TSP: probabilistic analysis of partitioning algorithms for the traveling salesman problem
  • EM3D: electromagnetic waves through objects in three dimensions
  • Health: Columbian health-care system
  • MST: minimum spanning tree of a graph using Bentley's algorithm
  • Perimeter: perimeters of regions in images represented by Quadtrees
  • Power: decentralized optimal power pricing
  • TreeAdd: recursive depth first traversal of a binary tree, and summing up the value of each element in the tree