Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
bed6b69b
Commit
bed6b69b
authored
18 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused function bit_and_set_count,
Move it's faster logic into the function bit_overlap, which is used.
parent
019d8775
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/bitstring.c
+3
-29
3 additions, 29 deletions
src/common/bitstring.c
src/common/bitstring.h
+0
-1
0 additions, 1 deletion
src/common/bitstring.h
with
3 additions
and
30 deletions
src/common/bitstring.c
+
3
−
29
View file @
bed6b69b
...
...
@@ -69,7 +69,6 @@ strong_alias(bit_or, slurm_bit_or);
strong_alias
(
bit_set_count
,
slurm_bit_set_count
);
strong_alias
(
bit_clear_count
,
slurm_bit_clear_count
);
strong_alias
(
bit_nset_max_count
,
slurm_bit_nset_max_count
);
strong_alias
(
bit_and_set_count
,
slurm_bit_and_set_count
);
strong_alias
(
int_and_set_count
,
slurm_int_and_set_count
);
strong_alias
(
bit_rotate_copy
,
slurm_bit_rotate_copy
);
strong_alias
(
bit_rotate
,
slurm_bit_rotate
);
...
...
@@ -507,16 +506,14 @@ extern int
bit_overlap
(
bitstr_t
*
b1
,
bitstr_t
*
b2
)
{
int
count
=
0
;
bit
str_t
*
my_bitmap
=
NULL
;
bit
off_t
bit
;
_assert_bitstr_valid
(
b1
);
_assert_bitstr_valid
(
b2
);
assert
(
_bitstr_bits
(
b1
)
==
_bitstr_bits
(
b2
));
my_bitmap
=
bit_copy
(
b1
);
bit_and
(
my_bitmap
,
b2
);
count
=
bit_set_count
(
my_bitmap
);
bit_free
(
my_bitmap
);
for
(
bit
=
0
;
bit
<
_bitstr_bits
(
b
);
bit
+=
sizeof
(
bitstr_t
)
*
8
)
count
+=
hweight
(
b1
[
_bit_word
(
bit
)]
&
b2
[
_bit_word
(
bit
)]);
return
count
;
}
...
...
@@ -729,29 +726,6 @@ bit_nset_max_count(bitstr_t *b)
return
maxcnt
;
}
/*
* And two bitstrings and count the number of set bits: SUM(b1 & b2)
* b1 (IN) first bitstring
* b2 (IN) second bitstring
*/
int
bit_and_set_count
(
bitstr_t
*
b1
,
bitstr_t
*
b2
)
{
bitoff_t
bit
;
bitstr_t
word
;
int
sum
;
_assert_bitstr_valid
(
b1
);
_assert_bitstr_valid
(
b2
);
assert
(
_bitstr_bits
(
b1
)
==
_bitstr_bits
(
b2
));
sum
=
0
;
for
(
bit
=
0
;
bit
<
_bitstr_bits
(
b1
);
bit
+=
sizeof
(
bitstr_t
)
*
8
)
{
word
=
b1
[
_bit_word
(
bit
)]
&
b2
[
_bit_word
(
bit
)];
sum
+=
hweight
(
word
);
}
return
(
sum
);
}
/*
* And an integer vector and a bitstring and sum the elements corresponding
* to set entries in b2: SUM(i1 & b2)
...
...
This diff is collapsed.
Click to expand it.
src/common/bitstring.h
+
0
−
1
View file @
bed6b69b
...
...
@@ -168,7 +168,6 @@ void bit_or(bitstr_t *b1, bitstr_t *b2);
int
bit_set_count
(
bitstr_t
*
b
);
int
bit_clear_count
(
bitstr_t
*
b
);
int
bit_nset_max_count
(
bitstr_t
*
b
);
int
bit_and_set_count
(
bitstr_t
*
b1
,
bitstr_t
*
b2
);
int
int_and_set_count
(
int
*
i1
,
int
ilen
,
bitstr_t
*
b2
);
bitstr_t
*
bit_rotate_copy
(
bitstr_t
*
b1
,
int
n
,
bitoff_t
nbits
);
void
bit_rotate
(
bitstr_t
*
b1
,
int
n
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment