I am trying to learn how to use heterogeneous jobs with Slurm. I've been reading this resource on their official website but I really don't understand how the setup should look like. I understand that heterogeneous jobs are started with this piece of code they've provided:
$ sbatch --cpus-per-task=4 --mem-per-cpu=16g --ntasks=1 : \
--cpus-per-task=2 --mem-per-cpu=1g --ntasks=8 my.bash
However, what I don't understand is how do I define what is the first task and what is the second task. For example, let's say that I have two R scripts in the same folder called script_1.R and script_2.R I want to submit them to some cluster via Slurm as a heterogeneous job, and I want to request 16 GB for the first one and 1 GB for the second one. Where is the part of the script in sbatch where I provide the path to the files for each task? Or is it done somewhere outside of the sbatch? How does this work? Any help would be appreciated, thanks!