Many thanks Jason! On Fri, Mar 13, 2015 at 6:01 PM, Jason Bacon <[email protected]> wrote:
> > > I'll do it. > > I had the same concern recently and now that Moe told us exactly which > file to update, it shouldn't take much effort. > > Jason > > On 03/13/15 11:18, Jean-Christophe Domenge wrote: > >> Re: [slurm-dev] Re: Array job: get number of array tasks in batch script >> Thanks for the tip. >> Unfortunately patching src/sbatch/opt.c seems beyond my reach to be frank. >> Is there a way I can submit a feature request? >> >> On Fri, Mar 13, 2015 at 4:48 PM, Moe Jette <[email protected] <mailto: >> [email protected]>> wrote: >> >> >> That information is not current available, but it should be easy >> to add with a few lines of code in src/sbatch/opt.c. If you do >> this, please forward the patch so it can be added to the Slurm >> code base. >> >> >> Quoting Jean-Christophe Domenge <[email protected] >> <mailto:[email protected]>>: >> >> When I submit an array job using *sbatch --array:1-N >> myscript.sh *the task >> id is passed at runtime to *myscript.sh* via the environment >> variable >> SLURM_ARRAY_TASK_ID. >> But how can I access *N* (the number of tasks in the array job) in >> *myscript.sh*? >> >> This is especially useful when splitting a list into *N* >> slices with each >> task in the array job handling a different slice. >> >> Thanks for your help, >> >> jc >> >> >> >> -- Morris "Moe" Jette >> CTO, SchedMD LLC >> Commercial Slurm Development and Support >> >> >>
