Sandbox for testing codes and scripts related to Sahyadri simulations at IUCAA/TIFR/IISER-Pune/NCRA
As an offshoot of the 2nd edition of the PMCAP meeting held at IUCAA, Pune, it was decided to build a suite of cosmological N-body simulations that explore various cosmological and dark matter models using high-resolution, intermediate volume configurations that are optimal for exploring statistics related to the cosmic web, beyond-2pt observables and the small-scale phenomenology of dark matter.
The simulation suite is named Sahyadri (inspired by the mountain range one must cross to travel between Pune and Mumbai), with a smaller pilot study named Sinhagad (after a popular mountain in the range).
This repository collects various pieces of code and general information that is needed for setting up and running individual realisations in Sahyadri or Sinhagad. The information here should, in principle, suffice to set up an end-to-end local pipeline that starts with calculating a transfer function, performs the simulation, finds halos and finally analyses all the output to produce some basic summary statistics like power spectra and mass functions.
We will use the following codes:
CLASS
-- see hereGADGET-4
(includes NGen-IC
) -- see here; documentation is also copied in docs/gadget-4Here we provide some installation tips for setting up these codes in a PBS environment. For further details, please see the individual documentation pages linked above.
Include the following line in the install user's .bashrc
file, replacing the module names with local ones (the ones below are for installing on Pegasus)
module add null gcc/11.2.0 anaconda3 hdf5-1.14.2 openmpi-4.1.5-gcc-11.2 fftw-3.3.10 gsl-2.6 gcc-8.2.0
Including anaconda3
ensures that the command python
links to Python3.
it is best to define the following environment variables by copying these lines to your bashrc or equivalent files
#Gadet_related stuff
export CODE_HOME= path to the directory where we should find a code directory and all installation needs to be in this dirctory
export SANDBOX_DIR= Path to sahyadri-sandbox directory, i. e. this repositories clone
CLASS
class_public***.tar.gz
file from the CLASS
repository and unzip it in the local install folder. The install folder should be $CODE_HOME/code/Class/ . After unzip the folder should be named class_public with path should look like $CODE_HOME/code/Class/class_public/class_public
folder
make clean
make
which should compile the code with Python support.
GADGET-4
Note 1: The tips below will produce an installation compatible with the run_gadget.sh script in this repository.
Note 2: It is highly recommended to read through the GADGET-4
code documentation.
Note 3: All appearances of Pegasus
or pegasus
can be consistently replaced with any local cluster name.
$CODE_HOME/code/Gadget-4/
where $CODE_HOME
is the path to the install user's home (e.g., /mnt/home/faculty/caseem
)GADGET-4
git repository here.Makefile.systype
in gadget4/
:
gadget4/
folder, copy the file Template-Makefile.systype
to Makefile.systype
.Makefile.systype
and add an uncommented line SYSTYPE="Pegasus"
. Makefile.comp
and Makefile.path
in gadget4/buildsystem/
:
gadget4/buildsystem/
folder, copy Makefile.comp.gcc
to Makefile.comp.pegasus
Makefile.path.pegasus
with library and include paths. E.g., with the modules loaded above, the contents of this file would be
GSL_INCL = -I/mnt/csoft/libraries/gsl-2.6/include
GSL_LIBS = -L/mnt/csoft/libraries/gsl-2.6/lib
FFTW_INCL = -I/mnt/csoft/libraries/fftw-3.3.10/include
FFTW_LIBS = -L/mnt/csoft/libraries/fftw-3.3.10/lib
HDF5_INCL = -I/mnt/csoft/libraries/hdf5-1.14.2/include
HDF5_LIBS = -L/mnt/csoft/libraries/hdf5-1.14.2/lib
HWLOC_INCL =
HWLOC_LIBS =
gadget4/Makefile
:
Look for the code block starting with the comment #define available Systems
. Just beneath the comment, include the following lines of code
ifeq ($(SYSTYPE),"Pegasus")
include buildsystem/Makefile.comp.pegasus
include buildsystem/Makefile.path.pegasus
endif
appropriately replacing the Pegasus
references with the local names used for these files.
Compile executables.
We will need a binary executable for each PM configuration. We will organize these into different folders under code/Gadget-4/' (i.e., one level above
gadget4/') labelled by the mesh size. E.g., the binary for a 10243 grid with NGen-IC
support will sit in the folder mesh1024-NGenIC
, and for the same mesh but without NGen-IC
in the folder mesh1024
.
Below, we will always assume that a simulation with N3 particles will use a (2N)3 mesh. The primary job submission script is hard-coded for this. To change this assumption, the submission script must be edited.
Here we focus on a 10243 grid (i.e., a simulation with 5123 particles) with NGen-IC
support, whose binary will sit in Gadget-4/mesh1024-NGenIC/
. Repeat the following steps for each such required mesh size / IC combination.
To disable NGen-IC
support, simply skip the last 2 lines of step iii and the last line of step iv.
Gadget-4/mesh1024-NGenIC/
. Config.sh' from
Gadget-4/gadget4/to
Gadget-4/mesh1024-NGenIC/` and open it for editing in the latter folder.# PERIODIC
# LEAN
# INITIAL_CONDITIONS_CONTAIN_ENTROPY
# OUTPUT_POTENTIAL # if gravitational potential needed in output
# NGENIC_2LPT # if 2LPT needed, else leave commented for Zeldovich
# CREATE_GRID
# PMGRID=1024 # mesh size along each dimension
# DOUBLEPRECISION=1
# MAX_NUMBER_OF_RANKS_WITH_SHARED_MEMORY=32 # set to number of cores on each node, default 64.
# NGENIC=512 # half of mesh size, can be different but see comment above
make clean DIR=$CODE_HOME/code/Gadget-4/mesh1024-NGenIC
make DIR=$CODE_HOME/code/Gadget-4/mesh1024-NGenIC
The script here automates the compilation of binaries for mesh sizes 1283 to 40963, with and without NGen-IC
support, assuming the required folders and Config.sh
files exist. It can be run from the folder Gadget-4/gadget4/
. Executing ./makeallgrids.sh clean
will pass the clean
flag to all compilations, while ./makeallgrids.sh
will compile the binaries.
ROCKSTAR
We use ROCKSTAR
version 36ce9eea36ee
with some custom modifications to enable
GADGET-4
HDF5 output snapshotsOmega_k
The modifications are described in this file.This Should be installed at $CODE_HOME/code/Rockstar/
ROCKSTAR
can be installed with GADGET-4
HDF5 support by simply typing `make' at the command prompt in the install folder after making all changes mentioned in the file above.
Contact Aseem Paranjape for help installing this modified version.
CONSISTENT-TREES
Should be installed at $CODE_HOME/code/ConsistentTrees/ The name of the directory should be consistent_trees under the above directory
CONSISTENT-TREES
repository here.make
at the command prompt in the install folder.Aseem Paranjape: aseem_at_iucaa_dot_in