From 100d3f2dc19a31189a887015e8449b58ea7e68fa Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Thu, 12 Nov 2026 10:02:46 +0000 Subject: [PATCH] fix: keep HPC caches and temp files off $HOME and /tmp in activate.sh Refs PyAutoLabs/PyAutoFit#1767 Co-Authored-By: Claude Opus 5.5 --- activate.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/activate.sh b/activate.sh index ab32832..dbf5561 100644 --- a/activate.sh +++ b/activate.sh @@ -23,6 +23,28 @@ $BASE/PyAutoFit:\ $BASE/PyAutoArray:\ $BASE/PyAutoGalaxy:\ $BASE/PyAutoCTI + # --- Keep caches and temp files OFF $HOME and /tmp on HPC --------------- + # On many clusters (RAL: every compute node) /home and /tmp sit on a small local + # disk, so tools that default to ~/.cache or /tmp — the PyAutoNerves JAX compile + # cache (~/.cache/pyauto_jax), pip, matplotlib, numba, CUDA/Triton kernels, Python's + # tempfile — fill it and break the node (RAL admin, 2026-09-25 and 2026-11-12). Send + # them to the shared project filesystem instead: by default `.cache/` and `tmp/` next + # to PYAUTO_HPC_BASE (override with PYAUTO_HPC_CACHE). Only unset variables are + # filled, so a submit script's own JAX_COMPILATION_CACHE_DIR still wins (and an + # explicitly EMPTY one still disables the JAX cache). Laptop `.venv` users never + # reach this branch. + export PYAUTO_HPC_CACHE="${PYAUTO_HPC_CACHE:-$(dirname "$PYAUTO_HPC_BASE")/.cache}" + mkdir -p "$PYAUTO_HPC_CACHE" 2>/dev/null || true + export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$PYAUTO_HPC_CACHE}" + export PIP_CACHE_DIR="${PIP_CACHE_DIR:-$PYAUTO_HPC_CACHE/pip}" + export MPLCONFIGDIR="${MPLCONFIGDIR:-$PYAUTO_HPC_CACHE/matplotlib}" + export NUMBA_CACHE_DIR="${NUMBA_CACHE_DIR:-$PYAUTO_HPC_CACHE/numba}" + export CUDA_CACHE_PATH="${CUDA_CACHE_PATH:-$PYAUTO_HPC_CACHE/nv}" + export TRITON_CACHE_DIR="${TRITON_CACHE_DIR:-$PYAUTO_HPC_CACHE/triton}" + export JAX_COMPILATION_CACHE_DIR="${JAX_COMPILATION_CACHE_DIR-$PYAUTO_HPC_CACHE/pyauto_jax}" + export ASTROPY_CACHE_DIR="${ASTROPY_CACHE_DIR:-$PYAUTO_HPC_CACHE/astropy}" + export TMPDIR="${TMPDIR:-$(dirname "$PYAUTO_HPC_CACHE")/tmp}" + mkdir -p "$TMPDIR" 2>/dev/null || true else echo "No local .venv found (set PYAUTO_HPC_BASE for a shared/HPC PyAuto checkout)." >&2 fi