BCL: A Cross-Platform Distributed Data Structures Library

Benjamin Brock, Aydin Buluç, Katherine A. Yelick

TL;DR

This paper introduces the Berkeley Container Library (BCL), a C++ library providing high-performance, cross-platform distributed data structures like hash tables and queues. BCL aims to simplify irregular parallel programming by offering abstractions that leverage one-sided communication, achieving performance competitive with hand-optimized code while hiding complex low-level details.

What Problem Does This Paper Address?

Writing parallel programs for supercomputers is notoriously difficult, especially for applications with irregular data access patterns and complex communication needs. While Partitioned Global Address Space (PGAS) languages and MPI's one-sided communication primitives offer powerful tools for asynchronous, irregular parallelism, they often lack high-level, application-specific libraries. This forces developers to either implement complex data structures from scratch or rely on less efficient, general-purpose solutions. The paper addresses this gap by providing a library of generic, high-performance distributed data structures that can be used across various PGAS environments and MPI, simplifying the development of irregular parallel applications.

Methods

The core of BCL is an internal Domain-Specific Language (DSL) called the BCL Core. This DSL provides a high-level PGAS memory model using "global pointers" and offers one-sided communication primitives like remote get and put operations. Crucially, the BCL Core supports multiple backends, including MPI, OpenSHMEM, GASNet-EX, and UPC++, allowing BCL data structures to be used natively within programs written in any of these environments.

A key innovation is the BCL ObjectContainer abstraction. This allows BCL data structures to transparently serialize and deserialize complex data types without introducing overhead for primitive, byte-copyable types. This is achieved through C++ compile-time type introspection.

BCL implements a variety of distributed data structures, including:

  • Hash Tables (BCL::HashMap): Using open addressing with quadratic probing, these support atomic insert and find operations without explicit remote coordination, leveraging RDMA where available.
  • Queues (BCL::CircularQueue, BCL::FastQueue): These enable asynchronous many-to-many data redistribution, crucial for patterns like sorting and histogramming.
  • Bloom Filters (BCL::BloomFilter): A distributed, blocked Bloom filter is provided for space-efficient set membership queries.
  • Hash Table Buffer (BCL::HashMapBuffer): This structure optimizes insert-heavy phases by buffering insertions and flushing them in batches, significantly improving performance for phasal applications.

A novel concept introduced is Concurrency Promises. These allow users to optionally specify invariants about the execution context (e.g., only find operations will occur concurrently), enabling BCL to select more optimized, less atomic implementations of data structure operations, further boosting performance.

Datasets

The paper evaluates BCL's performance using:

  • ISx Benchmark: An integer sorting mini-application.
  • Meraculous Benchmark: A mini-application from a large-scale genomics application (contig generation).
  • k-mer Counting Benchmark: Another component of genome assembly.
  • Microbenchmarks: To isolate the performance of individual data structure operations and backends.

The benchmarks were run on three different HPC systems: Cori Phase I, Summitdev, and AWS c3.4xlarge. The paper also references existing implementations of these benchmarks in MPI, OpenSHMEM, and Chapel for comparison.

Key Insights and Ideas

  • Bridging the Abstraction Gap: BCL successfully bridges the gap between low-level one-sided communication primitives and the need for high-level, application-friendly data structures in irregular parallel programming.
  • Performance without Complexity: The library demonstrates that it's possible to achieve performance competitive with hand-optimized code while hiding significant underlying complexity related to message aggregation, serialization, and synchronization.
  • The Power of Concurrency Promises: The concurrency promises mechanism is a clever way to expose performance optimizations to users without requiring them to understand the intricate details of atomic operations and synchronization. It allows for a trade-off between atomicity and performance based on application knowledge.
  • ObjectContainers for Heterogeneous Data: The ObjectContainer abstraction is crucial for handling complex, user-defined data types in distributed memory, a common challenge in scientific computing.
  • BCL Core's Backend Agnosticism: The ability to run on multiple communication backends (MPI, OpenSHMEM, GASNet-EX, UPC++) is a significant advantage for portability and performance tuning across diverse HPC architectures.

Key Results

  • Competitive Performance: BCL's implementations of the ISx and Meraculous benchmarks were competitive with, and in some cases exceeded, hand-optimized reference implementations (MPI, OpenSHMEM, Chapel) and other high-performance libraries (PapyrusKV).
  • Significant Speedups with Buffering: The HashMapBuffer demonstrated an order-of-magnitude performance improvement for insert-heavy phases in the Meraculous benchmark, highlighting the benefits of batching latency-bound operations.
  • Optimized Finds are Faster: Optimized find operations in the hash table, leveraging concurrency promises, showed a 2-3x performance improvement compared to fully atomic versions.
  • Scalability and Portability: BCL demonstrated good weak scaling on the ISx benchmark across different systems and architectures, showcasing its portability.
  • GASNet-EX Advantage: On Ethernet networks, the GASNet-EX backend generally outperformed the MPI backend, especially for operations heavily reliant on atomic operations.

Limitations and Future Work

  • Fixed-Size Hash Tables: A current limitation is that BCL hash tables are initialized to a fixed size and do not dynamically resize, meaning insertions can fail if the table becomes full. The authors plan to support dynamic resizing in the future.
  • Manual Concurrency Promise Specification: While powerful, concurrency promises require users to explicitly specify invariants. The authors acknowledge that automatic identification of these opportunities would require static analysis tools or specialized programming languages.
  • UPC++ Backend Experimental: The UPC++ backend was noted as experimental at the time of writing.

Future work could involve exploring more sophisticated concurrency promise mechanisms, automatic optimization identification, and expanding the library with additional data structures.

Summary updated

BibTeX
@inproceedings{brock2019bcl,
  author = {Benjamin Brock and Aydin Buluç and Katherine A. Yelick},
  title = {{BCL: A Cross-Platform Distributed Data Structures Library}},
  booktitle = {ICPP},
  year = {2019},
  doi = {10.1145/3337821.3337912},
}
Figure