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

Move setting of default slurm configuration parameters into common/read_config.c.

Some of this was formerly in slurmctld/read_config.c.
parent 4e513f3b
No related branches found
No related tags found
No related merge requests found
......@@ -804,61 +804,101 @@ validate_config (slurm_ctl_conf_t *ctl_conf_ptr)
fatal ("MaxJobCount=%u, No jobs permitted",
ctl_conf_ptr->max_job_cnt);
if (ctl_conf_ptr->authtype == NULL)
ctl_conf_ptr->authtype = xstrdup(DEFAULT_AUTH_TYPE);
if (ctl_conf_ptr->fast_schedule == (uint16_t) NO_VAL)
ctl_conf_ptr->fast_schedule = DEFAULT_FAST_SCHEDULE;
if (ctl_conf_ptr->first_job_id == (uint32_t) NO_VAL)
ctl_conf_ptr->first_job_id = DEFAULT_FIRST_JOB_ID;
if (ctl_conf_ptr->hash_base == (uint16_t) NO_VAL)
ctl_conf_ptr->hash_base = DEFAULT_HASH_BASE;
if (ctl_conf_ptr->heartbeat_interval == (uint16_t) NO_VAL)
ctl_conf_ptr->heartbeat_interval = DEFAULT_HEARTBEAT_INTERVAL;
if (ctl_conf_ptr->inactive_limit == (uint16_t) NO_VAL)
ctl_conf_ptr->inactive_limit = DEFAULT_INACTIVE_LIMIT;
if (ctl_conf_ptr->job_comp_type == NULL)
ctl_conf_ptr->job_comp_type = xstrdup(DEFAULT_JOB_COMP_TYPE);
if (ctl_conf_ptr->kill_wait == (uint16_t) NO_VAL)
ctl_conf_ptr->kill_wait = DEFAULT_KILL_WAIT;
if (ctl_conf_ptr->max_job_cnt == (uint16_t) NO_VAL)
ctl_conf_ptr->max_job_cnt = DEFAULT_MAX_JOB_COUNT;
if (ctl_conf_ptr->min_job_age == (uint16_t) NO_VAL)
ctl_conf_ptr->min_job_age = DEFAULT_MIN_JOB_AGE;
if (ctl_conf_ptr->plugindir == NULL)
ctl_conf_ptr->plugindir = xstrdup(SLURM_PLUGIN_PATH);
if (ctl_conf_ptr->ret2service == (uint16_t) NO_VAL)
ctl_conf_ptr->ret2service = DEFAULT_RETURN_TO_SERVICE;
if (ctl_conf_ptr->slurm_user_name == NULL) {
ctl_conf_ptr->slurm_user_name = xstrdup("root");
ctl_conf_ptr->slurm_user_id = 0;
}
if (ctl_conf_ptr->slurmctld_debug != (uint16_t) NO_VAL)
_normalize_debug_level(&ctl_conf_ptr->slurmctld_debug);
else
ctl_conf_ptr->slurmctld_debug = LOG_LEVEL_INFO;
if (ctl_conf_ptr->slurmctld_pidfile == NULL)
ctl_conf_ptr->slurmctld_pidfile =
xstrdup(DEFAULT_SLURMCTLD_PIDFILE);
if (ctl_conf_ptr->slurmctld_port == (uint32_t) NO_VAL) {
servent = getservbyname (SLURMCTLD_PORT, NULL);
if (servent)
ctl_conf_ptr->slurmctld_port = servent -> s_port;
else
ctl_conf_ptr->slurmctld_port = strtol (SLURMCTLD_PORT,
(char **) NULL, 10);
ctl_conf_ptr->slurmctld_port = strtol (SLURMCTLD_PORT,
(char **) NULL, 10);
endservent ();
}
if (ctl_conf_ptr->slurmctld_timeout == (uint16_t) NO_VAL)
ctl_conf_ptr->slurmctld_timeout = DEFAULT_SLURMCTLD_TIMEOUT;
if (ctl_conf_ptr->slurmd_debug != (uint16_t) NO_VAL)
_normalize_debug_level(&ctl_conf_ptr->slurmd_debug);
else
ctl_conf_ptr->slurmd_debug = LOG_LEVEL_INFO;
if (ctl_conf_ptr->slurmd_pidfile == NULL)
ctl_conf_ptr->slurmd_pidfile = xstrdup(DEFAULT_SLURMD_PIDFILE);
if (ctl_conf_ptr->slurmd_port == (uint32_t) NO_VAL) {
servent = getservbyname (SLURMD_PORT, NULL);
if (servent)
ctl_conf_ptr->slurmd_port = servent -> s_port;
else
ctl_conf_ptr->slurmd_port = strtol (SLURMCTLD_PORT,
(char **) NULL, 10);
ctl_conf_ptr->slurmd_port = strtol (SLURMCTLD_PORT,
(char **) NULL, 10);
endservent ();
}
if (ctl_conf_ptr->slurmctld_debug != (uint16_t) NO_VAL)
_normalize_debug_level(&ctl_conf_ptr->slurmctld_debug);
if (ctl_conf_ptr->slurmd_debug != (uint16_t) NO_VAL)
_normalize_debug_level(&ctl_conf_ptr->slurmd_debug);
if (ctl_conf_ptr->slurmd_spooldir == NULL)
ctl_conf_ptr->slurmd_spooldir = xstrdup(DEFAULT_SPOOLDIR);
if (ctl_conf_ptr->kill_wait == (uint16_t) NO_VAL)
ctl_conf_ptr->kill_wait = DEFAULT_KILL_WAIT;
if (ctl_conf_ptr->slurmd_timeout == (uint16_t) NO_VAL)
ctl_conf_ptr->slurmd_timeout = DEFAULT_SLURMD_TIMEOUT;
if (ctl_conf_ptr->slurmctld_pidfile == NULL)
ctl_conf_ptr->slurmctld_pidfile =
xstrdup(DEFAULT_SLURMCTLD_PIDFILE);
if (ctl_conf_ptr->state_save_location == NULL)
ctl_conf_ptr->state_save_location = xstrdup(DEFAULT_SAVE_STATE_LOC);
if (ctl_conf_ptr->slurmd_pidfile == NULL)
ctl_conf_ptr->slurmd_pidfile = xstrdup(DEFAULT_SLURMD_PIDFILE);
if (ctl_conf_ptr->tmp_fs == NULL)
ctl_conf_ptr->tmp_fs = xstrdup(DEFAULT_TMP_FS);
if (ctl_conf_ptr->wait_time == (uint16_t) NO_VAL)
ctl_conf_ptr->wait_time = DEFAULT_WAIT_TIME;
if (ctl_conf_ptr->authtype == NULL)
ctl_conf_ptr->authtype = xstrdup(DEFAULT_AUTH_TYPE);
if (ctl_conf_ptr->job_comp_type == NULL)
ctl_conf_ptr->job_comp_type = xstrdup(DEFAULT_JOB_COMP_TYPE);
if (ctl_conf_ptr->plugindir == NULL)
ctl_conf_ptr->plugindir = xstrdup(SLURM_PLUGIN_PATH);
if (ctl_conf_ptr->slurm_user_name == NULL) {
ctl_conf_ptr->slurm_user_name = xstrdup("root");
ctl_conf_ptr->slurm_user_id = 0;
}
if (ctl_conf_ptr->slurmd_spooldir == NULL)
ctl_conf_ptr->slurmd_spooldir = xstrdup(DEFAULT_SPOOLDIR);
}
/* Normalize supplied debug level to be in range per log.h definitions */
......
......@@ -31,11 +31,23 @@
#include "src/common/slurm_protocol_defs.h"
#define DEFAULT_AUTH_TYPE "auth/none"
#define DEFAULT_FAST_SCHEDULE 1
#define DEFAULT_FIRST_JOB_ID 1
#define DEFAULT_HASH_BASE 10
#define DEFAULT_HEARTBEAT_INTERVAL 60
#define DEFAULT_INACTIVE_LIMIT 0
#define DEFAULT_JOB_COMP_TYPE "jobcomp/none"
#define DEFAULT_KILL_WAIT 30
#define DEFAULT_MAX_JOB_COUNT 2000
#define DEFAULT_MIN_JOB_AGE 300
#define DEFAULT_RETURN_TO_SERVICE 0
#define DEFAULT_SLURMCTLD_PIDFILE "/var/run/slurmctld.pid"
#define DEFAULT_SLURMCTLD_TIMEOUT 300
#define DEFAULT_SLURMD_PIDFILE "/var/run/slurmd.pid"
#define DEFAULT_SLURMD_TIMEOUT 300
#define DEFAULT_SPOOLDIR "/var/spool/slurmd"
#define DEFAULT_SAVE_STATE_LOC "/tmp"
#define DEFAULT_TMP_FS "/tmp"
#define DEFAULT_WAIT_TIME 0
/*
......
......@@ -856,42 +856,6 @@ static void _set_config_defaults(slurm_ctl_conf_t * ctl_conf_ptr,
if (ctl_conf_ptr->backup_controller == NULL)
info("read_slurm_conf: backup_controller not specified.");
if (ctl_conf_ptr->fast_schedule == (uint16_t) NO_VAL)
ctl_conf_ptr->fast_schedule = DEFAULT_FAST_SCHEDULE;
if (ctl_conf_ptr->first_job_id == (uint32_t) NO_VAL)
ctl_conf_ptr->first_job_id = DEFAULT_FIRST_JOB_ID;
if (ctl_conf_ptr->hash_base == (uint16_t) NO_VAL)
ctl_conf_ptr->hash_base = DEFAULT_HASH_BASE;
if (ctl_conf_ptr->heartbeat_interval == (uint16_t) NO_VAL)
ctl_conf_ptr->heartbeat_interval = DEFAULT_HEARTBEAT_INTERVAL;
if (ctl_conf_ptr->inactive_limit == (uint16_t) NO_VAL)
ctl_conf_ptr->inactive_limit = DEFAULT_INACTIVE_LIMIT;
if (ctl_conf_ptr->max_job_cnt == (uint16_t) NO_VAL)
ctl_conf_ptr->max_job_cnt = DEFAULT_MAX_JOB_COUNT;
if (ctl_conf_ptr->min_job_age == (uint16_t) NO_VAL)
ctl_conf_ptr->min_job_age = DEFAULT_MIN_JOB_AGE;
if (ctl_conf_ptr->ret2service == (uint16_t) NO_VAL)
ctl_conf_ptr->ret2service = DEFAULT_RETURN_TO_SERVICE;
if (ctl_conf_ptr->slurmctld_timeout == (uint16_t) NO_VAL)
ctl_conf_ptr->slurmctld_timeout = DEFAULT_SLURMCTLD_TIMEOUT;
if (ctl_conf_ptr->slurmd_timeout == (uint16_t) NO_VAL)
ctl_conf_ptr->slurmd_timeout = DEFAULT_SLURMD_TIMEOUT;
if (ctl_conf_ptr->state_save_location == NULL)
ctl_conf_ptr->state_save_location = xstrdup(DEFAULT_TMP_FS);
if (ctl_conf_ptr->tmp_fs == NULL)
ctl_conf_ptr->tmp_fs = xstrdup(DEFAULT_TMP_FS);
}
......
......@@ -104,19 +104,6 @@
/* Seconds to wait for backup controller response to REQUEST_CONTROL RPC */
#define CONTROL_TIMEOUT 4
/* Default configuration configuration file values */
#define DEFAULT_FAST_SCHEDULE 1
#define DEFAULT_FIRST_JOB_ID 1
#define DEFAULT_HASH_BASE 10
#define DEFAULT_HEARTBEAT_INTERVAL 60
#define DEFAULT_INACTIVE_LIMIT 0
#define DEFAULT_MAX_JOB_COUNT 2000
#define DEFAULT_MIN_JOB_AGE 300
#define DEFAULT_RETURN_TO_SERVICE 0
#define DEFAULT_SLURMCTLD_TIMEOUT 300
#define DEFAULT_SLURMD_TIMEOUT 300
#define DEFAULT_TMP_FS "/tmp"
/*****************************************************************************\
* General configuration parameters and data structures
\*****************************************************************************/
......
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