Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-camera-slsdetector
Commits
41445775
Commit
41445775
authored
Sep 24, 2018
by
Alejandro Homs Puron
Committed by
Operator for ID00
Sep 25, 2018
Browse files
Simplify calculation of CPUAffinity envelop in lists of objs:
* Proposed by S. Debionne
parent
f6754333
Pipeline
#5525
failed with stages
in 23 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/SlsDetectorCPUAffinity.h
View file @
41445775
...
...
@@ -28,6 +28,8 @@
#include
"lima/CtControl.h"
#include
"lima/SimplePipe.h"
#include
<numeric>
namespace
lima
{
...
...
@@ -214,11 +216,9 @@ typedef std::vector<CPUAffinity> CPUAffinityList;
inline
CPUAffinity
CPUAffinityList_all
(
const
CPUAffinityList
&
l
)
{
CPUAffinity
all
;
if
(
l
.
size
()
>
0
)
{
CPUAffinityList
::
const_iterator
it
,
end
=
l
.
end
();
for
(
all
=
*
(
it
=
l
.
begin
())
++
;
it
!=
end
;
++
it
)
all
|=
*
it
;
}
if
(
!
l
.
empty
())
all
=
std
::
accumulate
(
std
::
next
(
l
.
begin
()),
l
.
end
(),
l
.
front
(),
std
::
bit_or
<
CPUAffinity
>
());
return
all
;
}
...
...
@@ -368,6 +368,15 @@ bool operator !=(const NetDevGroupCPUAffinity& a,
typedef
std
::
vector
<
NetDevGroupCPUAffinity
>
NetDevGroupCPUAffinityList
;
inline
CPUAffinity
NetDevGroupCPUAffinityList_all
(
const
NetDevGroupCPUAffinityList
&
l
)
{
CPUAffinityList
netdev_aff_list
;
NetDevGroupCPUAffinityList
::
const_iterator
it
,
end
=
l
.
end
();
for
(
it
=
l
.
begin
();
it
!=
end
;
++
it
)
netdev_aff_list
.
push_back
(
it
->
all
());
return
CPUAffinityList_all
(
netdev_aff_list
);
}
class
SystemCPUAffinityMgr
{
...
...
@@ -504,6 +513,15 @@ bool operator !=(const RecvCPUAffinity& a, const RecvCPUAffinity& b)
typedef
std
::
vector
<
RecvCPUAffinity
>
RecvCPUAffinityList
;
inline
CPUAffinity
RecvCPUAffinityList_all
(
const
RecvCPUAffinityList
&
l
)
{
CPUAffinityList
recv_aff_list
;
RecvCPUAffinityList
::
const_iterator
it
,
end
=
l
.
end
();
for
(
it
=
l
.
begin
();
it
!=
end
;
++
it
)
recv_aff_list
.
push_back
(
it
->
all
());
return
CPUAffinityList_all
(
recv_aff_list
);
}
struct
GlobalCPUAffinity
{
RecvCPUAffinityList
recv
;
CPUAffinity
lima
;
...
...
sip/SlsDetectorCPUAffinity.sip
View file @
41445775
...
...
@@ -292,6 +292,9 @@ struct NetDevGroupCPUAffinity {
// typedef std::vector<SlsDetector::NetDevGroupCPUAffinity>
// NetDevGroupCPUAffinityList;
SlsDetector::CPUAffinity NetDevGroupCPUAffinityList_all(
const SlsDetector::NetDevGroupCPUAffinityList& l);
class SystemCPUAffinityMgr
{
public:
...
...
@@ -329,6 +332,9 @@ struct RecvCPUAffinity {
// typedef std::vector<RecvCPUAffinity> RecvCPUAffinityList;
SlsDetector::CPUAffinity RecvCPUAffinityList_all(
const SlsDetector::RecvCPUAffinityList& l);
struct GlobalCPUAffinity {
SlsDetector::RecvCPUAffinityList recv;
SlsDetector::CPUAffinity lima;
...
...
src/SlsDetectorCPUAffinity.cpp
View file @
41445775
...
...
@@ -1345,14 +1345,8 @@ RecvCPUAffinity& RecvCPUAffinity::operator =(CPUAffinity a)
CPUAffinity
GlobalCPUAffinity
::
all
()
const
{
CPUAffinity
all
=
lima
|
other
;
RecvCPUAffinityList
::
const_iterator
rit
,
rend
=
recv
.
end
();
for
(
rit
=
recv
.
begin
();
rit
!=
rend
;
++
rit
)
all
|=
rit
->
all
();
NetDevGroupCPUAffinityList
::
const_iterator
nit
,
nend
=
netdev
.
end
();
for
(
nit
=
netdev
.
begin
();
nit
!=
nend
;
++
nit
)
all
|=
nit
->
all
();
return
all
;
return
(
RecvCPUAffinityList_all
(
recv
)
|
NetDevGroupCPUAffinityList_all
(
netdev
)
|
lima
|
other
);
}
void
GlobalCPUAffinity
::
updateRecvAffinity
(
CPUAffinity
a
)
...
...
@@ -1626,12 +1620,8 @@ void GlobalCPUAffinityMgr::recvFinished()
if
(
m_state
==
Ready
)
return
;
CPUAffinity
recv_all
;
RecvCPUAffinityList
::
const_iterator
it
,
end
=
m_curr
.
recv
.
end
();
if
((
it
=
m_curr
.
recv
.
begin
())
!=
end
)
for
(
recv_all
=
(
*
it
++
).
all
();
it
!=
end
;
++
it
)
recv_all
|=
it
->
all
();
CPUAffinity
recv_all
=
RecvCPUAffinityList_all
(
m_curr
.
recv
);
DEB_TRACE
()
<<
DEB_VAR2
(
m_curr
.
lima
,
recv_all
);
if
(
m_curr
.
lima
!=
recv_all
)
{
m_state
=
Changing
;
AutoMutexUnlock
u
(
l
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment