next up previous contents index
Next: Low level SPMD programming Up: A Distributed Array Communication Previous: I/O   Contents   Index


In general the collective methods introduced in the last few sections involve two phases: an inspector phase in which the arguments are analysed to determine what communications and local copying operations will be needed to complete the collective method, 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 round.

Adlib provides a class of schedule objects associated with each of its communication functions. These schedules belong to the package hpjava.adlib.schedule. The classes generally have the same names as the static functions, with the first letter capitalized. Relevant type information (e.g. the type of argument array elements) is usually appended to the end of the name. Each class has a series of constructors with arguments identical to the method interfaces. Every schedule class has one public method with no arguments called execute, which executes the schedule. In some cases (e.g. reduction schedules) the execute method returns a numeric value.

Using WriteHalo and Maxval schedules, the main loop of the red-black relaxation program from section 3.2, Figure 3.11 could be rewritten as in Figure 6.2.

Figure 6.2: Red-black relaxation, re-using communication schedules.

} while(maxval.execute() > EPS) ;\end{verbatim}\end{minipage}\end{displaymath}

The complete set of schedule classes in the hpjava.adlib.schedule package includes: RemapBoolean, RemapByte, RemapChar, RemapDouble, RemapFloat, RemapInt, RemapLong, RemapObject, RemapShort, ShiftBoolean, ShiftByte, ShiftChar, ShiftDouble, ShiftFloat, ShiftInt, ShiftLong, ShiftObject, ShiftShort, WriteHaloBoolean, WriteHaloByte, WriteHaloChar, WriteHaloDouble, WriteHaloFloat, WriteHaloInt, WriteHaloLong, WriteHaloObject, WriteHaloShort, MaxvalByte, MaxvalChar, MaxvalDouble, MaxvalFloat, MaxvalInt, MaxvalLong, MaxvalShort, MinvalByte, MinvalChar, MinvalDouble, MinvalFloat, MinvalInt, MinvalLong, MinvalShort, SumByte, SumChar, SumDouble, SumFloat, SumInt, SumLong, SumShort, ProductByte, ProductChar, ProductDouble, ProductFloat, ProductInt, ProductLong, ProductShort, Any, All, Count, MaxlocByte, MaxlocChar, MaxlocDouble, MaxlocFloat, MaxlocInt, MaxlocLong, MaxlocShort, MinlocByte, MinlocChar, MinlocDouble, MinlocFloat, MinlocInt, MinlocLong, MinlocShort, DotProductByteByte, DotProductCharByte, DotProductCharChar, DotProductCharInt, DotProductCharLong, DotProductCharShort, DotProductDoubleByte, DotProductDoubleChar, DotProductDoubleDouble, DotProductDoubleFloat, DotProductDoubleInt, DotProductDoubleLong, DotProductDoubleShort, DotProductFloatByte, DotProductFloatChar, DotProductFloatFloat, DotProductFloatInt, DotProductFloatLong, DotProductFloatShort, DotProductIntByte, DotProductIntInt, DotProductIntShort, DotProductLongByte, DotProductLongInt, DotProductLongLong, DotProductLongShort, DotProductShortByte, DotProductShortShort, MaxvalDimByte, MaxvalDimChar, MaxvalDimDouble, MaxvalDimFloat, MaxvalDimInt, MaxvalDimLong, MaxvalDimShort, MinvalDimByte, MinvalDimChar, MinvalDimDouble, MinvalDimFloat, MinvalDimInt, MinvalDimLong, MinvalDimShort, SumDimByte, SumDimChar, SumDimDouble, SumDimFloat, SumDimInt, SumDimLong, SumDimShort, ProductDimByte, ProductDimChar, ProductDimDouble, ProductDimFloat, ProductDimInt, ProductDimLong, ProductDimShort, AnyDim, AllDim, CountDim, MaxlocDimByte, MaxlocDimChar, MaxlocDimDouble, MaxlocDimFloat, MaxlocDimInt, MaxlocDimLong, MaxlocDimShort, MinlocDimByte, MinlocDimChar, MinlocDimDouble, MinlocDimFloat, MinlocDimInt, MinlocDimLong, MinlocDimShort, GatherBoolean, GatherByte, GatherChar, GatherDouble, GatherFloat, GatherInt, GatherLong, GatherObject, GatherShort, ScatterBoolean, ScatterByte, ScatterChar, ScatterDouble, ScatterFloat, ScatterInt, ScatterLong, ScatterObject, and ScatterShort.

next up previous contents index
Next: Low level SPMD programming Up: A Distributed Array Communication Previous: I/O   Contents   Index
Bryan Carpenter 2003-04-15