Version 2.x (last update of this file 5-Jan-17)
Angpow is being developed at the Linear Accelerateur Laboratory (LAL/CNRS/IN2P3 Univ. Paris-Sud, Univ. Paris-Saclay) - 91898 ORSAY CEDEX - FRANCE main author: J.E Campagne co-authors: J. Neveu, S. Plaszczynski
The authors thank M. Reinecke for fruitful discussions and some tools he give us. Some parts of the code uses spherical Bessel functions as implemented in CLASSgal.
Angpow performs the computation of the angular spectrum
The method used is a mixture of cartesian quadrature in the redshift 2D-space and a Clenshaw-Curtis-Chebyshev algorithm to perform the integral along the
It is also provided once the
Download as Guest:
git clone https://github.com/LSSTDESC/Angpow4CCL
- FFTW >= 3.3.4:
The library is avaliable here. Use ./configure --enable-float --enable-threads --enable-openmp --with-pic --enable-sse
if you compile from sources.
-
Notice that some Bessel part of the Boost (version >= 1.58) library has been extracted and put in the
inc/boost
directory provided by Angpow. -
Compiling the CCL extension will also require GSL
To automatically configure and compile on different platforms follow this procedure:
$ mkdir build && cd build
$ cmake ..
$ make
$ make install # optional
Note: This is the default install procedure, but depending on your system you might want to customize the install process. Here are a few common configuration options:
- C compiler: In case you have several C compilers on your machine, you will probably
need to specify which one to use to
CMake
by setting the environmentCC
like so, before runningCMake
:
$ export CC=gcc
- Install directory: By default,
CMake
will try to installAngPow
in/usr/local
, if you would like to instead install AngPow in a user-defined directory (for instance if you don't have admin privileges), you can specify it toCMake
by running instead the following command:
$ cmake -DCMAKE_INSTALL_PREFIX=/path/to/install ..
-
edit Makefile and adapat to local platform :
- adapt to the type of Machine MacOSX (Darwin) vs Linux
- on Linux adapt the location of FFTW
-
Then, the make depends on the plateform
> make
will select the system thanks tu uname shell function. The result of "make" is binanry file under
./bin
directory as well aslibanpow.a
library in./lib
. -
if you want a detailed profiling report then,
> make PROFILING=1
-
notice that the include files are in
<angpow-root>/inc/Angpow
.
Other possible argument to make:
- make clean: to cleanup objects, angpow library and binary
- make tidy: to delete all ~ files
- make fullcheck: to run in different initial conditions (see below).
Mac OS X 10.11.2: gcc 4.9
Linuxx86_64: gcc 4.9 and 5.2 + intel icpc 15.01
Has been tested on Laptop, on CCIN2P3 and NERSC computers.
As Angpow uses OpenMP when necessary, the user is invited to set the number of threads the job can take. Ex. on bash-like shell
> export OMP_NUM_THREADS=<number>
> ./bin/angpow anpow_bench<>.ini
All the following input parameters uses a
- anpow_bench1.ini: Auto correlation, Dirac selection at
$z = 1$ - angpow_bench2.ini: Cross correlation, Dirac selection
$z = 1, 1.05$ - angpow_bench3.ini: Auto correlation, Gauss & Galaxy example (cf.
$dN/dz$ ) selection (to repproduce an example in the CLASSgal article arXiv:1307.1459v4$\langle z \rangle = 0.55$ ,$\sigma_z=0.10$ . - angpow_bench4.ini: Auto correlation, Gauss selection (no extra
$dN/dz$ )$\langle z\rangle = 1.00$ and$\sigma_z=0.02$ . - angpow_bench5.ini: Cross correlation, Gauss selection (no extra
$dN/dz$ );$\langle z\rangle = 0.90, 1.00$ and a common$\sigma_z=0.02$ .
It is provided a bash script verif.sh
that runs the 5 Tests and extract the maximal absolute value difference w.r.t some reference .REF
files) (and the "$\ell_{max}$" location).
It is provided a bash script stress-test.sh
that runs the 5 Tests with diffrent number of threads (1, 2, 4, 8, 16) and make Time average over 10 runs. One can then appreciate on his machine the impact of the multi-thread usage and get the saturation limit.
-
root directory
- COPYING
- Readme.md : this file
- Makefile
- Darwin_g++_omp_make.inc : file included into Makefile in case of running on Mac Os X system
- Linux_g++_make.inc : idem but for Linux system
- angpow.cc: it contains the main() function to perform a generic
$C_\ell$ computaion using initial parameter files - angpow_bench<number>.ini a set of initial parameter files which show how to proceed to run the job:
./bin/angpow <init-file>
-
src and inc/Angpow directories
- angpow_bessel: deals with the
$j_\ell(x)$ function. Code from CLASSgal has been adapted. The Bessel roots finding algorithm uses BOOST library for the moment. - angpow_chebyshevInt: implement the 3C algorithm (needs BLAS-like implementation and FFTW)
- angpow_clbase: generate list of
$\ell$ to be used and interpolate to get a complet list of$C_\ell$ - angpow_cosmo_base.h : base class to be implemented to provide comoving distance
- angpow_cosmo: implementation of angpow_cosmo_base.h with a simple $\Lambda$CDM cosmology
- angpow_ctheta: compute
$\xi(\theta, z_1, z_2)$ once the$C_\ell(z_1, z_2)$ are provided - angpow_exceptions: exception class
- angpow_fft: access to FFTW planning
- angpow_func: base class for generic 1D and 2D functions
- angpow_kinteg: perform the k-integration (bulk of the algo) and the redshift integrations too
- angpow_numbers: to generate machine-based number types (M. Reinecke)
- angpow_parameters: structure which group the user parameters to control the job at diffrent stages (directory, precision, cuts...)
- angpow_pk2cl: hub of the program to perfom the
$C_\ell$ computation from a$P(k)$ and redshift selection windows - angpow_powspec_base.h: base class to povide access to
$P(k)$ and$\tilde{\Delta}_\ell(z,k)$ functions - angpow_powspec: implementation of angpow_powspec_base.h which deals with the power spectrum part (load from file the
$P(k)$ at$z=0$ , use a growth function) and define the Eisentein & Hue growth factor function - angpow_quadinteg: generic and specific 1D quadrature. Used to get low order weights/nodes for instance of Clenshaw-Curtis or Gauss-Kronrod quadrature. This is used for the redshift integrals of the
$C_\ell$ with selection functions. - angpow_radial_base.h: base class for redshift selection function
- angpow_radial: implement angpow_radial_base.h: Dirac, TopHat with apodized edges, Gaussian, and Gauss + Galaxy distribution
- angpow_radint: originaly was design to perform the redshift integral but it is only used to provide cartesian quadrature weights/nodes as angpow_kinteg perform all the integrals. It might be cleaned in future relased.
- angpow_tools: spline, interpolation...
- angpow_utils: string manipulation and STL predicates
- walltime_c/walltimer: M. Reinecke usefull timer.
- angpow_bessel: deals with the
-
root directory
- Makefile that should be tuned to the local platform (*.inc files)
- the main (angpow.cc or limber.cc)
- initial parameter files (angpow_bench<number>.ini)
- reference outputs (angpow_bench<number>.txt.REF)
- bash scripts (verif.sh, stress-test.sh) and an awk script (diff.awk) used by verif.sh.
-
doc directory
- doxydoc : input file to
doxygen
tool to generate the class documentation
- doxydoc : input file to
-
bin/lib directories are the location of executable and library
-
data directory:
- input power
Angpow design has been driven to allow one to use its own access to :
- power spectrum computation (ie.
$P(k)$ ,$\tilde{\Delta}_\ell(z,k)$ . These functions are generalised in a single$P(\ell, k, z)$ function which has to be derived fromPowerSpecBase
class located inangpow_power_spec_base.h
file. An concrete implementation has been set up inangpow_power.h
throw thePowerSpecFile
class which reads an external$(k, P(k))$ tuple and compute internaly a minimal growth function. To implementPowerSpecBase
one must provide:-
a
clone
function that is simply (Derived to be replaced by the appropriate class name)return new Derived(static_cast<const Derived&>(*this));
-
The Copy Constructor should be explicitly provided BUT avoid deep copy if pointers are used (see for instance PowerSpecFile
),
* the main operator double operator()(int ell, double k, double z)
.
* if pointers are used than one must provide an implementation of ExplicitDestroy()
to free properly the memory. Do not use the Destructor of the class to free memory that is used by different clone
.
* Before the Init
function is called by the KIntegrator::compute method, so the user can initialize function at this stage (for instance any growth factor depending only on
- cosmological comobile distance (ie. $r(z)$) those abstract class
CosmoCoordBase
is located inangpow_cosmo_base.h
file. An implementation using a $\Lambda$CDM standard cosmology is accessible throwCosmoCoord
class inangpow_cosmo.h
- radial selection functions (ie. $W(z)$) as a
$z$ user function derived fromRadSelectBase
class inangpow_radial_base.h
file. Some implementations exist for Dirac, Gaussian, TopHat with apodized edges, and Gaussian+galaxy function (see details inangpow_radial.h
file)
The user once he has implemented the abstract classes, may want to set up an application similar to angpow.cc
. In this perspective the typical workflow of the main routine should at least follow the scheme:
-
Get the pointer to the job processing user parameters via
Parameters para = Param::Instance().GetParam();
-
Initialize the Redshift Selection classes derived from
RadSelectBase
; -
Initialize the Cosmological Distance class derived from
CosmoCoordBase
; -
Initialize the (generalized) Power Spectrum class derived from
PowerSpecBase
; -
Initialize the
$C_\ell$ class viaClbase clout(Lmax,para.linearStep, para.logStep);
-
Instantiate a
Pk2Cl
object and launch the computation asPk2Cl pk2cl; pk2cl.Compute(pws, cosmo, Z1win, Z2win, Lmax, clout);
-
Then, one may want to save the
$C_\ell(z_1,z_2)$ results and launch if desired the$\xi(\theta, z_1, z_2)$ computation. -
Before closing (free memory if needed) one must explicitly call the PowerSpectrum
ExplicitDestroy
method.pws.ExplicitDestroy();