nbodykit: an open-source, massively parallel toolkit for large-scale structure
Nick Hand, Yu Feng, Florian Beutler, Yin Li, Chirag Modi, Uros Seljak, Zachary Slepian
TL;DR
nbodykit delivers a massively parallel, open-source Python toolkit for large-scale structure analysis, unifying canonical LSS algorithms within a modular, component-based framework built atop MPI. It combines interactive, notebook-friendly usage with HPC scalability through distributed Catalogs and Meshes, along with a comprehensive set of cosmology tools, data readers, and fast estimators for power spectra and correlation functions. The framework emphasizes reproducibility, automated testing, and thorough documentation, demonstrated through an illustrative galaxy clustering emulator and extensive performance benchmarks showing strong scaling on leadership-class systems. By integrating mature external libraries (e.g., Corrfunc, Halotools, FastPM) and providing open pathways for community contributions, nbodykit aims to become a standard foundation for future LSS analyses and tools.
Abstract
We present nbodykit, an open-source, massively parallel Python toolkit for analyzing large-scale structure (LSS) data. Using Python bindings of the Message Passing Interface (MPI), we provide parallel implementations of many commonly used algorithms in LSS. nbodykit is both an interactive and scalable piece of scientific software, performing well in a supercomputing environment while still taking advantage of the interactive tools provided by the Python ecosystem. Existing functionality includes estimators of the power spectrum, 2 and 3-point correlation functions, a Friends-of-Friends grouping algorithm, mock catalog creation via the halo occupation distribution technique, and approximate N-body simulations via the FastPM scheme. The package also provides a set of distributed data containers, insulated from the algorithms themselves, that enable nbodykit to provide a unified treatment of both simulation and observational data sets. nbodykit can be easily deployed in a high performance computing environment, overcoming some of the traditional difficulties of using Python on supercomputers. We provide performance benchmarks illustrating the scalability of the software. The modular, component-based approach of nbodykit allows researchers to easily build complex applications using its tools. The package is extensively documented at http://nbodykit.readthedocs.io, which also includes an interactive set of example recipes for new users to explore. As open-source software, we hope nbodykit provides a common framework for the community to use and develop in confronting the analysis challenges of future LSS surveys.
