Skip to content

fix: treat Slurm default TMPDIR=/tmp as unset in HPC environments #1769

Closed

Description

@Jammy2211

Overview

Follow-up to #1767. A live probe on a RAL compute node (jobs 415133/415134) showed that a job submitted with --export=NONE and sourcing activate.sh still gets TMPDIR=/tmp. Slurm sets TMPDIR to its TmpFS itself when the submit environment has none, so the ${TMPDIR:-...} added in phase A never fires. Caches were already right; only temp files are affected.

Plan

  • In the five phase-A activate.sh files, replace TMPDIR when it is unset, empty or exactly /tmp; any other value still wins.
  • Same rule in PyAutoFit's generated campaign job scripts (cache_root:), with a test for the /tmp case.
  • The four claimed repos pick this up in phase B (Mind draft hpc_keep_temp_off_home_phase_b.md).

Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary

Detailed implementation plan

Affected Repositories

  • PyAutoFit (primary): autofit/campaign/scheduler/slurm.py _cache_exports; test_autofit/campaign/test_slurm.py
  • autofit_assistant, autofit_inference, autogalaxy_assistant, autolens_inference, autocti_assistant: activate.sh

Branch

feature/hpc-tmpdir-slurm-default; worktree ~/Code/PyAutoLabs-wt/hpc-tmpdir-slurm-default/

Implementation Steps

  1. _cache_exports: emit if [ -z "${TMPDIR:-}" ] || [ "$TMPDIR" = /tmp ]; then export TMPDIR="<root>/tmp"; fi instead of the fill-if-unset line; keep the other variables as they are.
  2. Tests: under bash, TMPDIR=/tmp → replaced; TMPDIR=/scratch → kept; unset → replaced.
  3. activate.sh ×5: the same if around the TMPDIR export; comment names the Slurm cause.
  4. Verify by sourcing under env -i with TMPDIR=/tmp, /scratch and unset.

Original Prompt

Click to expand starting prompt

Treat Slurm's default TMPDIR=/tmp as unset in activate.sh and campaign job scripts

Type: maintenance
Target: PyAutoFit
Repos:

  • PyAutoFit
  • autofit_assistant
  • autofit_inference
  • autogalaxy_assistant
  • autolens_inference
  • autocti_assistant
    Difficulty: small
    Autonomy: supervised
    Priority: high
    Status: formalised
    Consequence: glance
    Witness: a job with --export=NONE that sources a fixed activate.sh (or runs a PyAutoFit cache_root script) gets TMPDIR on the shared disk, not /tmp; a TMPDIR set to anything other than /tmp still wins; tests cover the /tmp case.
    Review-minutes: 3
    Filed: 2026-11-12

Follow-up to complete/2026/11/hpc-keep-off-home.md (PyAutoFit#1767). Live probe jobs
415133/415134 on euclid-ral-compute-1: with --export=NONE,... + source activate.sh the
caches were right but TMPDIR=/tmp, because Slurm sets TMPDIR to its TmpFS (/tmp) when
the submit environment has none, so phase A's ${TMPDIR:-...} never fires.

Human (2026-11-12): "fix the TMPDIR=/tmp gap now too".

Fix: treat TMPDIR that is unset, empty or exactly /tmp as unset —

  • the TMPDIR block in the five phase-A activate.sh files;
  • PyAutoFit autofit/campaign/scheduler/slurm.py _cache_exports, with a test for the
    /tmp case.
    The four claimed repos stay in draft/maintenance/workspaces/hpc_keep_temp_off_home_phase_b.md.

Activity

  1. Jammy2211 commented on Nov 12, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped under a Heart RED development override (2026-11-12). PRs:

    Heart RED development override

    Authorized live by the human on 2026-11-12 for this task (PyAutoFit#1769): "Override, ship + merge". That covers opening these PRs and merging them in the same turn once every required check is green. Heart remains RED for release purposes; this branch does not claim to fix Heart.

    Exact RED reasons at ship time:

    • PyAutoNerves: 2 commit(s) behind origin
    • PyAutoFit: 2 commit(s) behind origin
    • PyAutoLens: on branch feature/mge-feature-review (not main)
    • PyAutoLens: 2 uncommitted source change(s)
    • workspace validation not passing (2 failed, cloud#43034177136: autogalaxy_test scripts/misc/zero_contour_compat_jax.py, autolens_test scripts/misc/critical_curves_zero_contour_jit_grad.py)
    • manifest drift: workspace checkouts (manifest ↔ disk) — 1 mismatch(es) vs PyAutoMind/repos.yaml
    • PyAutoArray: open PR 8d old
    • release validation incomplete: no rehearsal for current source

    Branch gates passed: full PyAutoFit suite 4288 passed / 2 skipped / 1 xfailed; bash -n + three-case env -i source test (unset, /tmp, /scratch) of each activate.sh.

    Merge not done: the merge grant lapsed when the shipping turn ended while the test suite ran, so per AUTONOMY.md the human runs /prm once CI is green (PyAutoFit first).

  2. Jammy2211 commented on Nov 12, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped, merged 2026-11-12 on the human's explicit merge command under the Heart RED development override (every check green): #1771 (pending release), PyAutoLabs/autofit_assistant#64, PyAutoLabs/autofit_inference#20, PyAutoLabs/autogalaxy_assistant#47, PyAutoLabs/autolens_inference#66, PyAutoLabs/autocti_assistant#41. A TMPDIR that is unset, empty or Slurm's default /tmp now becomes the shared-disk tmp/; any other value wins. The four repos still claimed by other tasks get this through phase B (Mind draft hpc_keep_temp_off_home_phase_b.md).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions