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
b438d41a
Commit
b438d41a
authored
15 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
modify preempt/qos to use actual job quality of service info (bitmaps and priority)
from the database
parent
74ab085e
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
NEWS
+1
-0
1 addition, 0 deletions
NEWS
src/plugins/preempt/qos/preempt_qos.c
+21
-7
21 additions, 7 deletions
src/plugins/preempt/qos/preempt_qos.c
with
22 additions
and
7 deletions
NEWS
+
1
−
0
View file @
b438d41a
...
@@ -16,6 +16,7 @@ documents those changes that are of interest to users and admins.
...
@@ -16,6 +16,7 @@ documents those changes that are of interest to users and admins.
Former users of SchedType=sched/gang should set SchedType=sched/backfill,
Former users of SchedType=sched/gang should set SchedType=sched/backfill,
PreemptType=preempt/partition_prio and PreemptMode=gang,suspend. See
PreemptType=preempt/partition_prio and PreemptMode=gang,suspend. See
web and slurm.conf man page for other options.
web and slurm.conf man page for other options.
PreemptType=preempt/qos uses Quality Of Service information in database.
-- In select/linear, optimize job placement across partitions.
-- In select/linear, optimize job placement across partitions.
-- If the --partition option is used with the sinfo or squeue command then
-- If the --partition option is used with the sinfo or squeue command then
print information about even hidden partitions.
print information about even hidden partitions.
...
...
This diff is collapsed.
Click to expand it.
src/plugins/preempt/qos/preempt_qos.c
+
21
−
7
View file @
b438d41a
...
@@ -43,12 +43,15 @@
...
@@ -43,12 +43,15 @@
#include
"src/common/bitstring.h"
#include
"src/common/bitstring.h"
#include
"src/common/log.h"
#include
"src/common/log.h"
#include
"src/common/plugin.h"
#include
"src/common/plugin.h"
#include
"src/common/slurm_accounting_storage.h"
#include
"src/slurmctld/slurmctld.h"
#include
"src/slurmctld/slurmctld.h"
const
char
plugin_name
[]
=
"Preempt by Quality Of Service (QOS)"
;
const
char
plugin_name
[]
=
"Preempt by Quality Of Service (QOS)"
;
const
char
plugin_type
[]
=
"preempt/qos"
;
const
char
plugin_type
[]
=
"preempt/qos"
;
const
uint32_t
plugin_version
=
100
;
const
uint32_t
plugin_version
=
100
;
static
bool
_qos_preemptable
(
struct
job_record
*
preemptee
,
struct
job_record
*
preemptor
);
static
void
_sort_pre_job_list
(
struct
job_record
**
pre_job_p
,
static
void
_sort_pre_job_list
(
struct
job_record
**
pre_job_p
,
int
pre_job_inx
);
int
pre_job_inx
);
...
@@ -104,10 +107,7 @@ extern struct job_record **find_preemptable_jobs(struct job_record *job_ptr)
...
@@ -104,10 +107,7 @@ extern struct job_record **find_preemptable_jobs(struct job_record *job_ptr)
while
((
job_p
=
(
struct
job_record
*
)
list_next
(
job_iterator
)))
{
while
((
job_p
=
(
struct
job_record
*
)
list_next
(
job_iterator
)))
{
if
(
!
IS_JOB_RUNNING
(
job_p
)
&&
!
IS_JOB_SUSPENDED
(
job_p
))
if
(
!
IS_JOB_RUNNING
(
job_p
)
&&
!
IS_JOB_SUSPENDED
(
job_p
))
continue
;
continue
;
/* FIXME: Change to some QOS comparison */
if
(
!
_qos_preemptable
(
job_p
,
job_ptr
))
if
((
job_p
->
account
==
NULL
)
||
(
job_ptr
->
account
==
NULL
)
||
(
job_p
->
account
[
0
]
>=
job_ptr
->
account
[
0
]))
continue
;
continue
;
if
((
job_p
->
node_bitmap
==
NULL
)
||
if
((
job_p
->
node_bitmap
==
NULL
)
||
(
bit_overlap
(
job_p
->
node_bitmap
,
(
bit_overlap
(
job_p
->
node_bitmap
,
...
@@ -134,6 +134,20 @@ extern struct job_record **find_preemptable_jobs(struct job_record *job_ptr)
...
@@ -134,6 +134,20 @@ extern struct job_record **find_preemptable_jobs(struct job_record *job_ptr)
return
pre_job_p
;
return
pre_job_p
;
}
}
static
bool
_qos_preemptable
(
struct
job_record
*
preemptee
,
struct
job_record
*
preemptor
)
{
acct_qos_rec_t
*
qos_ee
=
preemptee
->
qos_ptr
;
acct_qos_rec_t
*
qos_or
=
preemptee
->
qos_ptr
;
if
((
qos_ee
==
NULL
)
||
(
qos_or
==
NULL
)
||
(
qos_or
->
preempt_bitstr
==
NULL
)
||
(
!
bit_test
(
qos_or
->
preempt_bitstr
,
qos_ee
->
id
)))
return
false
;
return
true
;
}
/* Sort a list of jobs, lowest priority jobs are first */
/* Sort a list of jobs, lowest priority jobs are first */
static
void
_sort_pre_job_list
(
struct
job_record
**
pre_job_p
,
static
void
_sort_pre_job_list
(
struct
job_record
**
pre_job_p
,
int
pre_job_inx
)
int
pre_job_inx
)
...
@@ -149,9 +163,9 @@ static void _sort_pre_job_list(struct job_record **pre_job_p,
...
@@ -149,9 +163,9 @@ static void _sort_pre_job_list(struct job_record **pre_job_p,
* alternate algorithms could base job priority upon run time
* alternate algorithms could base job priority upon run time
* or other factors */
* or other factors */
for
(
i
=
0
;
i
<
pre_job_inx
;
i
++
)
{
for
(
i
=
0
;
i
<
pre_job_inx
;
i
++
)
{
/* FIXME: Change to some numeric QOS value */
acct_qos_rec_t
*
qos_ee
=
pre_job_p
[
i
]
->
qos_ptr
;
if
(
pre_job_p
[
i
]
->
account
)
if
(
qos_ee
)
job_prio
[
i
]
=
pre_job_p
[
i
]
->
account
[
0
]
<<
16
;
job_prio
[
i
]
=
(
qos_ee
->
priority
&
0xffff
)
<<
16
;
else
else
job_prio
[
i
]
=
0
;
job_prio
[
i
]
=
0
;
...
...
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