== Code Visualization == Execution graph generated in one of Hydra^''VM''^'s [wiki:Architecture 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 Hydra^''VM''^.) The following commands show an example of using Hydra^''VM''^'s visualization feature. The second line uses the generated representation from Hydra^''VM''^ to generate graph using the [http://www.graphviz.org GraphViz] tool. {{{ .//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 a package using the commands, '-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' represent 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 represents a read and red edge represents a write.[[BR]] The graph can be simplified by filtering out memory access (i.e., variable access) and favoring control flow by the following command. {{{ .//rvm -X:hydra:dumb=true -X:hydra:class=Test -X:hydra:novar=true Test > plotXX }}} === Examples === We used Hydra^''VM''^ to generate execution graphs of the [http://www-ali.cs.umass.edu/DaCapo/benchmarks.html JOlden benchmark], which is a Java version of the [http://www.martincarlisle.com/olden.html Olden Benchmark]. The following links display the execution graphs for a sample set of applications from this benchmark suite: * [/chrome/site/jolden/tsp.pdf TSP]: probabilistic analysis of partitioning algorithms for the traveling salesman problem * [/chrome/site/jolden/em3d.pdf EM3D]: electromagnetic waves through objects in three dimensions * [/chrome/site/jolden/health.pdf Health]: Columbian health-care system * [/chrome/site/jolden/mst.pdf MST]: minimum spanning tree of a graph using Bentley's algorithm * [/chrome/site/jolden/perimeter.pdf Perimeter]: perimeters of regions in images represented by Quadtrees * [/chrome/site/jolden/power.pdf Power]: decentralized optimal power pricing * [/chrome/site/jolden/treeadd.pdf TreeAdd]: recursive depth first traversal of a binary tree, and summing up the value of each element in the tree ---- This work is supported in part by AFOSR under grant FA9550-14-1-0187. Any opinions, findings, and conclusions or recommendations expressed in this site are those of the author(s) and do not necessarily reflect the views of AFOSR.