Introduction to CODE

CODE Tutorial



Overview

CODE is a visual parallel programming system. It can be thought of as a framework, allowing a user to compose sequential code into a parallel program. The fundamental idea is that users create parallel programs by drawing and annotating graphs. A graph is a diagram that consists of nodes (represented by icons in CODE) and arcs that interconnect the nodes. Such a diagram shows a computation's communication structure. Nodes represent computations and arcs represent the flow of data from one computation to another. Parallel programs are then created by composing nodes into graphs -- users draw the nodes and then interconnect them with arcs.

Here is the standard way of creating a program with CODE: first, the user draws the graph that shows the parallel program's communication structure. Then the user annotates this graph by filling in forms that describe properties of the nodes and arcs in the graph. For example, the user must specify the sequential computation a node performs. Finally, the user runs the program, which CODE translates, compiles, and executes.


A Simple Example

When a user first runs CODE, an empty window appears. The graph may then be drawn in this window. CODE graphs can contain several different node types which have different meanings and uses. Each different node type is represented by a different icon. The most important type of node is a computation node, which represents a sequential computation. These nodes may be composed to form parallel programs by drawing arcs which define the data flow between them. The figure below shows a complete CODE program that uses only computation nodes and arcs.

CODE program

This program integrates a function over an interval by dividing the interval in half and integrating over each piece separately. The results are added to form the final answer. The program consists of four computation nodes. The arcs represent data created by one computation and needed by another. When the program runs, it first executes (or "fires") the computation node called Split_Interval which divides the interval in half and sends the endpoints of the sub-intervals to each of the Integ_Half nodes.

These nodes integrate a function over the interval they receive from Split_Interval. They can run in parallel with each other since there are no arcs between them. The node Sum_and_Print waits for the results of these two integrations and then prints their sum.



Annotating the Graph

Drawing the graph is the first part of creating a CODE program; annotating it comes next. Where the graph defines the parallel structure of the program, the annotations define aspects of the program like what computations are performed, under what conditions a node may fire, data types defined for the program, etc. Annotations are added by filling out each object's annotation form. The figure below shows the annotation form for the computation node Split_Interval. (Note: annotation forms are displayed by using the information tool (the "i" in the upper left-hand corner of the screen above) and clicking on the CODE object.)

CODE program

Notice that the "Start Node" option is selected. This means that this node is the first one to be executed when the program begins. There is only one start node allowed. Likewise, only one "Stop Node" is allowed, and when it fires, the program execution ends.

The sequential computation defined by this node is part of the "Specification." This specification also includes the mapping between data on the incoming and outgoing arcs and local data used by the computation, as well as conditions under which the node is allowed to fire. We will discuss the details of specifications in the next section.



Introductionhome page o specifications


Introduction to CODE / emery@cs.utexas.edu / Last updated 15 August 1995