<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EstiloCorreo17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ES" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m running this script in a cluster composed by 11 nodes, each one with 1 processor with 4 cores and 1 thread per core:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">#!/bin/bash<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">#SBATCH --job-name=hellohybrid<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">#SBATCH --output=hellohybrid.out<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">#SBATCH --ntasks=4<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">#SBATCH --cpus-per-task=3<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">#SBATCH --partition=nodes<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"># Load the default OpenMPI module.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">source /soft/modules-3.2.10/Modules/3.2.10/init/bash<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">module load openmpi/3.0.0<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"># Set OMP_NUM_THREADS to the number of CPUs per task we asked for<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">export OMP_NUM_THREADS=$(($SLURM_CPUS_PER_TASK))<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"># Run the process with mpirun. Note that the -n option is not required<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"># in this case; mpirun will automatically determine how many processes<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"># to run from the Slurm settings.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">mpirun hybrid_hello<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"><o:p> </o:p></p>
<p class="MsoNormal">However, output is this:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 0 out of 3 from process 0 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 2 out of 3 from process 0 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 0 out of 3 from process 1 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 1 out of 3 from process 1 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 0 out of 3 from process 2 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 1 out of 3 from process 2 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 2 out of 3 from process 1 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 0 out of 3 from process 3 out of 4 on node2<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 2 out of 3 from process 3 out of 4 on node2<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 1 out of 3 from process 3 out of 4 on node2<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 1 out of 3 from process 0 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt">Hello from thread 2 out of 3 from process 2 out of 4 on node1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:70.8pt"><o:p> </o:p></p>
<p class="MsoNormal">As you could see, ode1 has run 9 threads, but my computer can only assign 8… can’t it? Or am I wrong????<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks.<o:p></o:p></p>
</div>
</body>
</html>