Skip to content

Commit

Permalink
Integration of N5K winners into CCL (#1092)
Browse files Browse the repository at this point in the history
* First Baby steps

* Ready for integration

* remove vestiges of angpow

* clarifying limber and non-limber

* INCOMPLETE: FFTLog restructuring to allow integration of spherical bessel functions and derivatives of bessel functions

* working version of FKEM non-limber integration with copy of N5K benchmark repo and new calculator. Needs comments in code and debugging

* working version of FKEM non-limber integration with copy of N5K benchmark repo and new calculator. Needs comments in code and debugging

* Comments in code and general debugging

* Starting to port N5K unit tests.

* missing data files

* completed test, fixed typo

* benchmark fix

* better efficiency of FKEM and splining fix

* test

* cleanup

* linted

* ccl_fftlog depreciation edits to pass unit tests

* unit test formatting

* unit test formatting

* unit test formatting

* added fftlog tests

* added fftlog tests

* added fftlog tests

* improved performance and bug fixes for FKEM implementation

* Update ccl_fftlog.i

* Update ccl_fftlog.i

* Update pyutils.py

* Update environment.yml

* Update environment.yml

* Update environment.yml

* restore rtd

* more cleanup

* 644

* more 644

* N5Krm

* no angpow

* FKEM hashing

* FKEM hashing

* FKEM hashing

* FKEM hashing

* FKEM hashing

* FKEM hashing

* FKEM hashing

* Update environment.yml

* clearer benchmark

* towards PT tests

* FKEM bug fixes for PT calculations

* FKEM bug fixes for PT calculations

* FKEM bug fixes for PT calculations

* Update environment.yml

* Update environment.yml

* Update environment.yml

* Delete src/nonlimber_matter_utils directory

* Delete compare_nonlimber_FKEM.ipynb

* privacy updates for nonlimber code

* privacy updates for nonlimber code

* privacy updates for nonlimber code

* Update ccl_fftlog.c

* consolidate FKEM helper methods into Tracers

* streamlined benchmark, removed remnant global variable, avoided division by zero

* Update tracers.py

* Update tracers.py

* Update _nonlimber_FKEM.py

---------

Co-authored-by: paulrogozenski <[email protected]>
Co-authored-by: paulrogozenski <[email protected]>
Co-authored-by: David Alonso <[email protected]>
  • Loading branch information
4 people authored Nov 13, 2023
1 parent d1b104d commit 6b08a25
Show file tree
Hide file tree
Showing 27 changed files with 1,391 additions and 692 deletions.
25 changes: 5 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ set(TEST_SRC
benchmarks/ccl_test_utils.c
benchmarks/ccl_test_f2d.c
benchmarks/ccl_test_f3d.c

# Move to python when we bring ANGPOW back
#benchmarks/ccl_test_angpow.c
)


Expand All @@ -51,12 +48,6 @@ set(EXTRA_DIST_DIRS)
include(BuildFFTW)
include(BuildGSL)

# Uncomment below when we bring ANGPOW back
# Builds Angpow
# TODO: the same mechanism as for CLASS could be used here to provide the
# option to use a pre-installed version of angpow
#include(BuildAngpow)

if(("${CMAKE_C_COMPILER_ID}" MATCHES "^(Apple)+Clang$") AND (CMAKE_C_COMPILER_VERSION LESS 13) AND NOT FORCE_OPENMP)
# Apple Clang 12 (and maybe below) have issues with OpenMP and cmake, so we don't try to find it
# Anything else supports OpenMP
Expand All @@ -67,8 +58,8 @@ else()
endif()

# Compilation flags
set(CMAKE_C_FLAGS_RELEASE "-O3 -fomit-frame-pointer -fno-common -fPIC -std=gnu99 -DHAVE_ANGPOW")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g -fomit-frame-pointer -fno-common -fPIC -std=gnu99 -DHAVE_ANGPOW")
set(CMAKE_C_FLAGS_RELEASE "-O3 -fomit-frame-pointer -fno-common -fPIC -std=gnu99")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g -fomit-frame-pointer -fno-common -fPIC -std=gnu99")

if(OpenMP_C_FOUND)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${OpenMP_C_FLAGS}")
Expand All @@ -86,8 +77,8 @@ if(DEFINED ENV{CONDA_PREFIX})
endif()

# Define include and library directories for external dependencies
include_directories(${GSL_INCLUDE_DIRS} ${FFTW_INCLUDES} ${ANGPOW_INCLUDE_DIRS})
link_directories(${GSL_LIBRARY_DIRS} ${FFTW_LIBRARY_DIRS} ${ANGPOW_LIBRARY_DIRS})
include_directories(${GSL_INCLUDE_DIRS} ${FFTW_INCLUDES})
link_directories(${GSL_LIBRARY_DIRS} ${FFTW_LIBRARY_DIRS})
# Adds path to CCL include folder
include_directories(include)

Expand All @@ -98,24 +89,18 @@ include_directories(include)
# Compiles all the source files
add_library(objlib OBJECT ${CCL_SRC})
# Make sure the external projects are correclty built
# Uncomment below when we bring ANGPOW back
#add_dependencies(objlib ANGPOW)
if(NOT GSL_FOUND)
add_dependencies(objlib GSL)
# Uncomment below when we bring ANGPOW back
# add_dependencies(ANGPOW GSL)
endif()
if(NOT FFTW_FOUND)
add_dependencies(objlib FFTW)
# Uncomment below when we bring ANGPOW back
# add_dependencies(ANGPOW FFTW)
endif()

# The reason for building ccl as a shared library is that we can link it to
# class directly, and it's not a dependency anymore
add_library(ccl SHARED $<TARGET_OBJECTS:objlib>)
# The generator expression $<$<BOOL:${OpenMP_C_FOUND}>:OpenMP::OpenMP_C> adds the OpenMP library if OpenMP is available
target_link_libraries(ccl ${GSL_LIBRARIES} ${FFTW_LIBRARIES} ${CLASS_LIBRARIES} ${ANGPOW_LIBRARIES} m $<$<BOOL:${OpenMP_C_FOUND}>:OpenMP::OpenMP_C>)
target_link_libraries(ccl ${GSL_LIBRARIES} ${FFTW_LIBRARIES} ${CLASS_LIBRARIES} m $<$<BOOL:${OpenMP_C_FOUND}>:OpenMP::OpenMP_C>)

# Builds the test suite
add_executable(check_ccl ${TEST_SRC})
Expand Down
131 changes: 0 additions & 131 deletions benchmarks/ccl_test_angpow.c

This file was deleted.

Binary file added benchmarks/data/nonlimber/background.npz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added benchmarks/data/nonlimber/dNdzs_fullwidth.npz
Binary file not shown.
Binary file added benchmarks/data/nonlimber/kernels_fullwidth.npz
Binary file not shown.
Binary file added benchmarks/data/nonlimber/pk.npz
Binary file not shown.
Loading

0 comments on commit 6b08a25

Please sign in to comment.