Array Jobs
It is possible to submit array jobs, that are useful for automating the running of parametric tasks. The command:
#SBATCH --array=1-300
specifies that 300 jobs are submitted to the queue, and each one has a unique identifier specified in the environment variable SLURM_ARRAY_TASK_ID (in this case ranging from 1 to 300). This is in addition to the SLURM_ARRAY_JOB_ID of the job.
So the JOB_ID of an array job will look like
${SLURM_ARRAY_JOB_ID}_${SLURM_ARRAY_TASK_ID}
in squeue,scontrol etc.
Here is an example script.
#!/bin/env bash
#SBATCH --job-name=sample_array
#SBATCH --time=10:00:00
#SBATCH --mem=4000
# make 300 different jobs from this one script!
#SBATCH --array=1-300
#SBATCH --output=job.out
module load modulefile
myExe.exe ${SLURM_ARRAY_TASK_ID} # equivalent to SGE's ${SGE_TASK_ID}
An example of a Matlab code using this is found in here