Skip to main content
QUICK REVIEW

[Paper Review] Fast Correlation Function Calculator -- A high-performance pair counting toolkit

Cheng Zhao|arXiv (Cornell University)|Jan 29, 2023
Error Correcting Code TechniquesComputer Science3 citations
TL;DR

This paper introduces Fast Correlation Function Calculator (FCFC), a high-performance, portable, and scalable toolkit for exact pair counting in cosmological correlation function measurements. It employs optimized data structures (k-d tree and ball tree variants) and a novel index lookup-based histogram update algorithm, achieving up to 10× speedup over existing codes like Corrfunc on modern AVX-512 CPUs for large-scale 3D datasets with 10⁸ objects and fine binning.

ABSTRACT

Context. A novel high-performance exact pair counting toolkit called Fast Correlation Function Calculator (FCFC) is presented, which is publicly available at https://github.com/cheng-zhao/FCFC. Aims. As the rapid growth of modern cosmological datasets, the evaluation of correlation functions with observational and simulation catalogues has become a challenge. High-efficiency pair counting codes are thus in great demand. Methods. We introduce different data structures and algorithms that can be used for pair counting problems, and perform comprehensive benchmarks to identify the most efficient ones for real-world cosmological applications. We then describe the three levels of parallelisms used by FCFC -- including SIMD, OpenMP, and MPI -- and run extensive tests to investigate the scalabilities. Finally, we compare the efficiency of FCFC against alternative pair counting codes. Results. The data structures and histogram update algorithms implemented in FCFC are shown to outperform alternative methods. FCFC does not benefit much from SIMD as the bottleneck of our histogram update algorithm is mostly cache latency. Nevertheless, the efficiency of FCFC scales well with the numbers of OpenMP threads and MPI processes, albeit the speedups may be degraded with over a few thousand threads in total. FCFC is found to be faster than most (if not all) other public pair counting codes for modern cosmological pair counting applications.

Motivation & Objective

  • To address the growing computational challenge of measuring correlation functions in modern cosmological datasets with billions of objects.
  • To develop a highly efficient, scalable, and portable pair counting toolkit that supports exact 2PCF calculations for 3D data.
  • To optimize performance across multiple parallelization levels: SIMD, OpenMP, and MPI, for heterogeneous HPC environments.
  • To outperform existing public pair counting codes in terms of speed and scalability for realistic cosmological applications.
  • To enable efficient computation of correlation functions with arbitrary binning schemes, including multi-dimensional bins for anisotropic measurements.

Proposed method

  • Employs k-d tree and a novel variant of ball tree as primary data structures, which are robust and parameter-free compared to regular grids.
  • Introduces an index lookup-based histogram update algorithm that accelerates binning of pair separations, especially for non-integer bin edges.
  • Combines reverse traversal with lookup tables to efficiently locate histogram bins, supporting arbitrary binning schemes including multi-dimensional bins.
  • Implements three levels of parallelism: SIMD for vectorized operations, OpenMP for shared-memory threading, and MPI for distributed-memory scaling.
  • Uses a dual-tree algorithm for pair counting in tree-based structures to reduce computational complexity.
  • Conducts comprehensive benchmarks across different data structures, binning schemes, and parallelization levels to guide implementation choices.

Experimental results

Research questions

  • RQ1Which data structure—regular grids, k-d trees, or ball trees—yields the best performance for cosmological pair counting with large 3D catalogs?
  • RQ2How does the proposed index lookup-based histogram update algorithm compare to conventional methods in terms of speed and generality across binning schemes?
  • RQ3To what extent does FCFC scale with increasing numbers of OpenMP threads and MPI processes in distributed HPC environments?
  • RQ4Can FCFC outperform state-of-the-art public pair counting codes like Corrfunc in real-world cosmological settings with large datasets and fine binning?
  • RQ5What are the performance bottlenecks in FCFC, particularly regarding SIMD utilization, and how do they affect overall efficiency?

Key findings

  • The index lookup-based histogram update algorithm significantly outperforms conventional methods across all tested binning schemes, including non-uniform and multi-dimensional bins.
  • Tree-based data structures (k-d tree and ball tree variants) consistently outperform regular grids, especially when grid size is suboptimal, and show similar performance to each other.
  • FCFC scales well with OpenMP threads and MPI processes, though speedup degrades when total thread counts exceed a few thousand due to resource contention.
  • FCFC does not benefit substantially from SIMD parallelization because the histogram update step is limited by CPU cache latency rather than arithmetic intensity.
  • FCFC is faster than Corrfunc by up to 10× on modern AVX-512 CPUs for 10⁸-object catalogs with 200 linear s-bins and 120 μ-bins, a common configuration in 2PCF analysis.
  • The toolkit is highly portable, flexible, and user-friendly, supporting a wide range of practical applications beyond cosmology, such as radial distribution functions in statistical mechanics.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.