|
56 | 56 | # only does so on Phoenix -- and a stale binary compiled for a different |
57 | 57 | # microarchitecture dies with SIGILL, which would be reported as a bad node and |
58 | 58 | # get a perfectly healthy one excluded. |
59 | | -newest_syscheck() { |
60 | | - # ls -t rather than find -printf: -printf is GNU-only, and on a BSD find it |
61 | | - # fails into 2>/dev/null, so discovery silently returns nothing and every |
62 | | - # probe is skipped as "no syscheck binary". |
63 | | - find "$@" -name syscheck -type f -exec ls -t {} + 2>/dev/null | head -1 |
| 59 | +# ls -t rather than find -printf: -printf is GNU-only, and on a BSD find it |
| 60 | +# fails into 2>/dev/null, so discovery silently returns nothing and every probe |
| 61 | +# is skipped as "no binary". |
| 62 | +newest_install_binary() { |
| 63 | + name=$1 |
| 64 | + shift |
| 65 | + find build/install "$@" -name "$name" -type f -exec ls -t {} + 2>/dev/null | head -1 |
64 | 66 | } |
65 | 67 |
|
66 | | -syscheck_bin=$(newest_syscheck build/install -path "*${device}*") |
67 | | -if [ -z "$syscheck_bin" ]; then |
68 | | - syscheck_bin=$(newest_syscheck build/install) |
69 | | -fi |
| 68 | +# Prefer this job's device, fall back to any. Used for both probe binaries. |
| 69 | +newest_for_device() { |
| 70 | + found=$(newest_install_binary "$1" -path "*${device}*") |
| 71 | + [ -n "$found" ] || found=$(newest_install_binary "$1") |
| 72 | + printf '%s\n' "$found" |
| 73 | +} |
| 74 | + |
| 75 | +syscheck_bin=$(newest_for_device syscheck) |
70 | 76 |
|
71 | 77 | if [ -z "$syscheck_bin" ]; then |
72 | 78 | # Nothing to probe with. A missing binary is a build problem, not a bad |
@@ -147,8 +153,7 @@ run_probe() { |
147 | 153 | # exclude every healthy node in the cluster. 132 is 128+4, a child killed by |
148 | 154 | # SIGILL; bash reports signals that way, and mpirun/srun forward it. |
149 | 155 | isa_probe() { |
150 | | - isa_bin=$(find build/install -name pre_process -type f -printf '%T@ %p\n' 2>/dev/null \ |
151 | | - | sort -rn | head -1 | cut -d' ' -f2-) |
| 156 | + isa_bin=$(newest_for_device pre_process) |
152 | 157 | [ -n "$isa_bin" ] || return 0 |
153 | 158 |
|
154 | 159 | isa_rc=0 |
|
0 commit comments