Commit 6d98c2ae authored by Samuel Debionne's avatar Samuel Debionne
Browse files

Merge branch 'buffer_numa_ctl' into 'fix_v3.1.1_issues'

Use Lima buffer NUMA control API

See merge request !6
parents 6295892f 70a1e59b
Pipeline #8273 passed with stages
in 12 minutes and 24 seconds
......@@ -32,6 +32,12 @@ set(NAME slsdetector)
include(GNUInstallDirs)
include(GenerateExportHeader)
# If conda build, always set lib dir to 'lib'
if(NOT LIMA_ENABLE_NUMA)
message(FATAL_ERROR
"slsdetector requires NUMA control in Lima: set LIMA_ENABLE_NUMA ON")
endif()
# If conda build, always set lib dir to 'lib'
if($ENV{CONDA_BUILD})
set(CMAKE_INSTALL_LIBDIR "lib")
......@@ -62,9 +68,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIRS} ${CMA
include(project_version)
# Enable python binding code compilation using sip generator
option(CAMERA_ENABLE_PYTHON "compile python binding code?" LIMA_ENABLE_PYTHON)
if (CAMERA_MASTER_PROJECT)
option(LIMA_ENABLE_PYTHON "compile python binding code?" OFF)
endif()
if (CAMERA_ENABLE_PYTHON)
if (LIMA_ENABLE_PYTHON)
# Find python interpreter and libs
find_package(PythonInterp)
find_package(PythonLibs)
......@@ -151,7 +159,7 @@ target_link_libraries(slsdetector
)
# Binding code for python
if(CAMERA_ENABLE_PYTHON)
if(LIMA_ENABLE_PYTHON)
include(LimaTools)
limatools_run_sip_for_camera(slsdetector)
endif()
......@@ -190,7 +198,7 @@ install(
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
if(CAMERA_ENABLE_PYTHON)
if(LIMA_ENABLE_PYTHON)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python/
DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/SlsDetector"
......
#!/bin/bash
cmake -Bbuild -H. -DCAMERA_ENABLE_PYTHON=1 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX
cmake -Bbuild -H. -DLIMA_ENABLE_PYTHON=1 -DLIMA_ENABLE_NUMA=1 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX
cmake --build build --target install
......@@ -1204,7 +1204,8 @@ Install basic *conda* packages:
. blissrc
conda install gxx_linux-64 gxx-dbg_linux-64
conda install cmake
conda install sip=4.18\* numpy gsl
conda install sip="4.18*" numpy gsl
conda install lz4-c=1.8.2 hdf5="1.10*"
conda install libpng
conda install -c valkyriesystemscorporation libnuma
conda install gevent
......@@ -1523,25 +1524,20 @@ De-install *libgsl* and *libnuma-dev*:
LIMA_DIR=${SLS_DETECTORS}/Lima
cd ${LIMA_DIR}
submod="third-party/Processlib
third-party/Sps
third-party/gldisplay
third-party/bitshuffle
camera/slsdetector
applications/spec
applications/tango/python"
github_submod_names="Sps"
github_submod=$(for s in ${submod}; do
for m in ${github_submod_names}; do
ext_submod_names="bitshuffle"
ext_submod=$(for s in ${submod}; do
for m in ${ext_submod_names}; do
echo ${s} | grep ${m}
done
done)
re_pat="(${github_submod_names// /|})"
re_pat="(${ext_submod_names// /|})"
gitlab_submod=$(echo "${submod}" | grep -Ev ${re_pat})
git submodule init ${submod}
git submodule update
for s in ${github_submod}; do
(cd ${s} &&
git remote rename origin github.bliss)
done
for s in ${gitlab_submod}; do
(cd ${s} &&
git remote rename origin gitlab &&
......@@ -1587,11 +1583,9 @@ Compile *Lima*, including *slsDetectorPackage* using *CMake*:
cp scripts/config.txt_default scripts/config.txt
mkdir -p ${LIMA_DIR}/install/python
(slsdetector) lid10eiger1:~/esrf/sls_detectors/Lima % ./install.sh \
--find-root-path=${CONDA_SYSROOT} \
--install-prefix=${LIMA_DIR}/install \
--install-python-prefix=${LIMA_DIR}/install/python \
gsl-root-dir=${CONDA_PREFIX} \
slsdetector edfgz python pytango-server tests 2>&1
slsdetector hdf5 hdf5-bs edfgz edflz4 python pytango-server tests 2>&1
...
Build the documentation:
......
......@@ -81,8 +81,8 @@ public:
{ return std::pair<int, int>(port_idx / m_recv_nb_ports,
port_idx % m_recv_nb_ports); }
void setBufferCbMgr(StdBufferCbMgr *buffer_cb_mgr)
{ m_buffer_cb_mgr = buffer_cb_mgr; }
void setBufferCtrlObj(SoftBufferCtrlObj *buffer_ctrl_obj)
{ m_buffer_ctrl_obj = buffer_ctrl_obj; }
void setPixelDepth(PixelDepth pixel_depth);
void getPixelDepth(PixelDepth& pixel_depth);
......@@ -241,6 +241,9 @@ private:
State getEffectiveState();
StdBufferCbMgr *getBufferCbMgr()
{ return &m_buffer_ctrl_obj->getBuffer(); }
char *getFrameBufferPtr(FrameType frame_nb);
void removeSharedMem();
void createReceivers();
......@@ -297,7 +300,7 @@ private:
double m_lat_time;
double m_frame_period;
Settings m_settings;
StdBufferCbMgr *m_buffer_cb_mgr;
SoftBufferCtrlObj *m_buffer_ctrl_obj;
PixelDepth m_pixel_depth;
ImageType m_image_type;
bool m_raw_mode;
......
......@@ -41,7 +41,7 @@ public:
int getTotNbPorts();
int getPortIndex(int recv_idx, int port);
void setBufferCbMgr(StdBufferCbMgr *buffer_cb_mgr);
void setBufferCtrlObj(SoftBufferCtrlObj *buffer_ctrl_obj);
void setPixelDepth(SlsDetector::PixelDepth pixel_depth);
void getPixelDepth(SlsDetector::PixelDepth& pixel_depth /Out/);
......
......@@ -1554,6 +1554,7 @@ void GlobalCPUAffinityMgr::setLimaAffinity(CPUAffinity lima_affinity)
lima_affinity.applyToTask(pid, true);
m_curr.updateRecvAffinity(lima_affinity);
}
m_cam->m_buffer_ctrl_obj->setCPUAffinityMask(lima_affinity);
m_curr.lima = lima_affinity;
}
......
......@@ -285,7 +285,8 @@ Camera::AcqThread::Status Camera::AcqThread::newFrameReady(FrameType frame)
DEB_MEMBER_FUNCT();
HwFrameInfoType frame_info;
frame_info.acq_frame_nb = frame;
bool cont_acq = m_cam->m_buffer_cb_mgr->newFrameReady(frame_info);
StdBufferCbMgr *cb_mgr = m_cam->getBufferCbMgr();
bool cont_acq = cb_mgr->newFrameReady(frame_info);
bool acq_end = (frame == m_cam->m_lima_nb_frames - 1);
cont_acq &= !acq_end;
return Status(cont_acq, acq_end);
......@@ -430,7 +431,7 @@ char *Camera::getFrameBufferPtr(FrameType frame_nb)
{
DEB_MEMBER_FUNCT();
StdBufferCbMgr *cb_mgr = m_buffer_cb_mgr;
StdBufferCbMgr *cb_mgr = getBufferCbMgr();
if (!cb_mgr)
THROW_HW_ERROR(InvalidValue) << "No BufferCbMgr defined";
void *ptr = cb_mgr->getFrameBufferPtr(frame_nb);
......@@ -768,7 +769,8 @@ void Camera::prepareAcq()
{
DEB_MEMBER_FUNCT();
if (!m_buffer_cb_mgr)
StdBufferCbMgr *cb_mgr = getBufferCbMgr();
if (!cb_mgr)
THROW_HW_ERROR(Error) << "No BufferCbMgr defined";
if (!m_model)
THROW_HW_ERROR(Error) << "No BufferCbMgr defined";
......@@ -784,7 +786,7 @@ void Camera::prepareAcq()
setFramePeriod(m_exp_time + m_lat_time);
int nb_buffers;
m_buffer_cb_mgr->getNbBuffers(nb_buffers);
cb_mgr->getNbBuffers(nb_buffers);
{
AutoMutex l = lock();
......@@ -816,7 +818,8 @@ void Camera::startAcq()
if (m_acq_thread)
THROW_HW_ERROR(Error) << "Must call prepareAcq first";
m_buffer_cb_mgr->setStartTimestamp(Timestamp::now());
StdBufferCbMgr *cb_mgr = getBufferCbMgr();
cb_mgr->setStartTimestamp(Timestamp::now());
m_acq_thread = new AcqThread(this);
m_acq_thread->start();
......
......@@ -337,7 +337,7 @@ Interface::Interface(Camera& cam)
{
DEB_CONSTRUCTOR();
m_cam.setBufferCbMgr(&m_buffer.getBuffer());
m_cam.setBufferCtrlObj(&m_buffer);
m_cam.registerEventCallback(m_event_cb);
HwDetInfoCtrlObj *det_info = &m_det_info;
......@@ -360,7 +360,7 @@ Interface::~Interface()
{
DEB_DESTRUCTOR();
stopAcq();
m_cam.setBufferCbMgr(NULL);
m_cam.setBufferCtrlObj(NULL);
}
void Interface::getCapList(HwInterface::CapList &cap_list) const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment