Skip to content
Snippets Groups Projects
Commit 38e0af47 authored by Morris Jette's avatar Morris Jette
Browse files

Do not treat absense of gres.conf file as fatal error.

Do not treat the absence of a gres.conf file as a fatal error on systems
configured with GRES, but set GRES counts to zero. These counts can be
Counts can be altered by node_config_load() in the gres plugin.
parent 30ef1e98
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@ documents those changes that are of interest to users and admins.
4.6 compiler.
-- Fix for sview reservation tab when finding correct reservation.
-- Fix for handling QOS limits per user on a reconfig of the slurmctld.
-- Do not treat the absence of a gres.conf file as a fatal error on systems
configured with GRES, but set GRES counts to zero.
* Changes in SLURM 2.3.0-2
==========================
......
.TH "gres.conf" "5" "September 2010" "gres.conf 2.2" "Slurm configuration file"
.TH "gres.conf" "5" "September 2011" "gres.conf 2.3" "Slurm configuration file"
.SH "NAME"
gres.conf \- Slurm configuration file for generic resource management.
......@@ -8,7 +8,8 @@ of generic resources on each compute node. Each node must contain a
gres.conf file if generic resources are to be scheduled by SLURM.
The file location can be modified at system build time using the
DEFAULT_SLURM_CONF parameter. The file will always be located in the
same directory as the \fBslurm.conf\fP file.
same directory as the \fBslurm.conf\fP file. If generic resource counts are
set by the gres plugin function node_config_load(), this file may be optional.
.LP
Parameter names are case insensitive.
Any text following a "#" in the configuration file is treated
......
......@@ -765,9 +765,13 @@ extern int gres_plugin_node_config_devices_path(char **dev_path,
gres_plugin_init();
gres_conf_file = _get_gres_conf();
if (stat(gres_conf_file, &config_stat) < 0) {
error("can't stat gres.conf file %s: %m", gres_conf_file);
xfree(gres_conf_file);
return 0;
}
slurm_mutex_lock(&gres_context_lock);
if (stat(gres_conf_file, &config_stat) < 0)
fatal("can't stat gres.conf file %s: %m", gres_conf_file);
tbl = s_p_hashtbl_create(_gres_options);
if (s_p_parse_file(tbl, NULL, gres_conf_file, false) == SLURM_ERROR)
fatal("error opening/reading %s", gres_conf_file);
......@@ -796,7 +800,32 @@ extern int gres_plugin_node_config_devices_path(char **dev_path,
return count;
}
/* No gres.conf file found.
* Initialize gres table with zero counts of all resources.
* Counts can be altered by node_config_load() in the gres plugin. */
static int _no_gres_conf(uint32_t cpu_cnt)
{
int i, rc = SLURM_SUCCESS;
gres_slurmd_conf_t *p;
slurm_mutex_lock(&gres_context_lock);
FREE_NULL_LIST(gres_conf_list);
gres_conf_list = list_create(_destroy_gres_slurmd_conf);
if (gres_conf_list == NULL)
fatal("list_create: malloc failure");
p = xmalloc(sizeof(gres_slurmd_conf_t *) * gres_context_cnt);
for (i = 0; ((i < gres_context_cnt) && (rc == SLURM_SUCCESS)); i++) {
p = xmalloc(sizeof(gres_slurmd_conf_t));
p->cpu_cnt = cpu_cnt;
p->name = xstrdup(gres_context[i].gres_name);
p->plugin_id = gres_context[i].plugin_id;
list_append(gres_conf_list, p);
rc = (*(gres_context[i].ops.node_config_load))(gres_conf_list);
}
slurm_mutex_unlock(&gres_context_lock);
return rc;
}
/*
* Load this node's configuration (how many resources it has, topology, etc.)
......@@ -820,10 +849,15 @@ extern int gres_plugin_node_config_load(uint32_t cpu_cnt)
return SLURM_SUCCESS;
gres_conf_file = _get_gres_conf();
if (stat(gres_conf_file, &config_stat) < 0) {
error("can't stat gres.conf file %s, assuming zero resource "
"counts", gres_conf_file);
xfree(gres_conf_file);
return _no_gres_conf(cpu_cnt);
}
slurm_mutex_lock(&gres_context_lock);
gres_cpu_cnt = cpu_cnt;
if (stat(gres_conf_file, &config_stat) < 0)
fatal("can't stat gres.conf file %s: %m", gres_conf_file);
tbl = s_p_hashtbl_create(_gres_options);
if (s_p_parse_file(tbl, NULL, gres_conf_file, false) == SLURM_ERROR)
fatal("error opening/reading %s", gres_conf_file);
......
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