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
e94beab9
Commit
e94beab9
authored
15 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
change return code of _is_node_avail() from uint16_t to bool,
which is the proper data type for this function
parent
e98c2bc4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/select/cons_res/select_cons_res.c
+10
-10
10 additions, 10 deletions
src/plugins/select/cons_res/select_cons_res.c
with
10 additions
and
10 deletions
src/plugins/select/cons_res/select_cons_res.c
+
10
−
10
View file @
e94beab9
...
...
@@ -1169,7 +1169,7 @@ static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap,
/* Helper function for _synchronize_bitmap(). Check
* if the given node has at least one available CPU */
static
uint16_t
_is_node_avail
(
struct
part_res_record
*
p_ptr
,
uint32_t
node_i
)
static
bool
_is_node_avail
(
struct
part_res_record
*
p_ptr
,
uint32_t
node_i
)
{
uint32_t
i
,
r
,
cpu_begin
,
cpu_end
;
...
...
@@ -1178,7 +1178,7 @@ static uint16_t _is_node_avail(struct part_res_record *p_ptr, uint32_t node_i)
if
(
select_node_usage
[
node_i
].
node_state
>=
NODE_CR_RESERVED
)
{
if
(
!
cr_preemption_enabled
())
return
(
uint16_t
)
0
;
return
false
;
/* job_preemption has been enabled:
* check to see if the existing job that reserved
* this node is in a partition with a priority that
...
...
@@ -1195,10 +1195,10 @@ static uint16_t _is_node_avail(struct part_res_record *p_ptr, uint32_t node_i)
continue
;
for
(
i
=
cpu_begin
;
i
<
cpu_end
;
i
++
)
{
if
(
bit_test
(
s_ptr
->
row
[
0
].
row_bitmap
,
i
))
return
(
uint16_t
)
0
;
return
false
;
}
}
return
(
uint16_t
)
1
;
return
true
;
}
if
(
select_node_usage
[
node_i
].
node_state
>=
NODE_CR_ONE_ROW
)
{
/* An existing job has requested that it's CPUs
...
...
@@ -1209,25 +1209,25 @@ static uint16_t _is_node_avail(struct part_res_record *p_ptr, uint32_t node_i)
* node in the given partition.
*/
if
(
!
p_ptr
->
row
||
!
p_ptr
->
row
[
0
].
row_bitmap
)
return
(
uint16_t
)
1
;
return
true
;
for
(
i
=
cpu_begin
;
i
<
cpu_end
;
i
++
)
{
if
(
!
bit_test
(
p_ptr
->
row
[
0
].
row_bitmap
,
i
))
return
(
uint16_t
)
1
;
return
true
;
}
}
else
{
/* check the core_bitmap in all rows */
if
(
!
p_ptr
->
row
)
return
(
uint16_t
)
1
;
return
true
;
for
(
r
=
0
;
r
<
p_ptr
->
num_rows
;
r
++
)
{
if
(
!
p_ptr
->
row
[
r
].
row_bitmap
)
return
(
uint16_t
)
1
;
return
true
;
for
(
i
=
cpu_begin
;
i
<
cpu_end
;
i
++
)
{
if
(
!
bit_test
(
p_ptr
->
row
[
r
].
row_bitmap
,
i
))
return
(
uint16_t
)
1
;
return
true
;
}
}
}
return
(
uint16_t
)
0
;
return
false
;
}
...
...
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