The FLARES-2 Gridder computes matter overdensities at uniform, random, or file-provided grid points using spherical top-hat kernels. The C++20 code uses an octree for particle searches, OpenMP within a process, and optional MPI domain decomposition.
Requirements are CMake 3.12+, a C++20 compiler, OpenMP, and HDF5. MPI is optional. Serial HDF5 is used in both builds.
# Serial
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
# MPI
cmake -B build_mpi -DENABLE_MPI=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build_mpiThe parameter reader accepts simple indentation-based YAML-style mappings.
See example_params.yml and the
parameter reference.
Kernels:
nkernels: 2
kernel_radius_1: 0.5
kernel_radius_2: 1.0
Grid:
type: uniform
cdim: 50
Cosmology:
h: 0.681
Omega_cdm: 0.256011
Omega_b: 0.048600
Tree:
max_leaf_count: 200
Input:
filepath: snapshot_0000.hdf5
placeholder: "0000"
part_gap_fill_fraction: 0.01
Output:
filepath: output/
basename: grid_0000.hdf5
write_masses: 0The cosmology values are required and determine the mean comoving density used to normalize overdensities.
# Eight OpenMP threads, snapshot number defaults to zero
./build/parent_gridder example_params.yml 8
# Snapshot 42
./build/parent_gridder example_params.yml 8 42
# Four MPI ranks, two OpenMP threads per rank
mpirun -n 4 ./build_mpi/parent_gridder example_params.yml 2 42Use ./build/parent_gridder --help for runtime arguments. The positional
thread argument controls OpenMP in both serial and MPI builds.
The input HDF5 snapshot must contain:
HeaderattributesRedshift,NumPart_Total, andBoxSizeCells/Meta-dataattributesdimensionandsizeCells/Counts/PartType1Cells/OffsetsInFile/PartType1PartType1/CoordinatesPartType1/Masses
Particle IDs, velocities, input units, and an input cosmology group are not read. The conversion guide describes how to create the required cell index from compatible coordinate and mass datasets.
pytest tests -v
./tests/run_tests.sh --allThe shell runner is focused rather than exhaustive. See
tests/README.md for serial, MPI, and comparison-suite
commands.
Generate test input manually with:
python3 tests/make_test_snap.py --helpBuild the MkDocs site with:
./build_docs.shStart with the quickstart, then see the grid types, MPI guide, and conversion guide.