Our model is composed of map, reduce, upward accumulation, downward accumulation and zip skeletons. The skeletons are polytypic[14] in that they are generically defined for general algebraic data types.
Our model does not force that argument functions for reduce and accumulation to be associative as in [14]. With this freedom, we can fully extract data parallelism from the divide-and-conquer nature of computations on tree-like structures. The associativity of functions can be fully utilized for the efficient implementation of parallel skeletons.
Given a recursive data structure as is defined in the previous section, parallel skeleton functions are generically defined as follows :
Because the implementation of parallel skeletons is not within the
scope of our research, we only summarize well-known results.
The parallel time complexity of
is given by
with enough processors
where
denotes the computing time for
.
Reduce and accumulation are not so simple to implement, and many researchers
applied the tree contraction algorithm for efficient implementation.
The naive implementations of
,
and
have the parallel time complexity of
with enough processors
where
is the height of the tree-like structure.
The tree contraction algorithm can be applied
if each argument function
for each node type can be replaced with a set of functions
on the binary tree representation with no additional time complexity
where partial compositions of the new functions
require constant time and space.
Using the tree contraction algorithm,
,
and
can be computed in
parallel time[22].