Skip to content
Snippets Groups Projects
Commit 29b4ee64 authored by Moe Jette's avatar Moe Jette
Browse files

Add new configuration keyword, SchedulerRootFilter, to control

    external scheduler control of RoolOnly partition (Chris Holmes, HP).
parent 3cd00981
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,8 @@ documents those changes that are of interest to users and admins.
node registration (only when slurmd starts, not on periodic
registrtions).
-- Add federation switch plugin.
-- Add new configuration keyword, SchedulerRootFilter, to control
external scheduler control of RoolOnly partition (Chris Holmes, HP).
* Changes in SLURM 0.4.7
========================
......
......@@ -216,6 +216,11 @@ compiled.
The port number on which slurmctld should listen for connection requests.
This value is only used by the Maui Scheduler (see \fBSchedulerType\fR).
.TP
\fBSchedulerRootFilter\fR
Identifies whether or not RootOnly partitions should be filtered from
any external scheduling activities. Currently only used by the built-in
backfill scheduling module "sched/backfill" (see \fBSchedulerType\fR).
.TP
\fBSchedulerType\fR
Identifies the type of scheduler to be used. Acceptable values include
"sched/builtin" for the built-in FIFO scheduler,
......
......@@ -161,9 +161,17 @@
# which slurmctld should listen for connection
# requests.
#
# "SchedulerRootFilter" : for schedulers that support it (currently only
# sched/backfill). If set to '1' then scheduler
# will filter and avoid RootOnly partitions (let
# root user or process schedule these partitions).
# Otherwise scheduler will treat RootOnly
# partitions as any other standard partition.
#
# SchedulerType=sched/wiki
# SchedulerAuth=42
# SchedulerPort=7321
# SchedulerRootFilter=0 # default is '1'
#
......
......@@ -512,6 +512,8 @@ typedef struct slurm_ctl_conf {
char *schedtype; /* type of scheduler to use */
char *schedauth; /* credential for scheduler (if needed) */
uint16_t schedport; /* port for scheduler connection */
uint16_t schedrootfltr; /* 1 if rootOnly partitions should be
* filtered from scheduling (if needed) */
char *select_type; /* type of node selector to use */
uint16_t slurm_user_id; /* uid of slurm_user_name */
char *slurm_user_name; /* user that slurmctld runs as */
......
......@@ -117,6 +117,8 @@ void slurm_print_ctl_conf ( FILE* out,
slurm_ctl_conf_ptr->schedauth);
fprintf(out, "SchedulerPort = %u\n",
slurm_ctl_conf_ptr->schedport);
fprintf(out, "SchedulerRootFilter = %u\n",
slurm_ctl_conf_ptr->schedrootfltr);
fprintf(out, "SchedulerType = %s\n",
slurm_ctl_conf_ptr->schedtype);
fprintf(out, "SelectType = %s\n",
......
......@@ -363,6 +363,7 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr)
ctl_conf_ptr->ret2service = (uint16_t) NO_VAL;
xfree( ctl_conf_ptr->schedauth );
ctl_conf_ptr->schedport = (uint16_t) NO_VAL;
ctl_conf_ptr->schedrootfltr = (uint16_t) NO_VAL;
xfree( ctl_conf_ptr->schedtype );
xfree( ctl_conf_ptr->select_type );
ctl_conf_ptr->slurm_user_id = (uint16_t) NO_VAL;
......@@ -410,7 +411,7 @@ parse_config_spec (char *in_line, slurm_ctl_conf_t *ctl_conf_ptr)
int fast_schedule = -1, hash_base, heartbeat_interval = -1;
int inactive_limit = -1, kill_wait = -1;
int ret2service = -1, slurmctld_timeout = -1, slurmd_timeout = -1;
int sched_port = -1;
int sched_port = -1, sched_rootfltr = -1;
int slurmctld_debug = -1, slurmd_debug = -1;
int max_job_cnt = -1, min_job_age = -1, wait_time = -1;
int slurmctld_port = -1, slurmd_port = -1;
......@@ -461,6 +462,7 @@ parse_config_spec (char *in_line, slurm_ctl_conf_t *ctl_conf_ptr)
"ReturnToService=", 'd', &ret2service,
"SchedulerAuth=", 's', &sched_auth,
"SchedulerPort=", 'd', &sched_port,
"SchedulerRootFilter=", 'd', &sched_rootfltr,
"SchedulerType=", 's', &sched_type,
"SelectType=", 's', &select_type,
"SlurmUser=", 's', &slurm_user,
......@@ -690,6 +692,12 @@ parse_config_spec (char *in_line, slurm_ctl_conf_t *ctl_conf_ptr)
ctl_conf_ptr->schedport = (uint16_t) sched_port;
}
if ( sched_rootfltr != -1 ) {
if ( ctl_conf_ptr->schedrootfltr != (uint16_t) NO_VAL)
error (MULTIPLE_VALUE_MSG, "SchedulerRootFilter");
ctl_conf_ptr->schedrootfltr = (uint16_t) sched_rootfltr;
}
if ( sched_type ) {
if ( ctl_conf_ptr->schedtype ) {
xfree( ctl_conf_ptr->schedtype );
......@@ -1147,6 +1155,9 @@ validate_config (slurm_ctl_conf_t *ctl_conf_ptr)
if (ctl_conf_ptr->ret2service == (uint16_t) NO_VAL)
ctl_conf_ptr->ret2service = DEFAULT_RETURN_TO_SERVICE;
if (ctl_conf_ptr->schedrootfltr == (uint16_t) NO_VAL)
ctl_conf_ptr->schedrootfltr = DEFAULT_SCHEDROOTFILTER;
if (ctl_conf_ptr->schedtype == NULL)
ctl_conf_ptr->schedtype = xstrdup(DEFAULT_SCHEDTYPE);
......
......@@ -50,6 +50,7 @@
#endif
#define DEFAULT_RETURN_TO_SERVICE 0
#define DEFAULT_SAVE_STATE_LOC "/tmp"
#define DEFAULT_SCHEDROOTFILTER 1
#define DEFAULT_SCHEDTYPE "sched/builtin"
#ifdef HAVE_BGL /* Blue Gene specific default configuration parameters */
# define DEFAULT_SELECT_TYPE "select/bluegene"
......
......@@ -1738,6 +1738,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer)
pack16(build_ptr->ret2service, buffer);
packstr(build_ptr->schedauth, buffer);
pack16(build_ptr->schedport, buffer);
pack16(build_ptr->schedrootfltr, buffer);
packstr(build_ptr->schedtype, buffer);
packstr(build_ptr->select_type, buffer);
pack16(build_ptr->slurm_user_id, buffer);
......@@ -1803,6 +1804,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **
safe_unpack16(&build_ptr->ret2service, buffer);
safe_unpackstr_xmalloc(&build_ptr->schedauth, &uint16_tmp, buffer);
safe_unpack16(&build_ptr->schedport, buffer);
safe_unpack16(&build_ptr->schedrootfltr, buffer);
safe_unpackstr_xmalloc(&build_ptr->schedtype, &uint16_tmp, buffer);
safe_unpackstr_xmalloc(&build_ptr->select_type, &uint16_tmp, buffer);
safe_unpack16(&build_ptr->slurm_user_id, buffer);
......
......@@ -157,10 +157,13 @@ backfill_agent(void *args)
{
struct timeval tv1, tv2;
char tv_str[20];
bool filter_root = false;
/* Read config, node, and partitions; Write jobs */
slurmctld_lock_t all_locks = {
READ_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK };
if (sched_get_root_filter())
filter_root = true;
while (1) {
sleep(SLEEP_TIME); /* don't run continuously */
if (!_more_work())
......@@ -176,10 +179,11 @@ backfill_agent(void *args)
part_iterator = list_iterator_create(part_list);
while ((part_ptr = (struct part_record *)
list_next(part_iterator))) {
if ( ((part_ptr->root_only) ||
(part_ptr->shared) ||
if ( ((part_ptr->shared) ||
(part_ptr->state_up == 0)) )
continue; /* not under our control */
if ((part_ptr->root_only) && filter_root)
continue;
_attempt_backfill(part_ptr);
}
list_iterator_destroy(part_iterator);
......
......@@ -271,6 +271,7 @@ void _fill_ctld_conf(slurm_ctl_conf_t * conf_ptr)
conf_ptr->ret2service = slurmctld_conf.ret2service;
conf_ptr->schedauth = xstrdup(slurmctld_conf.schedauth);
conf_ptr->schedport = slurmctld_conf.schedport;
conf_ptr->schedrootfltr = slurmctld_conf.schedrootfltr;
conf_ptr->schedtype = xstrdup(slurmctld_conf.schedtype);
conf_ptr->select_type = xstrdup(slurmctld_conf.select_type);
conf_ptr->slurm_user_id = slurmctld_conf.slurm_user_id;
......
......@@ -94,6 +94,26 @@ const u_int16_t sched_get_port( void );
*/
const char * const sched_get_auth( void );
/*
* RootOnly partitions are typically exempted from external scheduling
* because these partitions are expected to be directly maintained by
* the root user (or some external meta-scheduler) that may have its
* own mechanisms for scheduling. However some cluster configurations
* may want to use RootOnly partitions simply to prevent non-root
* access, and would still like normal external scheduler operation to
* occur.
*
* This procedure reflects the "SchedulerRootFilter" setting in
* slurm.conf which allows the SLURM configuration to request how
* external schedulers handle RootOnly partition, if supported by
* the external scheduler. Currently only the SLURM backfill
* scheduler makes use of this.
*
* Returns non-zero if RootOnly partitions are to be filtered from
* any external scheduling efforts.
*/
const u_int16_t sched_get_root_filter( void );
/*
* Opaque type for a list of objects supplied by the controller.
* These objects are either jobs in the job queue, or nodes in the
......
......@@ -175,6 +175,24 @@ sched_get_auth( void )
return auth;
}
/* ************************************************************************ */
/* TAG( sched_get_root_filter ) */
/* ************************************************************************ */
const u_int16_t
sched_get_root_filter( void )
{
u_int16_t root_filter;
/* Locks: Read config */
slurmctld_lock_t config_read_lock = {
READ_LOCK, NO_LOCK, NO_LOCK, NO_LOCK };
lock_slurmctld(config_read_lock);
root_filter = slurmctld_conf.schedrootfltr;
unlock_slurmctld(config_read_lock);
return root_filter;
}
/* ************************************************************************ */
/* TAG( sched_get_obj_count ) */
/* ************************************************************************ */
......
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