<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Thank you very much. I got it.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br clear="all"></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font face="tahoma,sans-serif">Regards,<br>Mahmood</font><br><br><br></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jun 8, 2019 at 10:20 PM Riebs, Andy <<a href="mailto:andy.riebs@hpe.com">andy.riebs@hpe.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="white" lang="EN-GB">
<div class="gmail-m_6107793048319278328WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">A quick & easy way to see what your options might be for Slurm environment variables is to try a job like this:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">$ srun --nodes 2 --ntasks-per-node 6 --pty env | grep SLURM<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">Or, perhaps, use the “env | grep SLURM” in your batch script.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)">Andy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<div>
<div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">From:</span></b><span style="font-size:11pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US"> slurm-users [mailto:<a href="mailto:slurm-users-bounces@lists.schedmd.com" target="_blank">slurm-users-bounces@lists.schedmd.com</a>]
<b>On Behalf Of </b>Brian Andrus<br>
<b>Sent:</b> Saturday, June 8, 2019 1:29 PM<br>
<b>To:</b> <a href="mailto:slurm-users@lists.schedmd.com" target="_blank">slurm-users@lists.schedmd.com</a><br>
<b>Subject:</b> Re: [slurm-users] Counting total number of cores specified in the sbatch file<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p>If you are using mpi, it should be aware automatically if everything was compiled with support (eg mpirun).<u></u><u></u></p>
<p>If you are looking to just get the total tasks, $SLURM_NTASKS is probably what you are looking for<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>Brian Andrus<u></u><u></u></p>
<p><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 6/8/2019 2:46 AM, Mahmood Naderan wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif">Hi,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif">A genetic program uses -num_threads in command line for parallel run. I use the following directives in slurm batch file<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif">#SBATCH --ntasks-per-node=6<br>
#SBATCH --nodes=2<br>
#SBATCH --mem-per-cpu=2G<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif">for 12 processes and 24GB of memory. Is there any slurm variable that counts all threads from the directives? So, I can use<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif">-num_threads $SLURM_COUNT<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif">where SLURM_COUNT is 12. Any idea?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma",sans-serif"><u></u> <u></u></span></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-family:"Tahoma",sans-serif">Regards,<br>
Mahmood</span><br>
<br>
<u></u><u></u></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote></div>