Skip to content

Commit e1b1195

Browse files
sjpbScott Davidson
authored and
Scott Davidson
committed
return pingpong sbatch output if job fails
1 parent 2497481 commit e1b1195

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

ansible/roles/hpctests/tasks/pingpong.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,25 @@
1818
dest: "{{ hpctests_rootdir }}/pingpong/pingpong.sh"
1919

2020
- name: Run pingpong
21-
shell: sbatch --wait pingpong.sh
22-
become: no
23-
args:
24-
chdir: "{{ hpctests_rootdir }}/pingpong"
25-
register: hpctests_pingpong_sbatch
21+
block:
22+
- name: Submit jobscript
23+
shell: sbatch --wait pingpong.sh
24+
become: no
25+
args:
26+
chdir: "{{ hpctests_rootdir }}/pingpong"
27+
register: hpctests_pingpong_sbatch
28+
rescue:
29+
- name: Get slurm job output
30+
slurp:
31+
src: "{{ hpctests_rootdir }}/pingpong/pingpong.sh.out"
32+
register: _pingpong_out
33+
- name: Show job output
34+
debug:
35+
msg: |
36+
PingPong output was:
37+
38+
{{ _pingpong_out.content | b64decode }}
39+
failed_when: true
2640

2741
- set_fact:
2842
_pingpong_jobid: "{{ hpctests_pingpong_sbatch.stdout.split()[-1] }}"

0 commit comments

Comments
 (0)