Niagara Quickstart: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 401: Line 401:
<!--T:91-->
<!--T:91-->
Submit this script with the command:
Submit this script with the command:
<source lang="bash">nia-login07:~$ sbatch mpi_ex.sh</source>
<source lang="bash">nia-login07:~$ sbatch mpi_job.sh</source>
 
<ul>
<ul>
<li><p>First line indicates that this is a bash script.</p></li>
<li>First line indicates that this is a bash script.</li>
<li><p>Lines starting with <code>#SBATCH</code> go to SLURM.</p></li>
<li>Lines starting with <code>#SBATCH</code> go to SLURM.</li>
<li><p>sbatch reads these lines as a job request (which it gives the name <code>mpi_ex</code>)</p></li>
<li>sbatch reads these lines as a job request (which it gives the name <code>mpi_job</code>)</li>
<li><p>In this case, SLURM looks for 8 nodes with 40 cores on which to run 320 tasks, for 1 hour.</p></li>
<li>In this case, SLURM looks for 2 nodes (each of which will have 40 cores) on which to run a total of 80 tasks, for 1 hour.<br>(Instead of specifying <tt>--ntasks=80</tt>, you can also ask for <tt>--ntasks-per-node=40</tt>, which amounts to the same.)</li>
<li><p>Once it found such a node, it runs the script:</p>
<li>Note that the mpifun flag "--ppn" (processors per node) is ignored.</li>
<li>Once it found such a node, it runs the script:
<ul>
<ul>
<li>Change to the submission directory;</li>
<li>Change to the submission directory;</li>
Line 413: Line 415:
<li>Runs the <code>mpi_example</code> application (SLURM will inform mpirun or srun on how many processes to run).
<li>Runs the <code>mpi_example</code> application (SLURM will inform mpirun or srun on how many processes to run).
</li>
</li>
<li>To use hyperthreading, just change --ntasks=80 to --ntasks=160, and add --bind-to none to the mpirun command (the latter is necessary for OpenMPI only, not when using IntelMPI).</li>
</ul>
</ul>
<li>To use hyperthreading, just change --ntasks=80 to --ntasks=160, and add --bind-to none to the mpirun command (the latter


== Example submission script (OpenMP) == <!--T:87-->
== Example submission script (OpenMP) == <!--T:87-->
cc_staff
290

edits

Navigation menu