input is array initially 0 and 1 when task is done
uses 3 binary trees of size to:
enumerate
allocate processors
estimate progress
perform work is assumed but can be upto without impact on time/work complexity.
Pseudocode
1 2 3 4 5 6 7 8 910111213
forall processors PID=1..n parbegin
Phase W3: Visit leaves based on PID to perform work,
i.e., write to the input tasks
Phase W4: Traverse the done tree bottom up to measure progress.
while the root of the done tree is not n do:
Phase W1: Traverse tree count bottom-up to enumerate processors
Phase W2: Traverse trees done, aux, count top down to
allocate processors
Phase W3: Perform work, i.e., write to the input tasks
Phase W4: Traverse the done tree bottom up to measure progress
od
parend.
Complexity
Work of the algorithm is determined by (cost of block steps iterations).