Skip to content

echaussidon/fastpm-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update

Starting from the initail fastpm-python, I add initial condition with local PNG to create end-2-end pieline for fnl measurment in DESI.

I update fof code (problem with memory issue). Add several scripts to launch simulation on nersc and scripts to create DESI cutsky with imaging systematic contamination.

Strict requirements are now: 'cython', 'numpy', 'scipy', 'pmesh', 'kdcount', 'cosmoprimo', 'pypower', 'psutil'

fastpm

This is the Python implementation of the FastPM numerical scheme for quasi-nbody simulations.

CI status / master

Build Status

DOI of fastpm-python.

https://github.com/rainwoodman/fastpm-python/raw/artwork/artwork/10MpchTrajectories.png

Install

The best result is obtained by using anaconda.

Python 3 is the current development environment.

First set up the basic requirements,

conda install cython numpy scipy mpi4py nose
conda install -c bccp nbodykit

# update nbodykit to latest
pip install -U --no-deps https://github.com/bccp/nbodykit/archive/master.zip

Finally, we can install fastpm, either from PYPI (the latest release)

pip install fastpm

or from the git clone :

pip install .

Command line interface

There is a simple command line interface, which expects a config.py in the first command line argument.

python -m fastpm.main examples/run

or with MPI

mpirun -n 4 python -m fastpm.main examples/run

The arguments are listed in fastpm/main.py

Development

To run the tests with MPI

python runtests.py

Run with a single rank and enable debugging

python runtests.py --single --pdb --capture=no

To run a single test (e.g. test_fastpm.py:test_name) :

python runtests.py fastpm/tests/test_fastpm:test_name

Profiling

python -m cProfile -o profile.stats run.py run
gprof2dot profile.stats -f pstats | dot -Tpng > profile.png

We can't use -m fastpm.main directory because there is no nested -m support.

About

Python version of FastPM

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 85.5%
  • Shell 13.8%
  • Dockerfile 0.7%