PAM library explained

PAM (Parallel Augmented Maps) is an open-source parallel C++ library implementing the interface for sequence, ordered sets, ordered maps, and augmented maps.[1] The library is available on GitHub. It uses the underlying balanced binary tree structure using join-based algorithms. PAM supports four balancing schemes, including AVL trees, red-black trees, treaps and weight-balanced trees.

PAM is a parallel library and is also safe for concurrency. Its parallelism can be supported by cilk, OpenMP or the scheduler in PBBS. Theoretically, all algorithms in PAM are work-efficient and have polylogarithmic depth. PAM uses underlying persistent tree structure such that multi-versioning is allowed. PAM also supports efficient GC.

Interface

Sequences

To define a sequence, users need to specify the key type of the sequence.

PAM supports functions on sequences including construction, find an entry with a certain rank, first, last, next, previous, size, empty, filter, map-reduce, concatenating, etc.

Ordered sets

To define an ordered set, users need to specify the key type and the comparison function defining a total ordering on the key type.

On top of the sequence interface, PAM also supports functions for ordered sets including insertion, deletion, union, intersection, difference, etc.

Ordered maps

To define an ordered map, users need to specify the key type, the comparison function on the key type, and the value type.

On top of the ordered set interface, PAM also supports functions for ordered maps, such as insertion with combining values.

Augmented maps

To define an augmented map, users need to specify the key type, the comparison function on the key type, the value type, the augmented value type, the base function, the combine function and the identity of the combine function.

On top of the ordered map interface, PAM also supports functions for augmented maps, such as aug_range.

In addition to the tree structures, PAM also implements the prefix structure for augmented maps.

Implementation for Example Applications

The library also provides example implementations for a number of applications, including 1D stabbing query (using interval trees, 2D range query (using a range tree and a sweepline algorithm), 2D segment query (using a segment tree and a sweepline algorithm), 2D rectangle query (using a tree structure and a sweepline algorithm), inverted index searching, etc.

Used in applications

The library has been tested in various applications, including database benchmarks,[2] 2D segment tree,[3] 2D interval tree,[1] inverted index[1] and multiversion concurrency control.[4]

External links

Notes and References

  1. Sun . Yihan . Ferizovic . Daniel . Belloch . Guy E. . PAM: parallel augmented maps . ACM SIGPLAN Notices . 23 March 2018 . 53 . 1 . 290–304 . 10.1145/3200691.3178509 . 5 September 2020 . 0362-1340.
  2. Sun . Yihan . Blelloch . Guy E. . Lim . Wan Shen . Pavlo . Andrew . On supporting efficient snapshot isolation for hybrid workloads with multi-versioned indexes . Proceedings of the VLDB Endowment . 1 October 2019 . 13 . 2 . 211–225 . 10.14778/3364324.3364334 . 204841857 . 2150-8097.
  3. Sun . Yihan . Blelloch . Guy E. . Parallel Range, Segment and Rectangle Queries with Augmented Maps . 2019 Proceedings of the Meeting on Algorithm Engineering and Experiments (ALENEX) . 1 January 2019 . 159–173 . 10.1137/1.9781611975499.13 . Society for Industrial and Applied Mathematics. 978-1-61197-549-9 . free . 1803.08621 .
  4. Book: Ben-David . Naama . Blelloch . Guy E. . Sun . Yihan . Wei . Yuanhao . The 31st ACM Symposium on Parallelism in Algorithms and Architectures . Multiversion Concurrency with Bounded Delay and Precise Garbage Collection . 17 June 2019 . 241–252 . 10.1145/3323165.3323185 . Association for Computing Machinery. 9781450361842 . free .