Discussion:
including config files
Andrew Elwell
2014-10-23 02:58:31 UTC
Permalink
Hi Folks,

According to the docs (http://slurm.schedmd.com/slurm.conf.html) it
should be possible to have

include otherconfig.conf

in my slurm.conf,

however I'd like to make this ${ClusterName}.conf - is this possible to do this?

I see that in src/common/parse_config.c there seems to be some sort of
hook for this

static char *_parse_for_format(s_p_hashtbl_t *f_hashtbl, char *path)
{
char *filename = xstrdup(path);
char *format = NULL;
char *tmp_str = NULL;

while (1) {
if ((format = strstr(filename, "%c"))) { /* ClusterName */
if (!s_p_get_string(&tmp_str, "ClusterName",f_hashtbl)){
error("%s: Did not get ClusterName for include "
"path", __func__);
xfree(filename);
break;
}
xstrtolower(tmp_str);

but I can't work out how to do this

related, I also notice that it seems to need a fully qualified path -
is there a flexible shorthand for the same directory as the existing
config files?

Many thanks

Andrew
j***@public.gmane.org
2014-10-23 15:39:34 UTC
Permalink
That's a new feature in SLurm v14.11.
Post by Andrew Elwell
Hi Folks,
According to the docs (http://slurm.schedmd.com/slurm.conf.html) it
should be possible to have
include otherconfig.conf
in my slurm.conf,
however I'd like to make this ${ClusterName}.conf - is this possible to do this?
I see that in src/common/parse_config.c there seems to be some sort of
hook for this
static char *_parse_for_format(s_p_hashtbl_t *f_hashtbl, char *path)
{
char *filename = xstrdup(path);
char *format = NULL;
char *tmp_str = NULL;
while (1) {
if ((format = strstr(filename, "%c"))) { /* ClusterName */
if (!s_p_get_string(&tmp_str,
"ClusterName",f_hashtbl)){
error("%s: Did not get ClusterName for include "
"path", __func__);
xfree(filename);
break;
}
xstrtolower(tmp_str);
but I can't work out how to do this
related, I also notice that it seems to need a fully qualified path -
is there a flexible shorthand for the same directory as the existing
config files?
Many thanks
Andrew
--
Morris "Moe" Jette
CTO, SchedMD LLC
Andrew Elwell
2014-10-24 01:41:41 UTC
Permalink
Post by j***@public.gmane.org
That's a new feature in SLurm v14.11.
ah right, (digs out git blame, so it is) - Is there any equvalent
functionality or variable parsing in older (2.6.9 or 14.03) releases
prior to Natan's patch?
Morris Jette
2014-10-24 01:52:41 UTC
Permalink
Not unless you want to back port it as a local patch.
Post by Andrew Elwell
Post by j***@public.gmane.org
That's a new feature in SLurm v14.11.
ah right, (digs out git blame, so it is) - Is there any equvalent
functionality or variable parsing in older (2.6.9 or 14.03) releases
prior to Natan's patch?
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Christopher Samuel
2014-10-24 02:17:41 UTC
Permalink
Hiya Andrew,
Post by Andrew Elwell
should be possible to have
include otherconfig.conf
in my slurm.conf,
however I'd like to make this ${ClusterName}.conf - is this possible to do this?
You should be able to fudge that such that each cluster includes
local.conf but have local.conf as a symlink to $cluster.conf (and then
exclude local.conf from git/rsync or however else that is
managed/distributed, if it is automated).

We do this trick already with other tools here at VLSCI.

cheers,
Chris
--
Christopher Samuel Senior Systems Administrator
VLSCI - Victorian Life Sciences Computation Initiative
Email: samuel-***@public.gmane.org Phone: +61 (0)3 903 55545
http://www.vlsci.org.au/ http://twitter.com/vlsci
Loading...