Skip to content

Commit f1b8c85

Browse files
andyclaude
andcommitted
offload: radium starts nothing from 17:00 to 21:00 (in use 18-21)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFPK14wBcLD1s4dYUowpP4
1 parent c3177bd commit f1b8c85

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎tools/offload/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ exit status is the command's (77 is SKIP). Examples:
3737

3838
`--host auto` (the default) prefers tellurium for `build`/`ctest` and radium
3939
for `teaching`/`apps`, takes the other if the first has no free slot, and
40-
queues on the first reachable host if both are full. **tellurium is someone's gaming computer and is used only in its owner's hours** (until 2026-10-08 14:00, then evenings 17-21 and weekend mornings 07-12; a job starts only with an hour left, see `tellurium_free` in the script). A host that does not answer within 5 s
40+
queues on the first reachable host if both are full. **tellurium is someone's gaming computer and is used only in its owner's hours** (until 2026-10-08 14:00, then evenings 17-21 and weekend mornings 07-12; a job starts only with an hour left, see `tellurium_free` in the script). radium starts nothing from 17:00 to 21:00
41+
(in use 18-21). A host that does not answer within 5 s
4142
is skipped. If
4243
no host is reachable the script exits 3 and says so; run the command locally
4344
then. Slots are `flock` files in `<work root>/locks`, so waiting jobs queue

‎tools/offload/run-offload.sh‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,25 @@ tellurium_free() {
3737
[ "$hm" -ge $((17 * 60)) ] && [ "$hm" -le $((20 * 60)) ] && return 0
3838
[ "$day" -ge 6 ] && [ "$hm" -ge $((7 * 60)) ] && [ "$hm" -le $((11 * 60)) ]
3939
}
40-
if [ "$host" = tellurium ] && ! tellurium_free; then
41-
echo "offload: tellurium is not available now (owner's hours); use radium" >&2
40+
# radium is in use on evenings 18-21: start nothing from 17:00 to 21:00.
41+
radium_free() {
42+
local hm=$((10#$(date +%H) * 60 + 10#$(date +%M)))
43+
[ "$hm" -lt $((17 * 60)) ] || [ "$hm" -ge $((21 * 60)) ]
44+
}
45+
host_free() { case $1 in tellurium) tellurium_free ;; radium) radium_free ;; *) true ;; esac; }
46+
if [ "$host" != auto ] && ! host_free "$host"; then
47+
echo "offload: $host is not available now (owner's hours)" >&2
4248
exit 3
4349
fi
4450
if [ "$host" = auto ]; then
4551
# Builds prefer tellurium, test suites radium. A host that does not
46-
# answer, or tellurium outside its hours, is skipped; if every reachable host
52+
# answer, or is outside its owner's hours, is skipped; if every reachable host
4753
# is full the job queues on the first reachable one.
4854
case $2 in build|ctest) order="tellurium radium" ;; *) order="radium tellurium" ;; esac
4955
host= queue=
5056
for h in $order; do
51-
if [ "$h" = tellurium ] && ! tellurium_free; then
52-
echo "offload: tellurium outside its hours, skipped" >&2; continue
57+
if ! host_free "$h"; then
58+
echo "offload: $h outside its hours, skipped" >&2; continue
5359
fi
5460
n=$(free "$h")
5561
[ "$n" -ge 0 ] || { echo "offload: $h unreachable, skipped" >&2; continue; }

0 commit comments

Comments
 (0)