mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-09-03 01:00:43 +02:00
Optimized pedestal tracking with FastPedestal and performance improvements to the cluster finder. - ~2x faster hitting 14k FPS on benchmark dataset on 16 core threadripper pro **Changes** - No bounds check on interior of frame. (only within half of a cluster) (~15% improvement) - Cache threshold (std*n_rms) Biggest improvement comes from not computing std for each access - Cache pedestal subtracted frame - Switched to FastPedestal which assumes we reached steady state **Things tried but rejected:** - Always store cluster values, commit on val==max (~15% drop in frame rate) **Options** - using 16 bit clusters and 16 bit pedestal. (slows down the single threaded case but allow us to reach 12k with multi threading) **Other notes on performance** - Passing in memory frames from python and doing nothing: 0.8us/frame - Passing + pedestal subtraction: 28us/frame - Passing + pedestal + cluster finding (no store): 652us/frame - Passing + pedestal + cluster finding: 886 us/frame
84 lines
2.2 KiB
CMake
84 lines
2.2 KiB
CMake
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
find_package(
|
|
Python 3.10
|
|
COMPONENTS Interpreter Development.Module
|
|
REQUIRED)
|
|
set(PYBIND11_FINDPYTHON ON) # Needed for RH8
|
|
|
|
# Download or find pybind11 depending on configuration
|
|
if(AARE_FETCH_PYBIND11)
|
|
FetchContent_Declare(
|
|
pybind11
|
|
GIT_REPOSITORY https://github.com/pybind/pybind11
|
|
GIT_TAG v3.0.3)
|
|
FetchContent_MakeAvailable(pybind11)
|
|
else()
|
|
find_package(pybind11 3.0.3 REQUIRED)
|
|
endif()
|
|
|
|
# Add the compiled python extension
|
|
pybind11_add_module(
|
|
_aare # name of the module
|
|
src/module.cpp # source file
|
|
)
|
|
|
|
set_target_properties(_aare PROPERTIES LIBRARY_OUTPUT_DIRECTORY
|
|
${CMAKE_BINARY_DIR})
|
|
target_link_libraries(_aare PRIVATE aare_core aare_compiler_flags)
|
|
|
|
target_include_directories(
|
|
_aare SYSTEM
|
|
PRIVATE $<TARGET_PROPERTY:aare::Minuit2,INTERFACE_INCLUDE_DIRECTORIES>)
|
|
|
|
# List of python files to be copied to the build directory
|
|
set(PYTHON_FILES
|
|
aare/__init__.py
|
|
aare/_version.py
|
|
aare/CtbRawFile.py
|
|
aare/ClusterFinder.py
|
|
aare/ClusterVector.py
|
|
aare/Cluster.py
|
|
aare/FastPedestal.py
|
|
aare/calibration.py
|
|
aare/factory.py
|
|
aare/experimental.py
|
|
aare/RawFile.py
|
|
aare/transform.py
|
|
aare/ScanParameters.py
|
|
aare/utils.py)
|
|
|
|
# Copy the python files to the build directory
|
|
foreach(FILE ${PYTHON_FILES})
|
|
configure_file(${FILE} ${CMAKE_BINARY_DIR}/${FILE})
|
|
endforeach(FILE ${PYTHON_FILES})
|
|
|
|
set_target_properties(_aare PROPERTIES LIBRARY_OUTPUT_DIRECTORY
|
|
${CMAKE_BINARY_DIR}/aare)
|
|
|
|
set(PYTHON_EXAMPLES examples/play.py examples/fits.py)
|
|
|
|
# Copy the python examples to the build directory
|
|
foreach(FILE ${PYTHON_EXAMPLES})
|
|
configure_file(${FILE} ${CMAKE_BINARY_DIR}/${FILE})
|
|
message(STATUS "Copying ${FILE} to ${CMAKE_BINARY_DIR}/${FILE}")
|
|
endforeach(FILE ${PYTHON_EXAMPLES})
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../VERSION
|
|
${CMAKE_BINARY_DIR}/aare/VERSION)
|
|
if(AARE_INSTALL_PYTHONEXT)
|
|
install(
|
|
TARGETS _aare
|
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
|
LIBRARY DESTINATION aare COMPONENT python)
|
|
|
|
install(
|
|
FILES ${PYTHON_FILES}
|
|
DESTINATION aare
|
|
COMPONENT python)
|
|
install(
|
|
FILES ../VERSION
|
|
DESTINATION aare
|
|
COMPONENT python)
|
|
endif()
|