Commit 04d7c71f authored by Samuel Debionne's avatar Samuel Debionne
Browse files

Merge branch 'performance' into 'master'

Performance improvements

Closes #6 and #8

See merge request !8
parents 16420418 1cf89de6
Pipeline #24049 passed with stages
in 9 minutes and 19 seconds
......@@ -85,9 +85,9 @@ set(SLS_DETECTOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/slsDetectorPackage)
set(SLS_DETECTOR_SW ${SLS_DETECTOR_DIR}/slsDetectorSoftware)
set(SLS_DETECTOR_RECV ${SLS_DETECTOR_DIR}/slsReceiverSoftware)
option (USE_TEXTCLIENT "Text Client" ON)
option (USE_RECEIVER "Receiver" ON)
option (USE_GUI "GUI" OFF)
set(SLS_USE_TEXTCLIENT ON CACHE BOOL "Text Client")
set(SLS_USE_RECEIVER ON CACHE BOOL "Receiver")
set(SLS_USE_GUI OFF CACHE BOOL "GUI")
add_subdirectory(${SLS_DETECTOR_DIR})
......@@ -95,8 +95,10 @@ file(GLOB_RECURSE SLSDETECTOR_INCS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
add_library(slsdetector SHARED
src/SlsDetectorDefs.cpp
src/SlsDetectorFrameMap.cpp
src/SlsDetectorArgs.cpp
src/SlsDetectorCPUAffinity.cpp
src/SlsDetectorBebTools.cpp
src/SlsDetectorModel.cpp
src/SlsDetectorReceiver.cpp
src/SlsDetectorCamera.cpp
......@@ -134,7 +136,7 @@ message("NUMA_LIBRARY=" ${NUMA_LIBRARY})
target_link_libraries(slsdetector
PUBLIC limacore
PUBLIC slsDetectorShared slsReceiverShared zmq
PUBLIC slsDetectorShared slsReceiverShared
PUBLIC ${NUMA_LIBRARY}
)
......@@ -190,5 +192,5 @@ endif()
## Tests
if(CAMERA_ENABLE_TESTS)
enable_testing()
#add_subdirectory(test)
add_subdirectory(test)
endif()
This diff is collapsed.
......@@ -121,19 +121,24 @@ the current versions stored on the modules:
::
lisgeiger1:~/eiger/psi_eiger_500k_024_025/2018-04-01-1828 % \
server_dir="executables"
server_name="eigerDetectorServer"
server="${server_dir}/${server_name}"
server_str=$(echo ${server} | sed 's:/:_:g')
full_server="/home/root/${server}"
for m in ${EIGER_MODULES}; do
ssh -x root@${m} 'ls -l executables/eigerDetectorServer*' \
> ls_executables_eigerDetectorServer_${m}.out
ssh -x root@${m} 'ls -l '${server}'*' \
> ls_${server_str}_${m}.out
done
cat ls_executables_eigerDetectorServer_${EIGER_MODULE_TOP}.out
cat ls_${server_str}_${EIGER_MODULE_TOP}.out
echo
for m in ${EIGER_MODULES}; do
ssh -x root@${m} 'md5sum executables/eigerDetectorServer*' \
> md5sum_executables_eigerDetectorServer_${m}.out
ssh -x root@${m} 'md5sum '${server}'*' \
> md5sum_${server_str}_${m}.out
done
cat md5sum_executables_eigerDetectorServer_${EIGER_MODULE_TOP}.out
cat md5sum_${server_str}_${EIGER_MODULE_TOP}.out
echo
md5sum md5sum_executables_eigerDetectorServer_beb*
md5sum md5sum_${server_str}_beb*
-rwxr-xr-x 1 root root 280601 Jan 1 01:15 executables/eigerDetectorServer
-rwxr-xr-x 1 root root 277442 Aug 26 2016 executables/eigerDetectorServer_bkp
-rwxr-xr-x 1 root root 277442 Aug 26 2016 executables/eigerDetectorServerv2.0.5.14.3
......@@ -147,24 +152,56 @@ the current versions stored on the modules:
754a871d0608c28aa7544230ca728f86 md5sum_executables_eigerDetectorServer_beb024.out
754a871d0608c28aa7544230ca728f86 md5sum_executables_eigerDetectorServer_beb025.out
Kill the running servers and disable the automatic startup:
::
lisgeiger1:~/eiger/psi_eiger_500k_024_025/2018-04-01-1828 % \
for m in ${EIGER_MODULES}; do
ssh -x root@${m} killall ${server_name}
done
for m in ${EIGER_MODULES}; do
ssh -x root@${m} sed -i '"s:^#\?\('${full_server}'\).*$:#\1 \&:"' \
/etc/init.d/board_com.sh
done
Force a filesystem *sync* on each host to make the changes persistent,
just before power-cycling:
::
lisgeiger1:~/eiger/psi_eiger_500k_024_025/2018-04-01-1828 % \
for m in ${EIGER_MODULES}; do
ssh -x root@${m} sync
done
Power-cycle the detector and check that no *eigerDetectorServer* is running:
::
lisgeiger1:~/eiger/psi_eiger_500k_024_025/2018-04-01-1828 % \
for m in ${EIGER_MODULES}; do \
ssh -x root@${m} 'ps -ef | grep '${server}' | grep -v grep'; \
done
Backup the current version, and transfer the new version:
::
lisgeiger1:~/eiger/psi_eiger_500k_024_025/2018-04-01-1828 % \
for m in ${EIGER_MODULES}; do
ssh -x root@${m} 'mv executables/eigerDetectorServer executables/eigerDetectorServer_bkp'
ssh -x root@${m} 'mv '${server}' '${server}'_bkp'
done
SLS_DETECTOR_PACKAGE=${LIMA_DIR}/camera/slsdetector/slsDetectorPackage
eiger_servers=$(cd ${SLS_DETECTOR_PACKAGE} && find -name eigerDetectorServerv\*)
(cd ${SLS_DETECTOR_PACKAGE} && md5sum ${eiger_servers})
new_servers=$(cd ${SLS_DETECTOR_PACKAGE} && find -name ${server_name}v\*)
(cd ${SLS_DETECTOR_PACKAGE} && md5sum ${new_servers})
echo
eiger_server=${SLS_DETECTOR_PACKAGE}/$(echo "${eiger_servers}" | head -n 1)
new_server=${SLS_DETECTOR_PACKAGE}/$(echo "${new_servers}" | head -n 1)
for m in ${EIGER_MODULES}; do
scp ${eiger_server} root@${m}:executables
scp ${new_server} root@${m}:${server_dir}
done
for m in ${EIGER_MODULES}; do
ssh -x root@${m} "cp executables/$(basename ${eiger_server}) executables/eigerDetectorServer"
ssh -x root@${m} "cp ${server_dir}/$(basename ${new_server}) ${server}"
done
50ef053f1ddd0b49314479a558c9c330 ./slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.1.16.0
50ef053f1ddd0b49314479a558c9c330 ./serverBin/eigerDetectorServerv3.1.1.16.0
......@@ -181,18 +218,18 @@ Check that all is as expected:
this_dir="${base_dir}/$(date +%Y-%m-%d-%H%M)"
mkdir -p ${this_dir} && cd ${this_dir}
for m in ${EIGER_MODULES}; do
ssh -x root@${m} 'ls -l executables/eigerDetectorServer*' \
> ls_executables_eigerDetectorServer_${m}.out
ssh -x root@${m} 'ls -l '${server}'*' \
> ls_${server_str}_${m}.out
done
cat ls_executables_eigerDetectorServer_${EIGER_MODULE_TOP}.out
cat ls_${server_str}_${EIGER_MODULE_TOP}.out
echo
for m in ${EIGER_MODULES}; do
ssh -x root@${m} 'md5sum executables/eigerDetectorServer*' \
> md5sum_executables_eigerDetectorServer_${m}.out
ssh -x root@${m} 'md5sum '${server}'*' \
> md5sum_${server_str}_${m}.out
done
cat md5sum_executables_eigerDetectorServer_${EIGER_MODULE_TOP}.out
cat md5sum_${server_str}_${EIGER_MODULE_TOP}.out
echo
md5sum md5sum_executables_eigerDetectorServer_beb*
md5sum md5sum_${server_str}_beb*
-rwxr-xr-x 1 root root 293085 Jan 10 02:35 executables/eigerDetectorServer
-rwxr-xr-x 1 root root 280601 Jan 1 01:15 executables/eigerDetectorServer_bkp
-rwxr-xr-x 1 root root 277442 Aug 26 2016 executables/eigerDetectorServerv2.0.5.14.3
......@@ -208,8 +245,7 @@ Check that all is as expected:
4168a104e53ee71f763ed5f0e0b43859 md5sum_executables_eigerDetectorServer_beb024.out
4168a104e53ee71f763ed5f0e0b43859 md5sum_executables_eigerDetectorServer_beb025.out
Force a filesystem *sync* on each host to make the changes persistent,
just before power-cycling:
Force a another filesystem *sync*:
::
......@@ -228,12 +264,12 @@ And finally perform a *paranoid* check after power-cycling the detector:
this_dir="${base_dir}/$(date +%Y-%m-%d-%H%M)"
mkdir -p ${this_dir} && cd ${this_dir}
for m in ${EIGER_MODULES}; do
ssh -x root@${m} 'md5sum executables/eigerDetectorServer*' \
> md5sum_executables_eigerDetectorServer_${m}.out
ssh -x root@${m} 'md5sum '${server}'*' \
> md5sum_${server_str}_${m}.out
done
cd ..
for m in ${EIGER_MODULES}; do
(diff ${prev_dir}/md5sum_executables_eigerDetectorServer_${m}.out ${this_dir} &&
(diff ${prev_dir}/md5sum_${server_str}_${m}.out ${this_dir} &&
echo "${m} OK" || echo "${m} changed")
done
beb024 OK
......@@ -261,48 +297,50 @@ without the need of pressing the button in the rear panel. The latestversion of
::
lisgeiger1:~ % cd ~/eiger/fw_v18
lisgeiger1:~/eiger/fw_v18 % eiger_flash \
-m beb_fiber.bit \
-l feb_l_fx70t.bit -r feb_r_fx70t.bit \
-k simpleImage.virtex440-eiger-beb-hwid1_local \
-o ${this_dir}/eiger_flash.log ${EIGER_MODULES}
lisgeiger1:~/eiger/fw_v18 % \
this_dir="${base_dir}/$(date +%Y-%m-%d-%H%M)"
mkdir -p ${this_dir}
eiger_flash -m beb_fiber.bit \
-l feb_l_fx70t.bit -r feb_r_fx70t.bit \
-k simpleImage.virtex440-eiger-beb-hwid1_local \
-o ${this_dir}/eiger_flash.log ${EIGER_MODULES}
b69de7bbcb445d281f4ade4836028d1f beb_fiber.bit
da44706da1f11a39c2eebb2c63fff752 feb_l_fx70t.bit
d34fb69a1e4272d824bc2dea26efdd45 feb_r_fx70t.bit
1f27879faa7082f9ed2bb2b24b84ea99 simpleImage.virtex440-eiger-beb-hwid1_local
[beb024] Executing: nc -p 3000 -u beb024 3000
[beb025] Executing: nc -p 3000 -u beb025 3000
[beb024] Not in firmware flash mode ... ping'ing ...
[beb025] Not in firmware flash mode ... ping'ing ...
[beb024] ping OK ... Check ssh ...
[beb025] ping OK ... Check ssh ...
[beb024] Checking flash-mode setup files ...
[beb025] Checking flash-mode setup files ...
[beb024] Remote and local files differ!
[beb024] Local: 7f0e3fb00aa722d1b9c0b943b1870c70 boot_recovery
[beb024] Local: 89d25988ed13fbb94dd48ed4d6b49e0d z_mem
[beb024] Local: 3f95900e1928d3c59a6ec3afbc5373b0 z_mem_write
[beb024] remote: No file found!
[beb024] Copying flash-mode setup files ...
[beb025] Remote and local files differ!
[beb025] Local: 7f0e3fb00aa722d1b9c0b943b1870c70 boot_recovery
[beb025] Local: 89d25988ed13fbb94dd48ed4d6b49e0d z_mem
[beb025] Local: 3f95900e1928d3c59a6ec3afbc5373b0 z_mem_write
[beb025] remote: No file found!
[beb025] Copying flash-mode setup files ...
[beb025] Starting flash-mode (boot_recovery) ...
[beb024] Starting flash-mode (boot_recovery) ...
[beb025] Waiting for flash-mode (20 sec) ...
[beb024] Waiting for flash-mode (20 sec) ...
[beb025] Restarting Ethernet connection ...
[beb025] Waiting for connection (10 sec) ...
[beb024] Restarting Ethernet connection ...
[beb024] Waiting for connection (10 sec) ...
[beb025] Executing: nc -p 3000 -u beb025 3000
[beb024] Executing: nc -p 3000 -u beb024 3000
Hosts beb024,beb025 are not in firmware flash mode!
[beb021] Executing: nc -p 3000 -u beb021 3000
[beb020] Executing: nc -p 3000 -u beb020 3000
[beb021] Not in firmware flash mode ... ping'ing ...
[beb020] Not in firmware flash mode ... ping'ing ...
[beb021] ping OK ... Check ssh ...
[beb020] ping OK ... Check ssh ...
[beb021] Checking flash-mode setup files ...
[beb020] Checking flash-mode setup files ...
[beb021] Remote and local files differ!
[beb021] Local: 7f0e3fb00aa722d1b9c0b943b1870c70 boot_recovery
[beb021] Local: 89d25988ed13fbb94dd48ed4d6b49e0d z_mem
[beb021] Local: 3f95900e1928d3c59a6ec3afbc5373b0 z_mem_write
[beb021] remote: No file found!
[beb021] Copying flash-mode setup files ...
[beb020] Remote and local files differ!
[beb020] Local: 7f0e3fb00aa722d1b9c0b943b1870c70 boot_recovery
[beb020] Local: 89d25988ed13fbb94dd48ed4d6b49e0d z_mem
[beb020] Local: 3f95900e1928d3c59a6ec3afbc5373b0 z_mem_write
[beb020] remote: No file found!
[beb020] Copying flash-mode setup files ...
[beb020] Starting flash-mode (boot_recovery) ...
[beb021] Starting flash-mode (boot_recovery) ...
[beb020] Waiting for flash-mode (20 sec) ...
[beb021] Waiting for flash-mode (20 sec) ...
[beb020] Restarting Ethernet connection ...
[beb020] Waiting for connection (10 sec) ...
[beb021] Restarting Ethernet connection ...
[beb021] Waiting for connection (10 sec) ...
[beb020] Executing: nc -p 3000 -u beb020 3000
[beb021] Executing: nc -p 3000 -u beb021 3000
Hosts beb021,beb020 are not in firmware flash mode!
Please insert a clip into the rear panel hole until all LEDs are red,
and then wait until LED #4 blinks gren/red
Press any key to quit ...
......@@ -541,3 +579,38 @@ Console output on the FX70T FW:
.. note:: **To-Do** add a *ManualEthernetConnection* restart in case the modules are not
directly connected to the backend computer, or just not defined in the
*eiger_flash* utility.
Start the *eigerDetectorServer* and check that everything is OK:
::
lisgeiger1:~ % \
for m in ${EIGER_MODULES}; do
ssh -x root@${m} 'nohup '${server}' > /dev/null 2>&1 &'
done
Once verified that the new server runs fine with the new firmware, restore automatic startup:
::
lisgeiger1:~ % \
for m in ${EIGER_MODULES}; do
ssh -x root@${m} sed -i '"s:^#\?\('${full_server}'\).*$:\1 \&:"' \
/etc/init.d/board_com.sh
done
for m in ${EIGER_MODULES}; do
ssh -x root@${m} sync
done
Power-cycle the detector and verify that the servers start automatically:
::
lisgeiger1:~ % \
for m in ${EIGER_MODULES}; do \
ssh -x root@${m} 'ps -ef | grep '${server}' | grep -v grep'; \
done
961 root 0:00 /home/root/executables/eigerDetectorServer
965 root 0:00 /home/root/executables/eigerDetectorServer -stopserver
961 root 0:00 /home/root/executables/eigerDetectorServer
965 root 0:00 /home/root/executables/eigerDetectorServer -stopserver
......@@ -13,18 +13,27 @@ Properties
Property name Mandatory Default value Description
=============================== =============== =============== ==============================================================
config_fname Yes - Path to the SlsDetector config file
apply_corrections No True Perform corrections on each frame
high_voltage No 0 Initial detector high voltage (V)
(set to 150 if already tested)
fixed_clock_div No 0 Initial detector fixed-clock-div
threshold_energy No 0 Initial detector threshold energy (eV)
tolerate_lost_packets No True Initial tolerance to lost packets
netdev_groups No [] List of network device groups, each group is a list of
comma-separated interface names: ["ethX,ethY", "ethZ,..."]
pixel_depth_cpu_affinity_map No [] Default PixelDepthCPUAffinityMap as a list of 5+n-value tuple
strings (n is nb of netdev_groups):
["<pixel_depth>,<recv_l>,<recv_w>,<lima>,<other>[,<netdev_grp1>,...]", ...]
pixel_depth_cpu_affinity_map No [] Default PixelDepthCPUAffinityMap as Python string(s) defining a dict:
{<pixel_depth>: <global_affinity>}, being global_affinity a tuple:
(<recv_list>, <lima>, <other>, <netdev_grp_list>), where recv_list
is a list of tupples in the form: (<listeners>, <port_threads>),
where listeners and port_threads are tuples of affinities,
lima and and other are affinities, and netdev_grp_list is a list of
tuples in the form:
(<comma_separated_netdev_name_list>, <rx_queue_affinity_map>), the
latter in the form of: {<queue>: (<irq>, <processing>)}.
Each affinity can be expressed by one of the functions: Mask(mask)
or CPU(<cpu1>[, ..., <cpuN>]) for independent CPU enumeration
=============================== =============== =============== ==============================================================
.. note: The Eiger detector has currently 4 threads per port.
Attributes
----------
......@@ -33,6 +42,7 @@ Attribute name RW Type Description
=============================== ======= ======================= ===========================================================
config_fname ro DevString Path to the SlsDetector config file
hostname_list ro DevVarStringArray The list of the Eiger half-modules' hostnames
apply_corrections ro DevBoolean Pixel software corrections are applied on each frame
dac_name_list ro DevVarStringArray The list of the DAC signals' names
dac_<signal_name> rw DevVarLongArray Array with the DAC <signal_name> value for each half-module, in A/D units
dac_name_list_mv ro DevVarStringArray The list of the DAC signals' names supporting milli-volt units
......@@ -47,6 +57,7 @@ pixel_depth rw DevString The image pixel bit-depth:
raw_mode rw DevBoolean Publish image as given by the Receivers (no SW reconstruction)
threshold_energy rw DevLong The energy (in eV) the pixel discriminator thresholds (Vcmp & Trim bits) is set at
high_voltage rw DevShort The detector high voltage (in V)
tx_frame_delay rw DevLong Frame Tx delay (6.2 ns units)
all_trim_bits rw DevVarLongArray Array with the pixel trimming value [0-63] for each half-module, if all the pixels in the half-module have the same trimming value, -1 otherwise
clock_div rw DevString The readout clock divider:
- **FULL_SPEED**
......@@ -63,10 +74,8 @@ readout_flags rw DevString The flags affecting the readout mode (Parallel|Non
- **SAFE + CONTINUOUS**
max_frame_rate ro DevDouble Maximum number of frames per second (kHz)
tolerate_lost_packets rw DevBoolean Allow acquisitions with incomplete frames due to overrun
netdev_groups rw DevVarStringArray List of network device groups, each group is a list of
comma-separated interface names: ["ethX,ethY", "ethZ,..."]
pixel_depth_cpu_affinity_map rw DevDouble 5+n-col IMAGE PixelDepth -> CPUAffinity map as a 2D array:
(n=nb of netdev_groups) [[pixel_depth, recv_l, recv_w, lima, other[, <netdev_grp1>, ...]], ...]
pixel_depth_cpu_affinity_map rw DevString PixelDepth -> CPUAffinity map as a Python string
(see description of corresponding device property)
=============================== ======= ======================= ===========================================================
Please refer to the *PSI/SLS Eiger User's Manual* for more information about the above specfic configuration parameters.
......
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef __SLS_DETECTOR_BEB_TOOLS_H
#define __SLS_DETECTOR_BEB_TOOLS_H
#include "SlsDetectorCPUAffinity.h"
namespace lima
{
namespace SlsDetector
{
class BebShell
{
DEB_CLASS_NAMESPC(DebModCamera, "BebShell", "SlsDetector");
public:
BebShell(std::string hostname, std::string user = "root");
~BebShell();
std::string exec(std::string cmd);
private:
std::string readUntilPrompt();
AutoMutex lock()
{ return m_mutex; }
Mutex m_mutex;
AutoPtr<SystemCmdPipe> m_cmd;
bool m_echo;
std::string m_prompt;
};
class BebFpgaMem
{
DEB_CLASS_NAMESPC(DebModCamera, "BebFpgaMem", "SlsDetector");
public:
BebFpgaMem(BebShell& shell);
unsigned long read(unsigned long addr);
void write(unsigned long addr, unsigned long val);
private:
BebShell& m_shell;
std::string m_zmem_rd;
std::string m_zmem_wr;
};
} // namespace SlsDetector
} // namespace lima
#endif // __SLS_DETECTOR_BEB_TOOLS_H
......@@ -484,25 +484,33 @@ class SystemCPUAffinityMgr
struct RecvCPUAffinity {
CPUAffinityList listeners;
CPUAffinityList writers;
CPUAffinityList port_threads;
CPUAffinityList recv_threads;
RecvCPUAffinity();
CPUAffinity all() const;
RecvCPUAffinity& operator =(CPUAffinity a);
const CPUAffinityList& Listeners() const
{ return listeners; }
const CPUAffinityList& RecvThreads() const
{ return recv_threads; }
typedef const CPUAffinityList& (RecvCPUAffinity::*Selector)() const;
};
inline CPUAffinity RecvCPUAffinity::all() const
{
return (CPUAffinityList_all(listeners) | CPUAffinityList_all(writers) |
CPUAffinityList_all(port_threads));
return (CPUAffinityList_all(listeners) |
CPUAffinityList_all(recv_threads));
}
inline
bool operator ==(const RecvCPUAffinity& a, const RecvCPUAffinity& b)
{
return ((a.listeners == b.listeners) && (a.writers == b.writers));
return ((a.listeners == b.listeners) &&
(a.recv_threads == b.recv_threads));
}
inline
......@@ -522,6 +530,18 @@ inline CPUAffinity RecvCPUAffinityList_all(const RecvCPUAffinityList& l)
return CPUAffinityList_all(recv_aff_list);
}
inline CPUAffinity RecvCPUAffinityList_all(const RecvCPUAffinityList& l,
RecvCPUAffinity::Selector s)
{
CPUAffinityList recv_aff_list;
RecvCPUAffinityList::const_iterator it, end = l.end();
for (it = l.begin(); it != end; ++it) {
const CPUAffinityList& l = ((*it).*s)();
recv_aff_list.push_back(CPUAffinityList_all(l));
}
return CPUAffinityList_all(recv_aff_list);
}
struct GlobalCPUAffinity {
RecvCPUAffinityList recv;
CPUAffinity lima;
......
......@@ -41,6 +41,8 @@ namespace lima
namespace SlsDetector
{
class Eiger;
class Camera : public HwMaxImageSizeCallbackGen, public EventCallbackGen
{
DEB_CLASS_NAMESPC(DebModCamera, "Camera", "SlsDetector");
......@@ -53,7 +55,7 @@ public:
typedef Defs::DetStatus DetStatus;
typedef Defs::NetworkParameter NetworkParameter;
Camera(std::string config_fname);
Camera(std::string config_fname, int det_id = 0);
Camera(const Camera& o) = delete;
virtual ~Camera();
......@@ -71,19 +73,17 @@ public:
int getNbDetSubModules()
{ return m_det->getNMods(); }
int getTotNbPorts()
{ return m_recv_list.size() * m_recv_nb_ports; }
int getPortIndex(int recv_idx, int port)
{ return recv_idx * m_recv_nb_ports + port; }
int getNbRecvs()
{ return m_recv_list.size(); }
std::pair<int, int> splitPortIndex(int port_idx)
{ return std::pair<int, int>(port_idx / m_recv_nb_ports,
port_idx % m_recv_nb_ports); }
Receiver* getRecv(int i)
{ return m_recv_list[i]; }
void setBufferCtrlObj(NumaSoftBufferCtrlObj *buffer_ctrl_obj)
{ m_buffer_ctrl_obj = buffer_ctrl_obj; }
void clearAllBuffers();
void setPixelDepth(PixelDepth pixel_depth);
void getPixelDepth(PixelDepth& pixel_depth);
......@@ -100,8 +100,8 @@ public:
void getFrameDim(FrameDim& frame_dim, bool raw = false)
{ m_model->getFrameDim(frame_dim, raw); }
const FrameMap& getFrameMap()
{ return m_frame_map; }
FrameMap *getFrameMap()
{ return &m_frame_map; }
void putCmd(const std::string& s, int idx = -1);
std::string getCmd(const std::string& s, int idx = -1);
......@@ -143,19 +143,21 @@ public:
void setTolerateLostPackets(bool tol_lost_packets);
void getTolerateLostPackets(bool& tol_lost_packets);
int getNbBadFrames(int port_idx);
void getBadFrameList(int port_idx, int first_idx, int last_idx,
int getNbBadFrames(int item_idx);
void getBadFrameList(int item_idx, int first_idx, int last_idx,
IntList& bad_frame_list);
void getBadFrameList(int port_idx, IntList& bad_frame_list);
void getBadFrameList(int item_idx, IntList& bad_frame_list);
void prepareAcq();
void startAcq();
void stopAcq();
void triggerFrame();
void registerTimeRangesChangedCallback(TimeRangesChangedCallback& cb);
void unregisterTimeRangesChangedCallback(TimeRangesChangedCallback& cb);
void getStats(Stats& stats, int port_idx=-1);
void getStats(Stats& stats, int recv_idx=-1);
void setPixelDepthCPUAffinityMap(PixelDepthCPUAffinityMap aff_map);
void getPixelDepthCPUAffinityMap(PixelDepthCPUAffinityMap& aff_map);
......@@ -163,11 +165,12 @@ public:
GlobalCPUAffinityMgr::ProcessingFinishedEvent *
getProcessingFinishedEvent();
void reportException(Exception& e, std::string name);
private:
typedef std::map<int, int> RecvPortMap;
typedef std::queue<int> FrameQueue;
typedef std::vector<AutoPtr<Receiver> > RecvList;
typedef std::vector<Receiver::Port *> RecvPortList;
struct AppInputData
{
......@@ -223,10 +226,9 @@ private:
friend class Receiver;
friend class GlobalCPUAffinityMgr;
void setModel(Model *model);
friend class Eiger;
RecvPortList getRecvPortList();
Receiver::Port *getRecvPort(int port_idx);
void setModel(Model *model);
AutoMutex lock()
{ return AutoMutex(m_cond.mutex()); }
......@@ -252,7 +254,7 @@ private:
FrameType getLastReceivedFrame();
void waitLastSkippedFrame();
void processLastSkippedFrame(int port_idx);
void processLastSkippedFrame(int recv_idx);
void getSortedBadFrameList(IntList first_idx, IntList last_idx,
IntList& bad_frame_list );
......@@ -282,14 +284,13 @@ private: