From 2be9abdcf76e3bd172ccd60e14461ddb1cdcf9bb Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Wed, 10 Jun 2009 18:57:14 +0000 Subject: [PATCH] svn merge -r17785:17789 https://eris.llnl.gov/svn/slurm/branches/slurm-2.0 --- NEWS | 4 +- src/api/config_info.c | 4 ++ src/common/read_config.c | 15 ++++-- src/common/read_config.h | 2 + .../mysql/accounting_storage_mysql.c | 9 ++-- .../pgsql/accounting_storage_pgsql.c | 7 ++- src/plugins/jobcomp/mysql/jobcomp_mysql.c | 7 ++- src/plugins/jobcomp/pgsql/jobcomp_pgsql.c | 8 ++- src/slurmctld/job_mgr.c | 2 +- src/slurmctld/node_mgr.c | 52 ++++++++++++------- src/slurmdbd/read_config.c | 21 +++++++- 11 files changed, 86 insertions(+), 45 deletions(-) diff --git a/NEWS b/NEWS index 24e44c7b9f8..7103445631c 100644 --- a/NEWS +++ b/NEWS @@ -67,9 +67,11 @@ documents those changes that are of interest to users and admins. is greater than 1 and select/cons_res is used. -- Fix scontrol show config for accounting information when values are not set in the slurm.conf. --- Added a set of SBATCH_CPU_BIND* and SBATCH_MEM_BIND* env variables to keep + -- Added a set of SBATCH_CPU_BIND* and SBATCH_MEM_BIND* env variables to keep jobsteps launched from within a batch script from inheriting the CPU and memory affinity that was applied to the batch script. + -- Ignore the extra processors on a node above configured size if either + sched/gang or select/cons_res is configured. * Changes in SLURM 2.0.1 ======================== diff --git a/src/api/config_info.c b/src/api/config_info.c index 143241e8f39..c645df051f1 100644 --- a/src/api/config_info.c +++ b/src/api/config_info.c @@ -152,6 +152,8 @@ void slurm_print_ctl_conf ( FILE* out, slurm_ctl_conf_ptr->accounting_storage_host); fprintf(out, "AccountingStorageLoc = %s\n", slurm_ctl_conf_ptr->accounting_storage_loc); + fprintf(out, "AccountingStoragePass = %s\n", + slurm_ctl_conf_ptr->accounting_storage_pass); fprintf(out, "AccountingStoragePort = %u\n", slurm_ctl_conf_ptr->accounting_storage_port); fprintf(out, "AccountingStorageType = %s\n", @@ -239,6 +241,8 @@ void slurm_print_ctl_conf ( FILE* out, slurm_ctl_conf_ptr->job_comp_host); fprintf(out, "JobCompLoc = %s\n", slurm_ctl_conf_ptr->job_comp_loc); + fprintf(out, "JobCompPass = %s\n", + slurm_ctl_conf_ptr->job_comp_pass); fprintf(out, "JobCompPort = %u\n", slurm_ctl_conf_ptr->job_comp_port); fprintf(out, "JobCompType = %s\n", diff --git a/src/common/read_config.c b/src/common/read_config.c index 574b5b4f518..e6ba2eb5aea 100644 --- a/src/common/read_config.c +++ b/src/common/read_config.c @@ -1872,6 +1872,9 @@ validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) if (!s_p_get_string(&conf->job_comp_loc, "JobCompLoc", hashtbl)) { if(default_storage_loc) conf->job_comp_loc = xstrdup(default_storage_loc); + else if(!strcmp(conf->job_comp_type, "job_comp/mysql") + || !strcmp(conf->job_comp_type, "job_comp/pgsql")) + conf->job_comp_loc = xstrdup(DEFAULT_JOB_COMP_DB); else conf->job_comp_loc = xstrdup(DEFAULT_JOB_COMP_LOC); } @@ -2030,9 +2033,6 @@ validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) if(default_storage_loc) conf->accounting_storage_loc = xstrdup(default_storage_loc); - else - conf->accounting_storage_loc = - xstrdup(DEFAULT_STORAGE_LOC); } if (!s_p_get_string(&conf->accounting_storage_user, "AccountingStorageUser", hashtbl)) { @@ -2070,13 +2070,22 @@ validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) "accounting_storage/mysql")) { if(conf->accounting_storage_port == NO_VAL) conf->accounting_storage_port = 3306; + if(!conf->accounting_storage_loc) + conf->accounting_storage_loc = + xstrdup(DEFAULT_ACCOUNTING_DB); } else if(!strcmp(conf->accounting_storage_type, "accounting_storage/pgsql")) { if(conf->accounting_storage_port == NO_VAL) conf->accounting_storage_port = 5432; + if(!conf->accounting_storage_loc) + conf->accounting_storage_loc = + xstrdup(DEFAULT_ACCOUNTING_DB); } else { if(conf->accounting_storage_port == NO_VAL) conf->accounting_storage_port = DEFAULT_STORAGE_PORT; + if(!conf->accounting_storage_loc) + conf->accounting_storage_loc = + xstrdup(DEFAULT_STORAGE_LOC); } s_p_get_uint16(&conf->over_time_limit, "OverTimeLimit", hashtbl); diff --git a/src/common/read_config.h b/src/common/read_config.h index f5f740a70a6..ce0973684c5 100644 --- a/src/common/read_config.h +++ b/src/common/read_config.h @@ -55,6 +55,7 @@ extern char *default_plugstack; #define ACCOUNTING_ENFORCE_LIMITS 0x0002 #define ACCOUNTING_ENFORCE_WCKEYS 0x0004 +#define DEFAULT_ACCOUNTING_DB "slurm_acct_db" #define DEFAULT_ACCOUNTING_ENFORCE 0 #define DEFAULT_ACCOUNTING_STORAGE_TYPE "accounting_storage/none" #define DEFAULT_AUTH_TYPE "auth/munge" @@ -77,6 +78,7 @@ extern char *default_plugstack; #define DEFAULT_JOB_CKPT_DIR "/var/slurm/checkpoint" #define DEFAULT_JOB_COMP_TYPE "jobcomp/none" #define DEFAULT_JOB_COMP_LOC "/var/log/slurm_jobcomp.log" +#define DEFAULT_JOB_COMP_DB "slurm_jobcomp_db" #define DEFAULT_KILL_ON_BAD_EXIT 0 #define DEFAULT_KILL_TREE 0 #define DEFAULT_KILL_WAIT 30 diff --git a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c index 9a2986ca3b1..5f2be55ddf1 100644 --- a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c +++ b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c @@ -93,11 +93,8 @@ static char *mysql_db_name = NULL; static time_t global_last_rollup = 0; static pthread_mutex_t rollup_lock = PTHREAD_MUTEX_INITIALIZER; -#define DEFAULT_ACCT_DB "slurm_acct_db" #define DELETE_SEC_BACK 86400 - - char *acct_coord_table = "acct_coord_table"; char *acct_table = "acct_table"; char *assoc_day_table = "assoc_day_usage_table"; @@ -3400,20 +3397,20 @@ extern int init ( void ) location = slurm_get_accounting_storage_loc(); if(!location) - mysql_db_name = xstrdup(DEFAULT_ACCT_DB); + mysql_db_name = xstrdup(DEFAULT_ACCOUNTING_DB); else { int i = 0; while(location[i]) { if(location[i] == '.' || location[i] == '/') { debug("%s doesn't look like a database " "name using %s", - location, DEFAULT_ACCT_DB); + location, DEFAULT_ACCOUNTING_DB); break; } i++; } if(location[i]) { - mysql_db_name = xstrdup(DEFAULT_ACCT_DB); + mysql_db_name = xstrdup(DEFAULT_ACCOUNTING_DB); xfree(location); } else mysql_db_name = location; diff --git a/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c b/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c index 34d27b4b2f2..3b6b3659c61 100644 --- a/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c +++ b/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c @@ -77,7 +77,6 @@ const uint32_t plugin_version = 100; #ifndef HAVE_PGSQL typedef void PGconn; #else -#define DEFAULT_ACCT_DB "slurm_acct_db" static pgsql_db_info_t *pgsql_db_info = NULL; static char *pgsql_db_name = NULL; @@ -732,20 +731,20 @@ extern int init ( void ) location = slurm_get_accounting_storage_loc(); if(!location) - pgsql_db_name = xstrdup(DEFAULT_ACCT_DB); + pgsql_db_name = xstrdup(DEFAULT_ACCOUNTING_DB); else { int i = 0; while(location[i]) { if(location[i] == '.' || location[i] == '/') { debug("%s doesn't look like a database " "name using %s", - location, DEFAULT_ACCT_DB); + location, DEFAULT_ACCOUNTING_DB); break; } i++; } if(location[i]) { - pgsql_db_name = xstrdup(DEFAULT_ACCT_DB); + pgsql_db_name = xstrdup(DEFAULT_ACCOUNTING_DB); xfree(location); } else pgsql_db_name = location; diff --git a/src/plugins/jobcomp/mysql/jobcomp_mysql.c b/src/plugins/jobcomp/mysql/jobcomp_mysql.c index 09990470f7f..8e3182c83c7 100644 --- a/src/plugins/jobcomp/mysql/jobcomp_mysql.c +++ b/src/plugins/jobcomp/mysql/jobcomp_mysql.c @@ -79,7 +79,6 @@ const char plugin_name[] = "Job completion MYSQL plugin"; const char plugin_type[] = "jobcomp/mysql"; const uint32_t plugin_version = 100; -#define DEFAULT_JOBCOMP_DB "slurm_jobcomp_db" MYSQL *jobcomp_mysql_db = NULL; @@ -250,19 +249,19 @@ extern int slurm_jobcomp_set_location(char *location) return SLURM_SUCCESS; if(!location) - db_name = DEFAULT_JOBCOMP_DB; + db_name = DEFAULT_JOB_COMP_DB; else { while(location[i]) { if(location[i] == '.' || location[i] == '/') { debug("%s doesn't look like a database " "name using %s", - location, DEFAULT_JOBCOMP_DB); + location, DEFAULT_JOB_COMP_DB); break; } i++; } if(location[i]) - db_name = DEFAULT_JOBCOMP_DB; + db_name = DEFAULT_JOB_COMP_DB; else db_name = location; } diff --git a/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c b/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c index b8cafeade33..56df166c3b2 100644 --- a/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c +++ b/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c @@ -79,8 +79,6 @@ const char plugin_name[] = "Job completion POSTGRESQL plugin"; const char plugin_type[] = "jobcomp/pgsql"; const uint32_t plugin_version = 100; -#define DEFAULT_JOBCOMP_DB "slurm_jobcomp_db" - PGconn *jobcomp_pgsql_db = NULL; char *jobcomp_table = "jobcomp_table"; @@ -273,19 +271,19 @@ extern int slurm_jobcomp_set_location(char *location) return SLURM_SUCCESS; if(!location) - db_name = DEFAULT_JOBCOMP_DB; + db_name = DEFAULT_JOB_COMP_DB; else { while(location[i]) { if(location[i] == '.' || location[i] == '/') { debug("%s doesn't look like a database " "name using %s", - location, DEFAULT_JOBCOMP_DB); + location, DEFAULT_JOB_COMP_DB); break; } i++; } if(location[i]) - db_name = DEFAULT_JOBCOMP_DB; + db_name = DEFAULT_JOB_COMP_DB; else db_name = location; } diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index b287816d2db..89139ef9d3a 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -2329,7 +2329,7 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, if ((job_desc->time_limit == NO_VAL) && (part_ptr->default_time != NO_VAL)) - job_desc->time_limit = part_ptr->default_time; + job_desc->time_limit = part_ptr->default_time; if ((job_desc->time_limit != NO_VAL) && (job_desc->time_limit > part_ptr->max_time) && diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c index 262a2c21f3c..386d5948cfc 100644 --- a/src/slurmctld/node_mgr.c +++ b/src/slurmctld/node_mgr.c @@ -1642,22 +1642,25 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) } if (slurmctld_conf.fast_schedule != 2) { - int tot1, tot2; - tot1 = reg_msg->sockets * reg_msg->cores * reg_msg->threads; - tot2 = config_ptr->sockets * config_ptr->cores * - config_ptr->threads; - if (tot1 < tot2) { + int cores1, cores2; /* total cores on node */ + int threads1, threads2; /* total threads on node */ + cores1 = reg_msg->sockets * reg_msg->cores; + threads1 = cores1 * reg_msg->threads; + cores2 = config_ptr->sockets * config_ptr->cores; + threads2 = cores2 * config_ptr->threads; + if ((cores1 < cores2) || (threads1 < threads2)) { error("Node %s has low socket*core*thread count %u", - reg_msg->node_name, tot1); + reg_msg->node_name, threads1); error_code = EINVAL; reason_down = "Low socket*core*thread count"; } else if ((slurmctld_conf.fast_schedule == 0) && ((cr_flag == 1) || (gang_flag == 1)) && - (tot1 > tot2)) { + ((cores1 > cores2) || (threads1 > threads2))) { error("Node %s has high socket*core*thread count %u, " "extra resources ignored", - reg_msg->node_name, tot1); + reg_msg->node_name, threads1); /* Preserve configured values */ + reg_msg->cpus = config_ptr->cpus; reg_msg->sockets = config_ptr->sockets; reg_msg->cores = config_ptr->cores; reg_msg->threads = config_ptr->threads; @@ -1668,15 +1671,24 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) node_ptr->threads = reg_msg->threads; #endif - if ((slurmctld_conf.fast_schedule != 2) - && (reg_msg->cpus < config_ptr->cpus)) { - error ("Node %s has low cpu count %u", - reg_msg->node_name, reg_msg->cpus); - error_code = EINVAL; - reason_down = "Low CPUs"; + if (slurmctld_conf.fast_schedule != 2) { + if (reg_msg->cpus < config_ptr->cpus) { + error ("Node %s has low cpu count %u", + reg_msg->node_name, reg_msg->cpus); + error_code = EINVAL; + reason_down = "Low CPUs"; + } else if ((slurmctld_conf.fast_schedule == 0) && + ((cr_flag == 1) || (gang_flag == 1)) && + (reg_msg->cpus > config_ptr->cpus)) { + error("Node %s has high CPU count %u, " + "extra resources ignored", + reg_msg->node_name, reg_msg->cpus); + reg_msg->cpus = config_ptr->cpus; + } } - if ((node_ptr->cpus != reg_msg->cpus) - && (slurmctld_conf.fast_schedule == 0)) { + + if ((node_ptr->cpus != reg_msg->cpus) && + (slurmctld_conf.fast_schedule == 0)) { for (i=0; i<node_ptr->part_cnt; i++) { node_ptr->part_pptr[i]->total_cpus += (reg_msg->cpus - node_ptr->cpus); @@ -1684,8 +1696,8 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) } node_ptr->cpus = reg_msg->cpus; - if ((slurmctld_conf.fast_schedule != 2) - && (reg_msg->real_memory < config_ptr->real_memory)) { + if ((slurmctld_conf.fast_schedule != 2) && + (reg_msg->real_memory < config_ptr->real_memory)) { error ("Node %s has low real_memory size %u", reg_msg->node_name, reg_msg->real_memory); error_code = EINVAL; @@ -1693,8 +1705,8 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg) } node_ptr->real_memory = reg_msg->real_memory; - if ((slurmctld_conf.fast_schedule != 2) - && (reg_msg->tmp_disk < config_ptr->tmp_disk)) { + if ((slurmctld_conf.fast_schedule != 2) && + (reg_msg->tmp_disk < config_ptr->tmp_disk)) { error ("Node %s has low tmp_disk size %u", reg_msg->node_name, reg_msg->tmp_disk); error_code = EINVAL; diff --git a/src/slurmdbd/read_config.c b/src/slurmdbd/read_config.c index edac834022e..4e6c88d1350 100644 --- a/src/slurmdbd/read_config.c +++ b/src/slurmdbd/read_config.c @@ -310,9 +310,28 @@ extern int read_slurmdbd_conf(void) slurmdbd_conf->slurm_user_name = xstrdup("root"); slurmdbd_conf->slurm_user_id = 0; } + if (slurmdbd_conf->storage_type == NULL) fatal("StorageType must be specified"); - + + if(!strcmp(slurmdbd_conf->storage_type, + "accounting_storage/mysql")) { + if(!slurmdbd_conf->storage_port) + slurmdbd_conf->storage_port = 3306; + if(!slurmdbd_conf->storage_loc) + slurmdbd_conf->storage_loc = + xstrdup(DEFAULT_ACCOUNTING_DB); + } else if(!strcmp(slurmdbd_conf->storage_type, + "accounting_storage/pgsql")) { + if(!slurmdbd_conf->storage_port) + slurmdbd_conf->storage_port = 5432; + if(!slurmdbd_conf->storage_loc) + slurmdbd_conf->storage_loc = + xstrdup(DEFAULT_ACCOUNTING_DB); + } else + if(!slurmdbd_conf->storage_port) + slurmdbd_conf->storage_port = DEFAULT_STORAGE_PORT; + if (slurmdbd_conf->archive_dir) { if(stat(slurmdbd_conf->archive_dir, &buf) < 0) fatal("Failed to stat the archive directory %s: %m", -- GitLab