Skip to content

cheng-zhao/FCFC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast Correlation Function Calculator (FCFC)

GitHub Codacy grade

Table of Contents

Introduction

Fast Correlation Function Calculator (FCFC) is a C toolkit for computing correlation functions from pair counts. It is designed in the hope of being (both time and space) efficient, portable, and user-friendly.

So far the following products are supported:

  • Isotropic 2-point correlation function (2PCF, a.k.a. radial distribution function): ξ(s);
  • Anisotropic 2PCF: ξ(s, μ);
  • 2-D 2PCF: ξ(sperp, spara), also known as ξ(sperp, π);
  • 2PCF Legendre multipoles: ξ(s);
  • Projected 2PCF: wp(sperp).

FCFC takes advantage of 3 parallelisms that can be used simultaneously:

  • Distributed-memory processes via Message Passing Interface (MPI);
  • Shared-memory threads via Open Multi-Processing (OpenMP);
  • Single instruction, multiple data (SIMD).

This program is compliant with the ISO C99 and IEEE POSIX.1-2008 standards, and no external library is mandatory. Thus it is compatible with most modern C compilers and operating systems. Optionally, FITS and HDF5 file formats can be supported through external libraries (see Compilation).

FCFC is written by Cheng Zhao (赵成), and is distributed under the MIT license. If you use this program in research work that results in publications, please cite the following paper:

Zhao et al. 2020, arXiv:2007.08997

[TOC]

Compilation

The building of FCFC is based on the make utility. Customisable compilation options can be set in the file options.mk, as summarised below:

Option Description Dependences
CC Set the C compiler
MPICC Set the C compiler that supports MPI
CFLAGS Set optimisation flags of the C compiler
WITH_MPI T for enabling MPI parallelism MPICC
WITH_OMP T for enabling OpenMP parallelism
(Specify the corresponding compiler flag via OMP_FLAG)
The OpenMP library and compiler support
WITH_SIMD T for enabling SIMD parallelism Advanced Vector Extensions (AVX/AVX2/AVX-512) and compiler support
SINGLE_PREC T for using single precision for floating-point calculations
WITH_MU_ONE T for including μ=1 in the last μ bin of pair counts in (s, μ)
WITH_CFITSIO T for enabling FITS format inputs
(Set the directories containing header and library files via CFITSIO_INC_DIR and CFITSIO_LIB_DIR respectively)
The CFITSIO library
WITH_HDF5 T for enabling HDF5 format inputs
(Set the directories containing header and library files via HDF5_INC_DIR and HDF5_LIB_DIR respectively)
The HDF5 library

Once the setting is done, the following command should compile the code:

make

The compilation options used for an executable can be checked with the --version or -V command line flags, e.g.,

./FCFC_2PT -V

To compile only a certain component of the program (see Components and configurations), the name of the component can be supplied via

make [COMPONENT_NAME]

[TOC]

Components and configurations

FCFC comes along with several components for different tasks. They are served as separate executables, and have to be supplied the corresponding configurations, either via command line options or a text file with configuration parameters.

The list of available command line options can be consulted using the -h or --help flags, and a template configuration file can be printed via the -t or --template flags.

An introduction of the components and the corresponding configuration parameters are listed below:

Component Description Configuration parameters
FCFC_2PT Compute 2PCF for survey-like data FCFC_2PT.md
FCFC_2PT_BOX Compute 2PCF for periodic simulation boxes* FCFC_2PT_BOX.md

*: treat the 3rd dimension (z-direction) as the line of sight

[TOC]

Acknowledgements

This program benefits from the following open-source projects:

[TOC]