Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLAScommon
Commits
dfd8bb23
Commit
dfd8bb23
authored
Sep 13, 2020
by
Steffen Vogel
🎅🏼
Browse files
another round of fixes for the cpuset code
parent
892b4c71
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/villas/cpuset.hpp
View file @
dfd8bb23
...
...
@@ -167,17 +167,12 @@ public:
return
lhs
;
}
//bool& operator[](std::size_t cpu)
//{
// void cpuset_set_cpu(cpuset_t*setp, cpu_t cpu, int state)
//}
bool
operator
[](
size_t
cpu
)
const
{
return
is
s
et
(
cpu
);
return
is
S
et
(
cpu
);
}
bool
is
s
et
(
size_t
cpu
)
const
bool
is
S
et
(
size_t
cpu
)
const
{
return
CPU_ISSET_S
(
cpu
,
sz
,
setp
);
}
...
...
lib/cpuset.cpp
View file @
dfd8bb23
...
...
@@ -84,7 +84,7 @@ CpuSet::operator uintmax_t()
uintmax_t
iset
=
0
;
for
(
size_t
i
=
0
;
i
<
num_cpus
;
i
++
)
{
if
(
is
s
et
(
i
))
if
(
is
S
et
(
i
))
iset
|=
1ULL
<<
i
;
}
...
...
@@ -98,10 +98,10 @@ CpuSet::operator std::string ()
bool
first
=
true
;
for
(
size_t
i
=
0
;
i
<
num_cpus
;
i
++
)
{
if
(
is
s
et
(
i
))
{
if
(
is
S
et
(
i
))
{
size_t
run
=
0
;
for
(
size_t
j
=
i
+
1
;
j
<
num_cpus
;
j
++
)
{
if
(
!
is
s
et
(
j
))
if
(
!
is
S
et
(
j
))
break
;
run
++
;
...
...
tests/unit/utils.cpp
View file @
dfd8bb23
...
...
@@ -88,8 +88,8 @@ Test(utils, cpuset)
cr_assert_eq
(
cset3
,
cset4
);
cr_assert_eq
(
cset3
.
count
(),
5
);
cr_assert
(
cset3
.
is
s
et
(
3
));
cr_assert_not
(
cset3
.
is
s
et
(
6
));
cr_assert
(
cset3
.
is
S
et
(
3
));
cr_assert_not
(
cset3
.
is
S
et
(
6
));
cr_assert
(
cset3
[
3
]);
cr_assert_not
(
cset3
[
6
]);
...
...
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