[slurm-users] Counting total number of cores specified in the sbatch file

Mahmood Naderan mahmood.nt at gmail.com
Sun Jun 9 06:27:41 UTC 2019


Thank you very much. I got it.

Regards,
Mahmood




On Sat, Jun 8, 2019 at 10:20 PM Riebs, Andy <andy.riebs at hpe.com> wrote:

> A quick & easy way to see what your options might be for Slurm environment
> variables is to try a job like this:
>
>
>
> $ srun --nodes 2 --ntasks-per-node 6 --pty env | grep SLURM
>
>
>
> Or, perhaps, use the “env | grep SLURM” in your batch script.
>
>
>
> Andy
>
>
>
> *From:* slurm-users [mailto:slurm-users-bounces at lists.schedmd.com] *On
> Behalf Of *Brian Andrus
> *Sent:* Saturday, June 8, 2019 1:29 PM
> *To:* slurm-users at lists.schedmd.com
> *Subject:* Re: [slurm-users] Counting total number of cores specified in
> the sbatch file
>
>
>
> If you are using mpi, it should be aware automatically if everything was
> compiled with support (eg mpirun).
>
> If you are looking to just get the total tasks, $SLURM_NTASKS is probably
> what you are looking for
>
>
>
> Brian Andrus
>
>
>
> On 6/8/2019 2:46 AM, Mahmood Naderan wrote:
>
> Hi,
>
> A genetic program uses -num_threads in command line for parallel run. I
> use the following directives in slurm batch file
>
>
>
> #SBATCH --ntasks-per-node=6
> #SBATCH --nodes=2
> #SBATCH --mem-per-cpu=2G
>
>
>
> for 12 processes and 24GB of memory. Is there any slurm variable that
> counts all threads from the directives? So, I can use
>
>
>
> -num_threads $SLURM_COUNT
>
>
>
> where SLURM_COUNT is 12. Any idea?
>
>
>
> Regards,
> Mahmood
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20190609/3c420aeb/attachment-0001.html>


More information about the slurm-users mailing list