Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hydra: remove dependency on libslurm #7260

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/pm/hydra/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,6 @@ AM_CONDITIONAL([HYDRA_HAVE_HWLOC], [test "${pac_have_hwloc}" = "yes"])
AC_MSG_CHECKING([available processor topology libraries])
AC_MSG_RESULT([$available_topolibs])

#########################################################################
# Slurm hostlist parsing
#########################################################################
PAC_CHECK_HEADER_LIB_OPTIONAL([slurm],[slurm/slurm.h],[slurm],[slurm_hostlist_create])
if test "$pac_have_slurm" = "yes" ; then
AC_DEFINE(HAVE_SLURM,1,[Define if slurm is available])
fi

#########################################################################
# POSIX Regcomp
#########################################################################
Expand Down
32 changes: 2 additions & 30 deletions src/pm/hydra/lib/tools/bootstrap/external/slurm_query_node_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#include "slurm.h"

/* START UNIT - list_to_nodes */
#if defined(HAVE_SLURM)
#include <slurm/slurm.h> /* for slurm_hostlist_create */
#elif defined(HAVE_POSIX_REGCOMP)
#if defined(HAVE_POSIX_REGCOMP)
#include <regex.h> /* for POSIX regular expressions */

#define MAX_GMATCH 5 /* max number of atoms in group matches + 1 */
Expand All @@ -23,33 +21,7 @@
static int *tasks_per_node = NULL;
static struct HYD_node *global_node_list = NULL;

#if defined(HAVE_SLURM)
static HYD_status list_to_nodes(char *str)
{
hostlist_t *hostlist;
char *host;
int k = 0;
HYD_status status = HYD_SUCCESS;

if ((hostlist = slurm_hostlist_create(str)) == NULL) {
status = HYD_FAILURE;
goto fn_fail;
}

for (host = slurm_hostlist_shift(hostlist); host; host = slurm_hostlist_shift(hostlist)) {
status = HYDU_add_to_node_list(host, tasks_per_node[k++], &global_node_list);
HYDU_ERR_POP(status, "unable to add to node list\n");
}

slurm_hostlist_destroy(hostlist);

fn_exit:
return status;

fn_fail:
goto fn_exit;
}
#elif defined(HAVE_POSIX_REGCOMP)
#if defined(HAVE_POSIX_REGCOMP)
static HYD_status list_to_nodes(char *str)
{
regex_t gmatch_old[2];
Expand Down