0

I am running multiple jobs trying to have better performance results. To this end, I am generating a UUID and need the file name of the output to include this UUID.

Currently, I am defining the name of the output as follows: #SBATCH --output=/PATH/result.txt

and I am generating the UUID with this command: uuid= uuidgen -t

I need to add the generated uuid to the file name. How to do that? Thank you

ferdaous
  • 3
  • 2

1 Answers1

1

If your UUID can be non-random, you can just use the Slurm JobID which will be for all practical purposes, unique to the cluster. In that case, you will write

#SBATCH --output=/PATH/result-%j.txt

Otherwise, you will have to either

  • choose the UUID at submission time and run the sbatch command like this:
sbatch ... --output=/PATH/result-$(uuidgen -t).txt submission_script.slurm
  • or, redirect the output of the commands you run inside the submission script "by hand" with the exec command:
#!/bin/bash
#
#SBATCH ...
#SBATCH ...
FILE="PATH/result-$(uuidgen -t).txt"
exec > $FILE

...
damienfrancois
  • 52,978
  • 9
  • 96
  • 110