Difference between revisions of "Using hyperthreading"

From ScientificComputing
Jump to: navigation, search
(Basic info about HT on Euler.)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''[https://en.wikipedia.org/wiki/Hyper-threading Hyperthreading] is being rolled out to all Euler nodes. It is already enabled on all [[Euler_III_Beta_Testing|Euler III]] nodes.''
+
Hyper-threading is Intel's proprietary simultaneous multithreading (SMT) implementation used to improve parallelization of computations (doing multiple tasks at once) performed on x86 microprocessors.
  
When hyperthreading is enabled, the Intel processors in the Euler cluster allow two processes or threads to run simultaneously on a single physical core. In most cases this brings no changes to your jobs. In some cases this allows you to increase the throughput of your program at the expense of longer execution time of each individual thread.
+
For each processor core that is physically present, the operating system addresses two virtual (logical) cores and shares the workload between them when possible. The main function of hyper-threading is to increase the number of independent instructions in the pipeline; it takes advantage of superscalar architecture, in which multiple instructions operate on separate data in parallel. With HTT, one physical core appears as two processors to the operating system, allowing concurrent scheduling of two processes per core.
  
We have not observed any drawback or performance regression by enabling hyperthreading.
+
<noinclude>==Hyperthreading on Euler==</noinclude><includeonly>===Hyperthreading on Euler===</includeonly>
  
== Relation to LSF job slots ==
+
The operating system will now see 48 '''logical cores''' on a 24-core node. The batch system will also see these logical cores, but will continue to use '''physical cores''' when allocating resources to batch jobs. A job requesting 1 (physical) core will thus get two logical cores and will be able to execute two threads simultaneously &mdash; if the application supports it.
  
LSF is aware of hyperthreading so '''there is no change to how jobs are assigned to physical cores'''. This means there continue to be 24&nbsp;job slots on the 24&nbsp;cores of an Euler I or&nbsp;II node. The slots, however, are assigned to both hyperthreads of a physical core.
+
<noinclude>==Relation to LSF job slots==</noinclude><includeonly>===Relation to LSF job slots===</includeonly>
 +
 
 +
LSF is aware of hyperthreading so '''there is no change to how jobs are assigned to physical cores'''. This means there continue to be 24&nbsp;job slots on the 24&nbsp;cores of an Euler I or&nbsp;II node. The slots, however, are assigned to both virtual cores of a physical core.
  
 
All of the supported MPI libraries we provide are also aware of hyperthreading and continue to schedule only one rank (MPI processes) to an individual physical core.
 
All of the supported MPI libraries we provide are also aware of hyperthreading and continue to schedule only one rank (MPI processes) to an individual physical core.
  
== Using hyperthreading ==
+
<noinclude>==Using hyperthreading==</noinclude><includeonly>===Using hyperthreading===</includeonly>
  
 
In those cases where you are running a loosely-coupled parallel program, you can make use of hyperthreading to let twice as many processes run as you have requested cores. While each individual processes will run slower, the time-to-solution will probably be faster than if they sequentially one after the other.
 
In those cases where you are running a loosely-coupled parallel program, you can make use of hyperthreading to let twice as many processes run as you have requested cores. While each individual processes will run slower, the time-to-solution will probably be faster than if they sequentially one after the other.
 +
 +
To '''ensure''' your job will run only on nodes with hyperthreading enabled, use the <tt>-R "select[nthreads==2]"</tt> bsub option:
 +
bsub -R "select[nthreads==2]" ...    # request nodes where HT is enabled (2 threads per core)
  
 
<!-- Example coming. -->
 
<!-- Example coming. -->

Latest revision as of 11:15, 21 June 2018

Hyper-threading is Intel's proprietary simultaneous multithreading (SMT) implementation used to improve parallelization of computations (doing multiple tasks at once) performed on x86 microprocessors.

For each processor core that is physically present, the operating system addresses two virtual (logical) cores and shares the workload between them when possible. The main function of hyper-threading is to increase the number of independent instructions in the pipeline; it takes advantage of superscalar architecture, in which multiple instructions operate on separate data in parallel. With HTT, one physical core appears as two processors to the operating system, allowing concurrent scheduling of two processes per core.

Hyperthreading on Euler

The operating system will now see 48 logical cores on a 24-core node. The batch system will also see these logical cores, but will continue to use physical cores when allocating resources to batch jobs. A job requesting 1 (physical) core will thus get two logical cores and will be able to execute two threads simultaneously — if the application supports it.

Relation to LSF job slots

LSF is aware of hyperthreading so there is no change to how jobs are assigned to physical cores. This means there continue to be 24 job slots on the 24 cores of an Euler I or II node. The slots, however, are assigned to both virtual cores of a physical core.

All of the supported MPI libraries we provide are also aware of hyperthreading and continue to schedule only one rank (MPI processes) to an individual physical core.

Using hyperthreading

In those cases where you are running a loosely-coupled parallel program, you can make use of hyperthreading to let twice as many processes run as you have requested cores. While each individual processes will run slower, the time-to-solution will probably be faster than if they sequentially one after the other.

To ensure your job will run only on nodes with hyperthreading enabled, use the -R "select[nthreads==2]" bsub option:

bsub -R "select[nthreads==2]" ...     # request nodes where HT is enabled (2 threads per core)