Job arrays: Difference between revisions

no edit summary
No edit summary
Line 21: Line 21:


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=(datadir/*)
  input_file=${FILES[$SLURM_ARRAY_TASK_ID]}
  input_file="${FILES[$SLURM_ARRAY_TASK_ID]}"
  my_app $input_file
  my_app $input_file


cc_staff
5

edits