In computer science, a parallel external memory (PEM) model is a cache-aware, external-memory abstract machine.[1] It is the parallel-computing analogy to the single-processor external memory (EM) model. In a similar way, it is the cache-aware analogy to the parallel random-access machine (PRAM). The PEM model consists of a number of processors, together with their respective private caches and a shared main memory.
Model
...
Read / Write conflicts
...
Complexity measure
...
Examples
Prefixsum
...
Multiway partitioning
...
Selection
The selection problem is to find an item in an unordered list of size which is bigger than other elements in .
PEMSELECT algorithm pseudocode
The code makes use of PRAMSORT which is a PRAM optimal sorting algorithm which runs in , and SELECT, which is a cache optimal single-processor selection algorithm.
ifthenreturnend iffor each processor i in parallel do
//Find median of each end for
// Sort medians
// Partition around median of medians
ifthenreturnelsereturnend if
Under the assumption that the input is stored in contiguous memory, PEMSELECT has an I/O complexity of:
Distribution sort
Distribution sort partitions an input list of size into disjoint buckets of similar size. Every bucket is then sorted recursively and the results are combined into a fully sorted list.
PEMDISTSORT pseudocode
If the task is delegated to a cache-optimal single-processor sorting algorithm.
Otherwise the following algorithm is used:
// Sample elements from foreach processor in parallel doifthen
Load in -sized pages and sort pages individually
else
Load and sort as single page
end if
Pick every 'th element from each sorted memory page into contiguous vector of samples
end forin parallel do
Combine vectors into a single contiguous vector
Make copies of : end do
// Find pivots for to in parallel doend for
Pack pivots in contiguous array
// Partition around pivots into buckets
// Recursively sort buckets
for to in parallel do
recursively call on bucket of size
using processors responsible for elements in bucket end for