Skip to content

Commit d72f06e

Browse files
authored
remove "maint" and "drain" nodes which are inaccessible to the user (#916)
* remove maint and drain nodes which are inaccessible to the user * remove hanging ')'
1 parent cc747ff commit d72f06e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ood_core/job/adapters/slurm.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def initialize(cluster: nil, bin: nil, conf: nil, bin_overrides: {}, submit_host
123123
def get_cluster_info
124124
node_cpu_info = call("sinfo", "-aho %A/%D/%C").strip.split('/')
125125
gres_length = call("sinfo", "-o %G").lines.map(&:strip).map(&:length).max + 2
126-
gres_lines = call("sinfo", "-ahNO ,nodehost,gres:#{gres_length},gresused:#{gres_length}")
127-
.lines.uniq.map(&:split)
126+
gres_lines = call("sinfo", "-ahNO ,nodehost,gres:#{gres_length},gresused:#{gres_length},statelong")
127+
.lines.uniq.reject { |line| line.match?(/maint|drain/i) }.map(&:split)
128128
ClusterInfo.new(active_nodes: node_cpu_info[0].to_i,
129129
total_nodes: node_cpu_info[2].to_i,
130130
active_processors: node_cpu_info[3].to_i,

0 commit comments

Comments
 (0)