Skip to content

Commit

Permalink
Better checking of whether slurm is running
Browse files Browse the repository at this point in the history
  • Loading branch information
maouw committed Oct 25, 2023
1 parent 61c266f commit daafbd2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hyakvnc
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ function check_slurm_installed {
command -v squeue >/dev/null 2>&1 || return 1
}

# check_slurm_running {
# Check if SLURM is running
# Arguments: None
function check_slurm_running {
sinfo >/dev/null 2>&1 || return 1
}

# expand_slurm_node_range()
# Expand a SLURM node range to a list of nodes
# Arguments: <node range>
Expand Down Expand Up @@ -1681,7 +1688,9 @@ function main {
case "${action}" in
cmd_help | cmd_install | cmd_update | cmd_config)
if check_slurm_running; then
hyakvnc_config_init || log WARN "Could't initialize config automatically" # Don't exit if config can't be initialized (e.g., not running on SLURM)
fi
;;
*)
hyakvnc_config_init || exit 1 # Fill in default values for config variables or exit if config can't be initialized
Expand Down

0 comments on commit daafbd2

Please sign in to comment.