Job arrays: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Added bash code for the selection of input file based on array task)
No edit summary
Line 20: Line 20:
  my_app $SLURM_ARRAY_TASK_ID some_arg another_arg
  my_app $SLURM_ARRAY_TASK_ID some_arg another_arg


Here is an example bash script that you can insert into your slurm batch script that uses the $SLURM_ARRAY_TASK_ID to select a different input file from the datafiles directory
Here is an example bash script that you can insert into your slurm batch script that uses the $SLURM_ARRAY_TASK_ID to select a different input file from the datafiles directory:
  FILES=($(ls -1 datafiles/*))
  FILES=($(ls -1 datafiles/*))
  input_file=${FILES[$SLURM_ARRAY_TASK_ID]}
  input_file=${FILES[$SLURM_ARRAY_TASK_ID]}
cc_staff
5

edits

Navigation menu