next up previous contents
Next: A low-level communication library Up: A high-level communication library Previous: Irregular Collective Communications   Contents

Schedules

Figure 4.5: Jacobi relaxation, re-using communication schedules.
\begin{figure}\small\begin{verbatim}WriteHalo writeHalo = new WriteHalo(a) ;
...
...xation.
} while(maxval.execute() > EPS)) ;\end{verbatim}\normalsize\end{figure}

The collective communication methods introduced in the last few sections involve two phases: an inspector phase in which the arguments are analyzed to determine what communications and local copies will be needed to complete the operation, and an executor phase in which the schedule of these data transfers is actually performed. In iterative algorithms, it often happens that exactly the same communication pattern is repeated many times over. In this case it is wasteful to repeat the inspector phase in every iteration, because the data transfer schedule will be the same every time.

Adlib provides a class of schedule objects for each of its communication functions. The classes generally have the same names as the static methods, with the first letter capitalized (the name may also be extended with a result type). Each class has a series of constructors with arguments identical to the instances of the function. Every schedule class has one public method with no arguments called execute, which executes the schedule.

Using WriteHalo and Maxval schedules, the main loop of the Jacobi relaxation program from section 3.2, Figure 3.4 could be rewritten as in Figure 4.5.


next up previous contents
Next: A low-level communication library Up: A high-level communication library Previous: Irregular Collective Communications   Contents
Bryan Carpenter 2004-06-09