next up previous contents
Next: Pseudocode for `Estimate Range' Up: Mapping Nodes to Processors Previous: Example

Pseudocode for mapping function

When we are mapping nodes to processors we work with ( ranges) of processors at each step, denoted [a, b]. So we begin with processors [1, n], where n is the total number of processors involved in the computation. We assume that we have a subdividing function Subsection(r, p, q) that divides r into q subsections and returns the pth. We also need another function Lastsection(r, p, q) , that divides r into q sub sections and returns the sections $p+1 \ldots q$ as one combined range. We assume that the directions in each level are numbered so that the directions that do not commute with any of the others are placed first. We take a path p and calculate which processor to allocate it to.


 
Figure 4.3: Node mapping function
\begin{figure}
\begin{verbatim}
Range r = [1, n]
i = first direction in p
while(...
 ...ree)
 i -\gt next direction in p
}
return minimum of r\end{verbatim}\end{figure}



Timothy Lewis
11/12/1997