See $SLURM_ARRAY_TASK_ID as described here:
http://slurm.schedmd.com/job_array.html

Quoting Guillaume Landry <[email protected]>:


 Dear slurm-dev,

I am using the following script for slurm (part of another script with
arguments $1 executable, $2 input file, $3 macro file and $4 number of
jobs to be ran with different seeds between 0 and $4:

cat <<EOL|sbatch
#!/bin/bash
#SBATCH --job-name='$1'_'$2'_'$3'
#SBATCH --workdir='$PWD'
#SBATCH --export=ALL
#SBATCH --array=0-'$4'
#SBATCH --output='$PWD'/logs/'$1'_'$2'_log/'$1'_'$2'_%a_%j_%N.log
#SBATCH --error='$PWD'/err/'$1'_'$2'_log/'$1'_'$2'_%a_%j_%N.err
#SBATCH --mem-per-cpu='$memory2'

"""#SBATCH --nodelist=gar-cl-mednd06"""
"""#SBATCH --mail-type=ALL"""

cd $PWD

 $1 $2 $3 $IDOFTHEJOB



EOL


My issue is that I need $IDOFTHEJOB to be equivalent to the %a used in
error and output (for example here varying between 0 and $4). i tried
using %a but it seems that it is not intepreted correctly for the
command (it works fine for output and error).

Regards,
Guillaume


--
Guillaume Landry
Ludwig-Maximilians-Universität München (LMU)
Medical Physics Chair (LS Parodi)
Am Coulombwall 1
85748 Garching
Tel:+49 (0) 89 289-14077
Fax:+49 (0) 89 289-14072





Reply via email to