jobsslurm

How to specify slurm job array with input name 000 to 999


I generated my input files using split -a 3 command such that they are called

input_000.txt
input_001.txt
...
input_999.txt

However, when submitting with sbatch --array=000-999, 000 automatically becomes 0, which doesn't match any files. Is that a simple way to fill in the 0?


Solution

  • Try formatting the number with your desired format, like:

    $ for i in {0..2}; do printf "%03i\n" "${i}"; done
    000
    001
    002