Commit 4928a7b2 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline

SlsDetector: move Port threads to the Eiger processing (receiver) level

parent 9acb474e
Pipeline #10342 passed with stages
in 34 seconds
......@@ -303,14 +303,14 @@ class SlsDetector(PyTango.Device_4Impl):
def getNbBadFrames(self, port_idx):
nb_bad_frames =;
def getNbBadFrames(self, recv_idx):
nb_bad_frames =;
deb.Return("nb_bad_frames=%s" % nb_bad_frames)
return nb_bad_frames
def getBadFrameList(self, port_idx):
bad_frame_list =;
def getBadFrameList(self, recv_idx):
bad_frame_list =;
deb.Return("bad_frame_list=%s" % bad_frame_list)
return bad_frame_list
......@@ -356,12 +356,12 @@ class SlsDetector(PyTango.Device_4Impl):
recv_aff, lima, other, netdev_aff = aff_data
global_aff = GlobalCPUAffinity()
recv_list = []
for recv_ports in recv_aff:
for recv_ports, recv_threads in recv_aff:
recv = RecvCPUAffinity()
l, w, pt = zip(*recv_ports)
l, w = zip(*recv_ports)
recv.listeners = list(l)
recv.writers = list(w)
recv.port_threads = list(chain(*pt))
recv.recv_threads = list(recv_threads)
global_aff.recv = recv_list
global_aff.lima = lima
......@@ -401,10 +401,8 @@ class SlsDetector(PyTango.Device_4Impl):
for pixel_depth, global_aff in sorted(aff_map.items()):
recv_list = []
for r in global_aff.recv:
n = len(r.port_threads) / len(r.listeners)
port_threads = zip(*[r.port_threads[i::n] for i in range(n)])
recv_aff = zip(r.listeners, r.writers, port_threads)
port_aff = zip(r.listeners, r.writers)
recv_list.append((port_aff, r.recv_threads))
recv_str = aff_2_str(recv_list)
lima_str = aff_2_str(global_aff.lima)
other_str = aff_2_str(global_aff.other)
......@@ -455,7 +453,7 @@ class SlsDetector(PyTango.Device_4Impl):
s = "Recv[%d]:" % i
s += " listeners=%s," % [A(x) for x in r.listeners]
s += " writers=%s," % [A(x) for x in r.writers]
s += " port_threads=%s" % [A(x) for x in r.port_threads]
s += " recv_threads=%s" % [A(x) for x in r.recv_threads]
deb.Always(' ' + s)
lima, other = global_aff.lima, global_aff.other
deb.Always(' Lima=%s, Other=%s' % (A(lima), A(other)))
......@@ -513,10 +511,11 @@ class SlsDetectorClass(PyTango.DeviceClass):
"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: (<port_1>, <port_2>), where portX "
"is a tupple of affinities: (<listener>, <writer>, <port_thread>), "
"lima and and other are affinities, and netdev_grp_list is a list of "
"tuples in the form: "
"is a list of tupples in the form: "
"((<port_1>, <port_2>), <recv_threads>), where portX is a tupple: "
"(<listener>, <writer>), being listener and writer are affinities, "
"recv_threads a tuple of affinities, lima 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) "
......@@ -534,10 +533,10 @@ class SlsDetectorClass(PyTango.DeviceClass):
[[PyTango.DevString, "SlsDetector command"],
[PyTango.DevString, "SlsDetector response"]],
[[PyTango.DevLong, "port_idx(-1=all)"],
[[PyTango.DevLong, "recv_idx(-1=all)"],
[PyTango.DevLong, "Number of bad frames"]],
[[PyTango.DevLong, "port_idx(-1=all)"],
[[PyTango.DevLong, "recv_idx(-1=all)"],
[PyTango.DevVarLongArray, "Bad frame list"]],
[[PyTango.DevString, "port_idx(-1=all):stats_name"],
Markdown is supported
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