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

change node hash logic in order to support front-end systems with

 multiple node definition lines.
parent 7966b96b
No related branches found
No related tags found
No related merge requests found
...@@ -865,19 +865,36 @@ static void _push_to_hashtbls(char *alias, char *hostname, ...@@ -865,19 +865,36 @@ static void _push_to_hashtbls(char *alias, char *hostname,
/* Create the new data structure and link it into the hash tables */ /* Create the new data structure and link it into the hash tables */
new = (names_ll_t *)xmalloc(sizeof(*new)); new = (names_ll_t *)xmalloc(sizeof(*new));
new->alias = xstrdup(alias); new->alias = xstrdup(alias);
new->hostname = xstrdup(hostname); new->hostname = xstrdup(hostname);
new->address = xstrdup(address); new->address = xstrdup(address);
new->port = port; new->port = port;
new->cpus = cpus; new->cpus = cpus;
new->sockets = sockets; new->sockets = sockets;
new->cores = cores; new->cores = cores;
new->threads = threads; new->threads = threads;
new->addr_initialized = false; new->addr_initialized = false;
new->next_hostname = host_to_node_hashtbl[hostname_idx];
host_to_node_hashtbl[hostname_idx] = new; /* Put on end of each list */
new->next_alias = node_to_host_hashtbl[alias_idx]; new->next_alias = NULL;
node_to_host_hashtbl[alias_idx] = new; if (node_to_host_hashtbl[alias_idx]) {
p = node_to_host_hashtbl[alias_idx];
while (p->next_alias)
p = p->next_alias;
p->next_alias = new;
} else {
node_to_host_hashtbl[alias_idx] = new;
}
new->next_hostname = NULL;
if (host_to_node_hashtbl[hostname_idx]) {
p = host_to_node_hashtbl[hostname_idx];
while (p->next_hostname)
p = p->next_hostname;
p->next_hostname = new;
} else {
host_to_node_hashtbl[hostname_idx] = new;
}
} }
/* /*
...@@ -946,13 +963,8 @@ static int _register_conf_node_aliases(slurm_conf_node_t *node_ptr) ...@@ -946,13 +963,8 @@ static int _register_conf_node_aliases(slurm_conf_node_t *node_ptr)
#endif #endif
/* now build the individual node structures */ /* now build the individual node structures */
#ifdef HAVE_FRONT_END
/* we always want the first on in the list to be the one
* returned when looking for localhost
*/
while ((alias = hostlist_pop(alias_list))) {
#else
while ((alias = hostlist_shift(alias_list))) { while ((alias = hostlist_shift(alias_list))) {
#ifndef HAVE_FRONT_END
hostname = hostlist_shift(hostname_list); hostname = hostlist_shift(hostname_list);
address = hostlist_shift(address_list); address = hostlist_shift(address_list);
#endif #endif
......
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