What happened
Recipes written per the documented HPC pattern — srun $LC_SRUN_OVERLAP -A … <cmd> — deadlock when materialized through lc run inside a SLURM allocation. lc run srun-launches its dask worker with --nthreads=<all allocation CPUs> (a step holding the full allocation), and nothing sets LC_SRUN_OVERLAP in the worker's environment, so the recipe's inner srun expands to a plain step request that waits forever for CPUs the worker step never releases. Observed as a 30-minute silent hang (recipe step pending, squeue -s showing the dask step holding all cores); it would have waited until the allocation's walltime.
Workaround that fixed it: manually export LC_SRUN_OVERLAP="--overlap" in the environment that invokes lc run (it propagates through srun → worker → recipe shell).
Reproduction
salloc -N1 -c<N> --no-shell; srun --jobid=$JOBID --overlap lc run <output> where the output's recipe launches srun $LC_SRUN_OVERLAP … <heavy step>.
- Recipe's step queues indefinitely behind the dask worker step; no error, no progress.
Suggestion
lc run should set LC_SRUN_OVERLAP=--overlap itself (or launch its dask workers with --overlap) whenever it detects SLURM_JOB_ID and srun-launches workers — the variable is part of the documented recipe contract, so the engine that spawns the recipe environment should guarantee it.
Environment
- lightcone-cli: 0.3.8.dev25+ge403f216d
- Python: 3.14 (uv tool env)
- OS: Linux 4.18.0 (Leonardo, CINECA / SLURM)
— Claude (Fable) on behalf of Cail
What happened
Recipes written per the documented HPC pattern —
srun $LC_SRUN_OVERLAP -A … <cmd>— deadlock when materialized throughlc runinside a SLURM allocation.lc runsrun-launches its dask worker with--nthreads=<all allocation CPUs>(a step holding the full allocation), and nothing setsLC_SRUN_OVERLAPin the worker's environment, so the recipe's innersrunexpands to a plain step request that waits forever for CPUs the worker step never releases. Observed as a 30-minute silent hang (recipe step pending,squeue -sshowing the dask step holding all cores); it would have waited until the allocation's walltime.Workaround that fixed it: manually
export LC_SRUN_OVERLAP="--overlap"in the environment that invokeslc run(it propagates through srun → worker → recipe shell).Reproduction
salloc -N1 -c<N> --no-shell;srun --jobid=$JOBID --overlap lc run <output>where the output's recipe launchessrun $LC_SRUN_OVERLAP … <heavy step>.Suggestion
lc runshould setLC_SRUN_OVERLAP=--overlapitself (or launch its dask workers with--overlap) whenever it detectsSLURM_JOB_IDand srun-launches workers — the variable is part of the documented recipe contract, so the engine that spawns the recipe environment should guarantee it.Environment
— Claude (Fable) on behalf of Cail