<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>That was just I thought, ntasks for mpi and cpus-per-task for multithreading.<br></div>So, for example, if every node has 24 cores, is there any difference between these commands?<br><br></div>sbatch --ntasks 24 [...]<br></div>sbatch --ntasks 1 --cpus-per-task 24 [...]<br><br></div>regards.<br></div><br><div class="gmail_quote"><div dir="ltr">El jue., 22 feb. 2018 a las 9:52, Loris Bennett (<<a href="mailto:loris.bennett@fu-berlin.de">loris.bennett@fu-berlin.de</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chris,<br>
<br>
Christopher Samuel <<a href="mailto:chris@csamuel.org" target="_blank">chris@csamuel.org</a>> writes:<br>
<br>
> On 22/02/18 18:49, Miguel Gutiérrez Páez wrote:<br>
><br>
>> What's the real meaning of ntasks? Has cpus-per-task and ntasks the<br>
>> same meaning in sbatch and srun?<br>
><br>
> --ntasks is for parallel distributed jobs, where you can run lots of<br>
> independent processes that collaborate using some form of communication<br>
> between the processes (usually MPI for HPC).<br>
><br>
> So inside your batch script you would use "srun" to start up the tasks.<br>
><br>
> However, unless you code is written to make use of that interface then<br>
> it's not really going to help you, and so for any multithreaded<br>
> application you need to use --cpus-per-task instead.<br>
<br>
[snip (11 lines)]<br>
<br>
But does it make any difference for a multithreaded program if I have<br>
<br>
  #SBATCH --ntasks=4<br>
  #SBATCH --nodes=1-1<br>
<br>
rather than<br>
<br>
  #SBATCH --ntasks=1<br>
  #SBATCH --cpus-per-task=4<br>
<br>
Up to now I have only thought of --cpus-per-task in connection with<br>
hybrid MPI/OpenMP jobs, which we don't actually have.  Thus I tend to<br>
tell users to think always in terms of tasks, regardless of whether<br>
these are MPI processes or just threads.<br>
<br>
One downside of my approach is that if the user forgets to specify<br>
--nodes and --ntasks is greater than 1, non-MPI jobs can be assigned to<br>
multiple nodes.<br>
<br>
Cheers,<br>
<br>
Loris<br>
<br>
--<br>
Dr. Loris Bennett (Mr.)<br>
ZEDAT, Freie Universität Berlin         Email <a href="mailto:loris.bennett@fu-berlin.de" target="_blank">loris.bennett@fu-berlin.de</a><br>
<br>
</blockquote></div>