Commit 70a1e59b authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Use Lima buffer NUMA control API

parent cf22f595
Pipeline #8141 passed with stages
in 14 minutes and 1 second
......@@ -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")
......
#!/bin/bash
cmake -Bbuild -H. -DLIMA_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
......@@ -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