CORRFUNC  a suite of blazing fast correlation functions on the CPU
Abstract
The twopoint correlation function (2PCF) is the most widely used tool for quantifying the spatial distribution of galaxies. Since the distribution of galaxies is determined by galaxy formation physics as well as the underlying cosmology, fitting an observed correlation function yields valuable insights into both. The calculation for a 2PCF involves computing pairwise separations and consequently, the computing timescales quadratically with the number of galaxies. The nextgeneration galaxy surveys are slated to observe many millions of galaxies, and computing the 2PCF for such surveys would be prohibitively timeconsuming. Additionally, modern modelling techniques require the 2PCF to be calculated thousands of times on simulated galaxy catalogues of at least equal size to the data and would be completely unfeasible for the nextgeneration surveys. Thus, calculating the 2PCF forms a substantial bottleneck in improving our understanding of the fundamental physics of the Universe, and we need highperformance software to compute the correlation function. In this paper, we present CORRFUNC  a suite of highly optimized, OPENMP parallel clustering codes. The improved performance of CORRFUNC arises from both efficient algorithms as well as software design that suits the underlying hardware of modern CPUs. CORRFUNC can compute a wide range of 2D and 3D correlation functions in either simulation (Cartesian) space or onsky coordinates. CORRFUNC runs efficiently in both single and multithreaded modes and can compute a typical twopoint projected correlation function [w_{p}(r_{p})] for ∼1 million galaxies within a few seconds on a single thread. CORRFUNC is designed to be both userfriendly and fast and is publicly available at https://github.com/manodeep/Corrfunc.
 Publication:

Monthly Notices of the Royal Astronomical Society
 Pub Date:
 January 2020
 DOI:
 10.1093/mnras/stz3157
 arXiv:
 arXiv:1911.03545
 Bibcode:
 2020MNRAS.491.3022S
 Keywords:

 methods: numerical;
 galaxies: general;
 galaxies: haloes;
 dark matter;
 largescale structure of Universe;
 cosmology: theory;
 Astrophysics  Cosmology and Nongalactic Astrophysics;
 Astrophysics  Astrophysics of Galaxies;
 Physics  Computational Physics
 EPrint:
 Accepted for publication to MNRAS