Skip to content

Writing Backends

bprail edited this page Feb 24, 2015 · 2 revisions

Backends are the core of the analysis work on Contech Task Graphs. A backend performs some analysis and computation on the tasks in the graph. The task graph design assumes that analyses are focused on the data and / or computation in work tasks, and not just the structure of the graph.

While developers can access the task graph directly, for most applications, the recommendation is to develop his or her backend by inheriting from the backend class in the tasklib (common/taskLib/backend.hpp). These backends then operate by being passed to a SimpleBackendWrapper, which handles the setup and traversal of the task graph.

Backends so inheriting from the backend class have four interface routines:

  • initBackend(TaskGraphInfo*) - One time initialization of the backend, including operations on the task graph info (which is valid for the lifetime of the program)
  • resetBackend() - Sets the backend back to a known state without reinvoking the constructor
  • updateBackend(Task*) - Update the backend analysis by examining the provided task, the task pointer is only valid for the duration of the call
  • completeBackend(FILE*, TaskGraphInfo *) - Output known results to the file pointer