Concepts

In traditional software development, programmers create data structures and write functions to manipulate the data. In order for the program to perform operations in parallel, thereby taking advantage of multi-core CPUs, the programmer must call functions within the programming language itself to schedule the execution of the parallel pieces of code.

In a Fabric Engine application, no explicit scheduling of execution is needed; the parallelism is instead expressed through higher-level models. One of these models is the dependency graph model, the subject of this book. A Fabric Engine application builds a dependency graph that describes the computation it needs perform; the Fabric Engine core then automatically executes in parallel operations which are not interdependent. This model requires that the user express data dependencies rather than have them implicit in the program itself. By analyzing these interdependencies, the Fabric code creates an execution schedule that runs independent parts of the computation in parallel; in this way, Fabric achieves task-based parallelism.

In addition, Fabric supports the notion of slicing data. A Node in Fabric is a generic, typed data container that has one or more members that contain data; each Node also has a slice count N, and the Node acts as if it were N independent copies of the same data that are operated on in parallel. In this way, Fabric achieves data-based (or SIMD) parallelism. For more information on Nodes, members, and slice counts, see Nodes.

In addition to the dependency graph, Fabric provides a method of traversing the Nodes in the dependency graph through objects called Events and EventHandlers. The Fabric SceneGraph uses Events and EventHandlers to draw OpenGL viewports in its rendering system. For more information on Events and EventHandlers, see Event Graphs, Events and EventHandlers.

The actual code that performs computation in Fabric is contained in objects called Operators. Operators can then be bound to Nodes and EventHandlers using glue objects called Bindings; Bindings tell Fabric what data should be passed to the functions defined in the code in an Operator. For more information on Operators, see Operators and Bindings.