Skip to content

Task API

bprail edited this page Oct 10, 2014 · 4 revisions

Task graphs are analyzed through the task API, which is a set of functions that support reading tasks from disk, querying their types, as well as relation to other tasks. This code resides in common/TaskLib, which generates a library to be linked into every backend analysis tool.

The core class is a Task. This class has several methods for accessing its data, centered around the following types:

  • Task Type (create, join, sync, barrier, basic block (i.e., work))
  • Predecessors and Successors
  • Actions (basic blocks and memory accesses)
  • Start and end timestamps (note these are not adjusted for instrumentation overhead)

There are also three types of IDs, which are used to define partitions and sequences on the set of tasks in the task graph.

  • TaskID - 64bit value uniquely identifying every task in the graph
  • ContextID - 32bit value identifying a software context (thread, work item, etc) that executed this task
  • SequenceID - 32bit value giving an order to the tasks that have the same ContextID

For most analysis, these types are sufficient. There is partial support for identifying the source code location and assembly instructions that correspond to a basic block. There is planned support for associating type information with malloc / new actions.