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
bd643a4c
Commit
bd643a4c
authored
13 years ago
by
Carles Fenoy
Browse files
Options
Downloads
Patches
Plain Diff
added PriorityFlags parameter to allow configuration of multifactor plugin behavior
parent
af4ed738
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
slurm/slurm.h.in
+7
-0
7 additions, 0 deletions
slurm/slurm.h.in
src/common/read_config.c
+6
-0
6 additions, 0 deletions
src/common/read_config.c
src/plugins/priority/multifactor/priority_multifactor.c
+10
-0
10 additions, 0 deletions
src/plugins/priority/multifactor/priority_multifactor.c
with
23 additions
and
0 deletions
slurm/slurm.h.in
+
7
−
0
View file @
bd643a4c
...
...
@@ -588,6 +588,12 @@ enum ctx_keys {
#define PROP_PRIO_NICER 0x0002 /* Insure that user tasks have a nice
* value that is higher than slurmd */
enum prioflags{
PRIORITY_FLAGS_ACCRUE_ALWAYS = 1, /* Flag to always accrue age priority to pending jobs ignoring dependencies or holds */
};
/*****************************************************************************\
* SLURM HOSTLIST FUNCTIONS
\*****************************************************************************/
...
...
@@ -1860,6 +1866,7 @@ typedef struct slurm_ctl_conf {
uint32_t priority_calc_period; /* seconds between priority decay
* calculation */
uint16_t priority_favor_small; /* favor small jobs over large */
uint16_t priority_flags; /* set some flags for priority configuration */
uint32_t priority_max_age; /* time when not to add any more
* priority to a job if reached */
uint16_t priority_reset_period; /* when to clear usage,
...
...
This diff is collapsed.
Click to expand it.
src/common/read_config.c
+
6
−
0
View file @
bd643a4c
...
...
@@ -227,6 +227,7 @@ s_p_options_t slurm_conf_options[] = {
{
"PriorityMaxAge"
,
S_P_STRING
},
{
"PriorityUsageResetPeriod"
,
S_P_STRING
},
{
"PriorityType"
,
S_P_STRING
},
{
"PriorityFlags"
,
S_P_STRING
},
{
"PriorityWeightAge"
,
S_P_UINT32
},
{
"PriorityWeightFairshare"
,
S_P_UINT32
},
{
"PriorityWeightJobSize"
,
S_P_UINT32
},
...
...
@@ -2808,6 +2809,11 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
else
conf
->
priority_favor_small
=
0
;
conf
->
priority_flags
=
0
;
if
(
s_p_get_string
(
&
temp_str
,
"PriorityFlags"
,
hashtbl
))
{
if
(
strstr
(
temp_str
,
"ACCRUE_ALWAYS"
))
conf
->
priority_flags
|=
PRIORITY_FLAGS_ACCRUE_ALWAYS
;
}
if
(
s_p_get_string
(
&
temp_str
,
"PriorityMaxAge"
,
hashtbl
))
{
int
max_time
=
time_str2mins
(
temp_str
);
if
((
max_time
<
0
)
&&
(
max_time
!=
INFINITE
))
{
...
...
This diff is collapsed.
Click to expand it.
src/plugins/priority/multifactor/priority_multifactor.c
+
10
−
0
View file @
bd643a4c
...
...
@@ -128,6 +128,7 @@ static uint32_t weight_fs; /* weight for Fairshare factor */
static
uint32_t
weight_js
;
/* weight for Job Size factor */
static
uint32_t
weight_part
;
/* weight for Partition factor */
static
uint32_t
weight_qos
;
/* weight for QOS factor */
static
uint32_t
flags
;
/* Priority Flags */
extern
void
priority_p_set_assoc_usage
(
slurmdb_association_rec_t
*
assoc
);
extern
double
priority_p_calc_fs_factor
(
long
double
usage_efctv
,
...
...
@@ -459,12 +460,19 @@ static void _get_priority_factors(time_t start_time, struct job_record *job_ptr)
if
(
weight_age
)
{
uint32_t
diff
=
start_time
-
job_ptr
->
details
->
begin_time
;
if
(
flags
&
PRIORITY_FLAGS_ACCRUE_ALWAYS
)
diff
=
start_time
-
job_ptr
->
details
->
submit_time
;
if
(
job_ptr
->
details
->
begin_time
)
{
if
(
diff
<
max_age
)
job_ptr
->
prio_factors
->
priority_age
=
(
double
)
diff
/
(
double
)
max_age
;
else
job_ptr
->
prio_factors
->
priority_age
=
1
.
0
;
}
else
if
(
flags
&
PRIORITY_FLAGS_ACCRUE_ALWAYS
){
if
(
diff
<
max_age
)
job_ptr
->
prio_factors
->
priority_age
=
(
double
)
diff
/
(
double
)
max_age
;
else
job_ptr
->
prio_factors
->
priority_age
=
1
.
0
;
}
}
...
...
@@ -1129,6 +1137,7 @@ static void _internal_setup(void)
weight_js
=
slurm_get_priority_weight_job_size
();
weight_part
=
slurm_get_priority_weight_partition
();
weight_qos
=
slurm_get_priority_weight_qos
();
flags
=
slurmctld_conf
.
priority_flags
;
if
(
priority_debug
)
{
info
(
"priority: Max Age is %u"
,
max_age
);
...
...
@@ -1137,6 +1146,7 @@ static void _internal_setup(void)
info
(
"priority: Weight JobSize is %u"
,
weight_js
);
info
(
"priority: Weight Part is %u"
,
weight_part
);
info
(
"priority: Weight QOS is %u"
,
weight_qos
);
info
(
"priority: Flags is %u"
,
flags
);
}
}
...
...
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