Skip to content

Dynamic Analysis

bprail edited this page Jul 22, 2017 · 4 revisions

The Dynamic Analysis backend takes in a sequence of LLVM IR instructions and models those instructions on a specified computer architecture, including a model of the cache. The backend specifically will model every task for a specific context within a taskgraph. It provides a table of resource bottlenecks and overall performance for each task.

This backend ($CONTECH_HOME/backend/DynamicAnalysis) is originally based on the dissertation work of Victoria Caparros Cabezas here and then here. The major modification is to switch the code to use a Contech taskgraph for the LLVM IR rather than the LLVM interpreter.

The backend will build with cmake and then make, same as the LLVM instrumentation pass. It requires libboost-dev to be installed on the machine.

It can be run using run.py. This script has internal defaults to configure the Dynamic Analysis based on the Sandybridge microarchitecture. It creates a set of files containing the output of the analysis backend for each context. The script takes four parameters:

  • -b / --bitcode <file> - The bitcode file instrumented by Contech (for example, blackscholes_ct.link.bc)
  • -t / --taskgraph <file> - The taskgraph file generated by running the instrumented program (for example, blackscholes_4_simmedium.taskgraph)
  • -o <directory> - Where to create a subdirectory to write output (default: output/)
  • -n <context count> - How many contexts to process with the backend (default: 9). This value is available via TaskGraph::getNumberOfContexts(); however, no python API currently exists.

The CritPath backend provides one example analysis of these outputs. It has a sequence of three components:

  • genCritPath.py <directory>+
  • critPath <taskgraph> <critpath.bin>
  • plot.py <output from critPath>+

genCritPath.py combines the outputs from each specified directory into a single critpath.bin file. The first directory is the baseline configuration, and any subsequent directories are compared to the baseline to find speedup.

critPath processes the critpath.bin file and applies the speedups for each configuration to find the overall program speedup, possibly observing the critical path in the taskgraph changing as tasks take different execution times.

plot.py generates a plot of the execution time for each task, color coded for each task's type of bottleneck. Can combine multiple outputs into a single plot with subfigures.