Skip to content

Commit a4ab33f

Browse files
authored
Merge pull request #201 from stackhpc/fix/hpl-partitions
Fix hpctests HPL where cluster has more more than one partition
2 parents 8b1ca56 + 9eebb88 commit a4ab33f

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.github/workflows/stackhpc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ jobs:
6969
. venv/bin/activate
7070
. environments/${{ matrix.cloud }}/activate
7171
cd $APPLIANCES_ENVIRONMENT_ROOT/terraform
72-
echo "::set-output name=messages::$(../../skeleton/\{\{cookiecutter.environment\}\}/terraform/getfaults.py $PWD)"
72+
TF_FAIL_MSGS="$(../../skeleton/\{\{cookiecutter.environment\}\}/terraform/getfaults.py $PWD)"
73+
echo $TF_FAIL_MSGS
74+
echo "::set-output name=messages::${TF_FAIL_MSGS}"
7375
env:
7476
OS_CLOUD: openstack
7577
TF_VAR_cluster_name: ci${{ github.run_id }}

ansible/roles/hpctests/library/slurm_node_info.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,16 @@ def run_module():
4747
if module.check_mode:
4848
module.exit_json(**result)
4949

50-
node_spec = ','.join(module.params['nodes'])
51-
_, stdout,_ = module.run_command("sinfo --Format All --node %s" % node_spec, check_rc=True)
50+
_, stdout,_ = module.run_command("sinfo --Format All --Node", check_rc=True) # `--nodes` doesn't filter enough, other partitions are still shown
5251
lines = stdout.splitlines()
53-
# if len(lines) > 2:
54-
# raise ValueError('Info requested for nodes which are not homogenous: %s' % lines)
5552
info = {}
5653
params = [v.strip() for v in lines[0].split('|')]
5754
values = [line.split('|') for line in lines[1:]]
55+
nodelist_ix = params.index('NODELIST')
5856
print(values)
5957
for ix, param in enumerate(params):
60-
info[param] = [nodeinfo[ix].strip() for nodeinfo in values]
58+
info[param] = [nodeinfo[ix].strip() for nodeinfo in values if nodeinfo[nodelist_ix].strip() in module.params['nodes']]
59+
# info[param] = [nodeinfo[nodelist_ix] for nodeinfo in values]
6160
result['info'] = info
6261

6362
module.exit_json(**result)

ansible/roles/hpctests/tasks/hpl-solo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- name: Check nodes are homogenous
1717
assert:
1818
that: "{{ hpctests_nodeinfo.info[item] | unique | length == 1 }}"
19-
fail_msg: "Selected nodes are not homogenous: {{ item }} = {{ hpctests_nodeinfo.info[item] }}"
19+
fail_msg: "Selected nodes are not homogenous: {{ item }} ({{ hpctests_nodeinfo.info['NODELIST'] }}) = {{ hpctests_nodeinfo.info[item] }}"
2020
loop:
2121
- SOCKETS
2222
- CORES

ansible/roles/hpctests/templates/hpl-build.sh.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#SBATCH --output=%x.%a.out
55
#SBATCH --error=%x.%a.out
66
#SBATCH --exclusive
7-
{%if hpctests_nodes is defined %}#SBATCH --nodelist={{ hpctests_nodes }}{% endif %}
7+
{%if hpctests_nodes is defined %}#SBATCH --nodelist={{ hpctests_computes.stdout_lines[0] }}{% endif %}
88

99
echo HPL arch: {{ hpctests_hpl_arch }}
1010

0 commit comments

Comments
 (0)