Skip to content
Snippets Groups Projects
Commit bd643a4c authored by Carles Fenoy's avatar Carles Fenoy
Browse files

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
......@@ -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,
......
......@@ -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)) {
......
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment