Download Sequoia++ User Manual

Transcript
of the machine’s specific memory hierarchy are instantiated by a mapping in which the programmer states
how each task is specialized to the machine. The mapping of a task has two parts. First, the task’s data
(arguments and local variables) is assigned to a specific level of the memory hierarchy. The memory level
has a specific size and the task’s data must fit within that size; the mapping also specifies whether this size
is checked statically by the compiler or at run-time when the task is called. Second, the task’s computation
is assigned to a specific processor in the machine that has access to the level of the hierarchy where the
task’s data will reside. Mappings of the same program to different machines are often very different. A
Sequoia program does not itself mention the machine-specific details in a mapping and is therefore machine
independent and relatively easy to port; in our experience writing a mapping for an existing Sequoia program
to target a new machine is usually straightforward.
If a task whose data is mapped to a memory in level i of the machine calls a subtask whose data is
mapped to level i − 1, when the task at level i makes its subtask call the arguments will be physically copied
from level i to level i − 1; similarly, when the subtask completes data returned from level i − 1 is copied back
to the calling task in level i. Movement of data in a task call or return is the only form of communication
in Sequoia.
The Sequoia compiler and runtime automatically use the appropriate hardware or software mechanisms
to implement the data transfers. In fact, this is one of the major benefits of programming in Sequoia, as the
programmer only uses one way of communicating data and the compiler generates the code that uses the
appropriate API for moving data between the two concrete levels of the memory hierarchy, whether that be
via MPI calls, DMAs, explicit loads and stores, etc. The compiler also removes as many copies as possible
via program optimizations, including copies introduced by copying arguments to tasks. It is also possible to
manually (and unsafely) turn off some copying via specifications in the mapping file.
7