Fix sinfo partition named all
This commit is contained in:
parent
a163ecb575
commit
fc54701400
2 changed files with 24 additions and 16 deletions
|
@ -132,9 +132,9 @@ def test_slurm_sinfo_reader():
|
|||
assert node.mem == 128
|
||||
assert not node.gpu
|
||||
|
||||
assert [node.cluster for node in nodes] == 7 * ['N/A'] + 6 * ['nautilus'] + 4 * ['waves']
|
||||
assert [node.cluster for node in nodes] == 7 * ['N/A'] + 12 * ['nautilus'] + 6 * ['waves']
|
||||
|
||||
assert len([node for node in nodes if node.state in ('idle', 'mixed')]) == 7
|
||||
assert len([node for node in nodes if node.state in ('idle', 'mixed')]) == 10
|
||||
|
||||
for node in nodes:
|
||||
if node.state == 'idle':
|
||||
|
@ -147,7 +147,7 @@ def test_slurm_sinfo_reader():
|
|||
assert node.cpu.allocated > 0
|
||||
assert node.cpu.idle == 0
|
||||
|
||||
assert sum(node.mem for node in nodes) == 4_672
|
||||
assert sum(node.mem for node in nodes) == 7_792
|
||||
|
||||
assert [node.gpu.name for node in nodes if node.gpu] == [
|
||||
'T4',
|
||||
|
@ -155,9 +155,9 @@ def test_slurm_sinfo_reader():
|
|||
'P100',
|
||||
'K80',
|
||||
'P100',
|
||||
] + 4 * ['A100']
|
||||
] + 8 * ['A100']
|
||||
|
||||
assert [node.gpu.nb for node in nodes if node.gpu] == [2, 2, 2, 4, 1, 1, 2, 4, 2]
|
||||
assert [node.gpu.nb for node in nodes if node.gpu] == [2, 2, 2, 4, 1, 1, 2, 4, 1, 2, 4, 2, 2]
|
||||
|
||||
|
||||
def test_slurm_sinfo_filter(monkeypatch):
|
||||
|
@ -170,13 +170,13 @@ def test_slurm_sinfo_filter(monkeypatch):
|
|||
assert len(clusters) == 3
|
||||
assert list(clusters) == ['N/A', 'nautilus', 'waves']
|
||||
|
||||
assert [len(partitions) for partitions in clusters.values()] == [2, 2, 2]
|
||||
assert [len(partitions) for partitions in clusters.values()] == [2, 3, 2]
|
||||
|
||||
partitions = clusters['nautilus']
|
||||
|
||||
assert isinstance(partitions, dict)
|
||||
assert len(partitions) == 2
|
||||
assert list(partitions) == ['gpu', 'all']
|
||||
assert len(partitions) == 3
|
||||
assert list(partitions) == ['gpu', 'visu', 'all']
|
||||
|
||||
gpu_nodes = partitions['gpu']
|
||||
|
||||
|
@ -191,14 +191,14 @@ def test_slurm_sinfo_filter(monkeypatch):
|
|||
# Get only `idle` nodes
|
||||
clusters = sinfo_filter(resources, with_states=('idle'))
|
||||
|
||||
assert list(clusters) == ['N/A', 'nautilus', 'waves']
|
||||
assert [len(partitions) for partitions in clusters.values()] == [1, 2, 1]
|
||||
assert list(clusters) == ['N/A', 'nautilus']
|
||||
assert [len(partitions) for partitions in clusters.values()] == [1, 3]
|
||||
|
||||
# Discard clusters without partition available
|
||||
clusters = sinfo_filter(resources, with_states=('completing'))
|
||||
|
||||
assert list(clusters) == ['nautilus']
|
||||
assert [len(partitions) for partitions in clusters.values()] == [1]
|
||||
assert [len(partitions) for partitions in clusters.values()] == [2]
|
||||
|
||||
|
||||
def test_slurm_sinfo_from_file(monkeypatch):
|
||||
|
@ -210,7 +210,7 @@ def test_slurm_sinfo_from_file(monkeypatch):
|
|||
for cluster, partitions in resources.items()
|
||||
for nodes in partitions.values()
|
||||
for node in nodes
|
||||
] == ['nazare001', 'gnode2', 'visu1', 'cribbar001']
|
||||
] == ['nazare001', 'gnode2', 'visu1', 'gnode2', 'visu1']
|
||||
|
||||
|
||||
def test_slurm_sinfo_resources(monkeypatch):
|
||||
|
@ -223,7 +223,7 @@ def test_slurm_sinfo_resources(monkeypatch):
|
|||
|
||||
partitions = clusters['nautilus']
|
||||
|
||||
assert list(partitions) == ['standard']
|
||||
assert list(partitions) == ['standard', 'all']
|
||||
|
||||
std_nodes = partitions['standard']
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue