Skip to content

Commit 2e6d78b

Browse files
authored
changed from uuidgen and exit with error if tmp dir creation fails (#162)
1 parent 91bcf64 commit 2e6d78b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/seml/templates/slurm/slurm_template.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ for i in $(seq 1 {experiments_per_job}); do
4949

5050
# Create directory for the source files in MongoDB
5151
if {with_sources}; then
52-
tmpdir="{tmp_directory}/$(uuidgen)" # unique temp dir based on UUID
52+
tmpdir=$(mktemp -d -p "{tmp_directory}" seml_sources.XXXXXXXX) || {{
53+
(>&2 echo "ERROR: Could not create temporary directory for source files under {tmp_directory}."); exit 1; }}
5354
# Prepend the temp dir and potential src paths to $PYTHONPATH so it will be used by python.
5455
# https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
5556
exp_pypath="$tmpdir:$tmpdir/src:$PYTHONPATH"

0 commit comments

Comments
 (0)