From cb6c63492f88ba5fb8533f4e8a30fcff8e5e3bf2 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Thu, 12 Nov 2026 10:58:56 +0000 Subject: [PATCH] fix: treat Slurm's default TMPDIR=/tmp as unset in activate.sh Refs PyAutoLabs/PyAutoFit#1769 Co-Authored-By: Claude Opus 5.5 --- activate.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/activate.sh b/activate.sh index e282658..2f3387e 100644 --- a/activate.sh +++ b/activate.sh @@ -41,8 +41,12 @@ $BASE/PyAutoFit export ASTROPY_CACHE_DIR="${ASTROPY_CACHE_DIR:-$PYAUTO_HPC_CACHE/astropy}" # Temp files too: Python's tempfile, JAX and numba default to /tmp, which on RAL # compute nodes sits on the same small local disk (RAL admin, 2026-11-12). Use a - # `tmp/` next to the cache instead; a TMPDIR already set (e.g. by the job) wins. - export TMPDIR="${TMPDIR:-$(dirname "$PYAUTO_HPC_CACHE")/tmp}" + # `tmp/` next to the cache instead. + # Slurm sets TMPDIR=/tmp itself when the job environment has none, so /tmp counts + # as unset here; any other TMPDIR (e.g. a job's own scratch dir) wins. + if [ -z "${TMPDIR:-}" ] || [ "$TMPDIR" = /tmp ]; then + export TMPDIR="$(dirname "$PYAUTO_HPC_CACHE")/tmp" + fi mkdir -p "$TMPDIR" 2>/dev/null || true else echo "No local .venv found (set PYAUTO_HPC_BASE for a shared/HPC PyAuto checkout)." >&2