Skip to content

mschmittfull/fastpm

 
 

Repository files navigation

FastPM

CI-Status

Build Status

Introduction

FastPM solves the gravity Possion equation with a boosted particle mesh. Arbitrary time steps can be used. The code is indented to study the formation of large scale structure.

Serious attempts are made to ensure the source code of FastPM is relatively clear to read (mirroring the complicity of the algorithms). FastPM provides a library and a C-API (still unstable) to be reused at binary level in another application.

FastPM supports plain PM and Comoving-Lagranian (COLA) solvers. A broadband correction enforces the linear theory model growth factor at large scale. See the code paper [FIXME].

Thanks to the PFFT Fourier Transform library, FastPM scales extremely well, to hundred thousand MPI ranks.

The size of mesh in FastPM can vary with time, allowing one to use coarse force mesh at high redshift with increase temporal resolution for accurate large scale modes.

The finite differentiation kernel in FastPM is the 4 point low-noise super-lanzcos kernel. A discrete laplacian operator is used to solve Poisson's equation.

A parameter file interpreter is provided to validate and execute the configuration files without running the simulation, allowing creative usages of the configuration files.

IO and Compatibility

The snapshot format of FastPM is [bigfile]. The format can be easily accessed by python, C, or Fortran. Alternatively, the snapshot can be written as TPM by Martin White, which can be subtly accessed by Python, C, or Fortran.

Due to unjustified complicity, snapshots in legacy GADGET format is not supported by FastPM.

The nbody post-analysis package [NBODYKIT] natively supports bigfile and TPM formats.

[NBODYKIT] provides tools for calculating two point functions, generating QPM mocks, and identifying Friends-of-Friends (DBSCAN) haloes and calculating spherical overdensity properties of subhalos.

In addition to the snapshots, FastPM calculates and writes the power-spectrum at each time step. These power spectrum files are compatible with numpy plain text files.

Internal Units

FastPM format

  • Position is in units of Mpc/h.
  • Velocity is $v_s = \frac{a^2}{H_0}\dot{x}$

To convert velocity to RSD, use $\delta x_{rsd} = \frac{a\dot{x}}{H} = \frac{H_0}{aH} v_s$ This number is saved in the header.

RunPB format

  • Position is between 0 and 1.
  • Velocity is in RSD units, between 0 and 1.

Acknowledgement

FastPM uses or references publicly avaiable codes ([PFFT] [2LPT], [COLAHALO], [LUA], [NBODYKIT], [MP-GADGET]) and private codes (mpipm and ic_2lpt by Martin White).

The Particle Mesh solver and 2LPT initial condition generator in FastPM are written from scratch to properly support pencil / stencil domain decomposition schemes.

The following files distributed in FastPM are originally from other projects:

The source code of FastPM is distributed under GPLv3, with the exception files in lua directory distributed under any appropriate license of lua.

Installation

Set up the compilers and location of files in Makefile.local. An example is provided in Makefile.local.example which shall work on a recent version of Fedora .

gsl : Most super-computing facility have these already installed. Locate the path. Point GSL_DIR to the installation dir. (parent directory of lib and include)

pfft : bundled and built statically via

make -f Makefile.pfft

Some minor tweaks to Makefile.pfft on the configure scripts may be needed. Especially the --enable-avx and --enable-sse / --enable-sse2 flags if compliation fails with strange errors.

The automatical dependency requires a working version of gcc.

For example, on Edison

# this will set GSL_DIR automatically
module load gsl
cp Makefile.edison Makefile.local
make

Examples

Refer to tests/example.lua and tests/runtest.sh

CI

Lastest power spectrum from TravisCI:

image

About

fastPM - A N-body Particle Mesh solver that scales

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 90.4%
  • Lua 4.8%
  • C++ 2.6%
  • Makefile 1.1%
  • Python 0.5%
  • Shell 0.5%
  • Other 0.1%