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

select/cray: AlpsDir only used by apbasil/apkill

When using an emulated setting, the user is likely to specify both apbasil and
apkill, hence the AlpsDir variable could be refactored, which is what the patch
does. It falls back to the Cray-like defaults (/usr/bin) if nothing is set.
05_COSMETICS_Cray-conf-AlpsDir-simplification.diff from Gerrit Renker, CSCS
parent 23c00e6a
No related branches found
No related tags found
No related merge requests found
......@@ -429,33 +429,30 @@ but is provided for advanced configurations. If used, <i>cray.conf</i> must be
located in the same directory as the <i>slurm.conf</i> file.</p>
<dl>
<dt><b>AlpsDir</b>
<dd>Fully qualified pathname of the directory in which ALPS is installed.
The default value is <i>/usr</i>.
<dt><b>apbasil</b>
<dt><b>apbasil</b></dt>
<dd>Fully qualified pathname to the apbasil command.
The default value is <i>/usr/bin/apbasil</i>.
<dt><b>apkill</b>
The default value is <i>/usr/bin/apbasil</i>.</dd>
<dt><b>apkill</b></dt>
<dd>Fully qualified pathname to the apkill command.
The default value is <i>/usr/bin/apkill</i>.
<dt><b>SDBdb</b>
The default value is <i>/usr/bin/apkill</i>.</dd>
<dt><b>SDBdb</b></dt>
<dd>Name of the ALPS database.
The default value is <i>XTAdmin</i>.
<dt><b>SDBhost</b>
The default value is <i>XTAdmin</i>.</dd>
<dt><b>SDBhost</b></dt>
<dd>Hostname of the database server.
The default value is based upon the contents of the 'my.cnf' file used to
store default database access information and that defaults to user 'sdb'.
<dt><b>SDBpass</b>
store default database access information and that defaults to user 'sdb'.</dd>
<dt><b>SDBpass</b></dt>
<dd>Password used to access the ALPS database.
The default value is based upon the contents of the 'my.cnf' file used to
store default database access information and that defaults to user 'basic'.
<dt><b>SDBport</b>
store default database access information and that defaults to user 'basic'.</dd>
<dt><b>SDBport</b></dt>
<dd>Port used to access the ALPS database.
The default value is 0.
<dt><b>SDBuser</b>
The default value is 0.</dd>
<dt><b>SDBuser</b></dt>
<dd>Name of user used to access the ALPS database.
The default value is based upon the contents of the 'my.cnf' file used to
store default database access information and that defaults to user 'basic'.
store default database access information and that defaults to user 'basic'.</dd>
</dl></p>
<pre>
......
......@@ -52,7 +52,7 @@
cray_config_t *cray_conf = NULL;
s_p_options_t cray_conf_file_options[] = {
{"AlpsDir", S_P_STRING},
{"AlpsDir", S_P_STRING}, /* Vestigial option */
{"apbasil", S_P_STRING},
{"apkill", S_P_STRING},
{"SDBdb", S_P_STRING},
......@@ -101,7 +101,6 @@ extern int create_config(void)
cray_conf_file = _get_cray_conf();
if (stat(cray_conf_file, &config_stat) < 0) {
cray_conf->alps_dir = xstrdup(DEFAULT_ALPS_DIR);
cray_conf->apbasil = xstrdup(DEFAULT_APBASIL);
cray_conf->apkill = xstrdup(DEFAULT_APKILL);
cray_conf->sdb_db = xstrdup(DEFAULT_CRAY_SDB_DB);
......@@ -136,14 +135,11 @@ extern int create_config(void)
"conf file");
xfree(cray_conf_file);
if (!s_p_get_string(&cray_conf->alps_dir, "AlpsDir", tbl))
cray_conf->alps_dir = xstrdup(DEFAULT_ALPS_DIR);
if (!s_p_get_string(&cray_conf->apbasil, "apbasil", tbl))
cray_conf->apbasil = xstrdup_printf("%s/bin/apbasil",
cray_conf->alps_dir);
cray_conf->apbasil = xstrdup(DEFAULT_APBASIL);
if (!s_p_get_string(&cray_conf->apkill, "apkill", tbl))
cray_conf->apkill = xstrdup_printf("%s/bin/apkill",
cray_conf->alps_dir);
cray_conf->apkill = xstrdup(DEFAULT_APKILL);
if (!s_p_get_string(&cray_conf->sdb_db, "SDBdb", tbl))
cray_conf->sdb_db = xstrdup(DEFAULT_CRAY_SDB_DB);
if (!s_p_get_string(&cray_conf->sdb_host, "SDBhost", tbl))
......@@ -160,7 +156,6 @@ end_it:
#if 0
info("Cray conf is...");
info("\tAlpsDir=\t%s", cray_conf->alps_dir);
info("\tapbasil=\t%s", cray_conf->apbasil);
info("\tapkill=\t\t%s", cray_conf->apkill);
info("\tSDBdb=\t\t%s", cray_conf->sdb_db);
......@@ -177,7 +172,6 @@ extern int destroy_config(void)
int rc = SLURM_SUCCESS;
if (cray_conf) {
xfree(cray_conf->alps_dir);
xfree(cray_conf->apbasil);
xfree(cray_conf->apkill);
xfree(cray_conf->sdb_db);
......
......@@ -45,24 +45,10 @@
#include "slurm/slurm.h"
typedef struct {
char *alps_dir;
char *apbasil;
char *apkill;
char *sdb_db;
char *sdb_host;
char *sdb_pass;
uint32_t sdb_port;
char *sdb_user;
uint32_t slurm_debug_flags;
} cray_config_t;
/* Location of Alps install dir */
#define DEFAULT_ALPS_DIR "/usr"
/* Location of Alps apbasil executable (supported on XT/XE CNL) */
#define DEFAULT_APBASIL DEFAULT_ALPS_DIR "/bin/apbasil"
/* Location of Alps apkill executable (supported on XT/XE CNL) */
#define DEFAULT_APKILL DEFAULT_ALPS_DIR "/bin/apkill"
/* Location of ALPS apbasil executable (supported on XT/XE CNL) */
#define DEFAULT_APBASIL "/usr/bin/apbasil"
/* Location of ALPS apkill executable (supported on XT/XE CNL) */
#define DEFAULT_APKILL "/usr/bin/apkill"
/* database name to use */
#define DEFAULT_CRAY_SDB_DB "XTAdmin"
/* DNS name of SDB host */
......@@ -74,6 +60,29 @@ typedef struct {
/* If NULL, use value from my.cnf */
#define DEFAULT_CRAY_SDB_USER NULL
/**
* cray_config_t - Parsed representation of cray.conf
* @apbasil: full path to ALPS 'apbasil' executable
* @apkill: full path to ALPS 'apkill' executable
* @sdb_host: DNS name of SDB host
* @sdb_db: SDB database name to use (default XTAdmin)
* @sdb_user: SDB database username
* @sdb_pass: SDB database password
* @sdb_port: port number of SDB host
* @slurm_debug_flags: see code for details
*/
typedef struct {
char *apbasil;
char *apkill;
char *sdb_host;
char *sdb_db;
char *sdb_user;
char *sdb_pass;
uint32_t sdb_port;
uint32_t slurm_debug_flags;
} cray_config_t;
extern cray_config_t *cray_conf;
extern int create_config(void);
......
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