Skip to content

sirajul-9/ReionYugaPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReionYugaPy

This repository contains a Python wrapper for the C code, ReionYuga (https://github.com/rajeshmondal18/ReionYuga).

For running this code, the outputs of N-body code (https://github.com/rajeshmondal18/N-body) and Friends-of-Friend Halo Finder(https://github.com/rajeshmondal18/FoF-Halo-finder) are needed.

Required Libraries

CFFI: can be installed with

  pip install cffi 
for local installation (without root access) you may use
 pip install --user cffi 
or
 pip3 install --user cffi 
FFTW-3 library needs to be installed in the system. It can be downloaded with

 sudo apt-get install libfftw3-dev 

If that does not work download FFTW-3 from http://www.fftw.org/fftw3_doc/Installation-on-Unix.html#Installation-on-Unix Then install it with the flags --enable-float, --enable-shared and --enable-openmp as written below

After extracting the downloaded file go to the directory and do the following.

 
./configure --enable-float --enable-shared --enable-openmp
 make
 sudo make install

For installing locally without root access:

 
./configure --enable-float --enable-shared --enable-openmp --prefix=/path/to/your/local/install/directory
 make
 make install

Instructions for Running the Code

Download all the files in this repository as ZIP and extract. Or use the following command:

 git clone https://github.com/sirajul-9/ReionYugaPy

If you have installed FFTW locally, edit the "build_funcs.py" file. Add the following arguments to the "ffi.set_source()" function:

include_dirs=['/path/to/local/include/directory'],

library_dirs=['/path/to/local/lib/directory'],

For example

 ffi.set_source(
    "funcs_cffi",  
    """
    #include "source.h"
    """,
    sources=["source.c"],
    libraries=["m", "fftw3f", "fftw3f_omp"],
    extra_compile_args=['-w','-fopenmp', '-std=c99'],
    library_dirs=["/home/sirajul/local_install/lib"],
    include_dirs=["/home/sirajul/local_install/include/"]
)

Write the values of all the parameters, redshifts and N-body and halo_catalogue outputs' path in the file "input_parameters.py".

Then run the file build_funcs.py with

python3 build_funcs.py

If you are running with locally installed libraries run the following command (or write it in your job submission script):

 
LD_LIBRARY_PATH=/path/to/local/lib/directory
export LD_LIBRARY_PATH

Then the main code can be run using:

python3 ionz_main.py

Releases

No releases published

Packages

No packages published