<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>If you are using mpi, it should be aware automatically if
      everything was compiled with support (eg mpirun).</p>
    <p>If you are looking to just get the total tasks, $SLURM_NTASKS is
      probably what you are looking for</p>
    <p><br>
    </p>
    <p>Brian Andrus<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 6/8/2019 2:46 AM, Mahmood Naderan
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CADa2P2VZgHVyJKPM5CHmBB9ZjU-9PtnMjk_RpT-RqhR9_1ALxA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_default" style="font-family:tahoma,sans-serif">Hi,</div>
        <div class="gmail_default" 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</div>
        <div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
        </div>
        <div class="gmail_default" style="font-family:tahoma,sans-serif">#SBATCH
          --ntasks-per-node=6<br>
          #SBATCH --nodes=2<br>
          #SBATCH --mem-per-cpu=2G</div>
        <div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
        </div>
        <div class="gmail_default" 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</div>
        <div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
        </div>
        <div class="gmail_default" style="font-family:tahoma,sans-serif">-num_threads
          $SLURM_COUNT</div>
        <div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
        </div>
        <div class="gmail_default" style="font-family:tahoma,sans-serif">where
          SLURM_COUNT is 12. Any idea?</div>
        <div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
        </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>
      </div>
    </blockquote>
  </body>
</html>