Difference between revisions of "Processors Command"

From OSUPDOCS
Jump to navigation Jump to search
Line 13: Line 13:
=== Hyperthreading ===
=== Hyperthreading ===


Most computers with multi-core process also enable hyperthreading, which allows the machine to appear as if it has twice as many cores as the physical number of cores. Not surprisingly, if you are doing scientific calculations that actually seek to use CPU cores full times, the additional of virtual cores is no benefit. For example, if you have an 8-core processor and plot calculation time vs. number of cores used, the performance will peak for 8 processors. Calculations times will not decrease for more the 8 processors and may even slightly decrease. Furthermore, residual overhead of hyperthread will slightly degrade 8 processor performance.
Most computers with multi-core processors also enable hyperthreading, which allows the machine to appear as if it has twice as many cores as the physical number of cores. Not surprisingly, if you are doing scientific calculations that are actually using the CPU full time, the additional of virtual cores is no benefit. For example, if you have an 8-core chip and plot calculation time vs. number of processors used, the performance will peak for 8 processors. Calculations times will not improve for more the 8 processors and may even get slightly slower. Furthermore, overhead needed to enable hyperthreading will slightly degrade calculation speed even when only using the 8 physical cores.


The maximum performance is normally to disable hyperthreading and to run with processors set to the physcial number of cores. Hyperthreading can be disabled as follows:
The maximum performance is normally to disable hyperthreading and to run with processors set to the physical number of cores. Hyperthreading can be disabled as follows:


* MacOS
* MacOS
*# Install XCode
*# Install XCode
*# Run XCode and choose Intruments from the XCode→Other Development Tool subment
*# Run XCode and choose Instruments from the XCode→Other Development Tool submenu.
*# Choose Preferences... menu command
*# Choose Preferences... menu command.
*# Click on CPUs and uncheck "Hardware Multithreading"
*# Click on CPUs and uncheck "Hardware Multithreading."
*# According to Apple, this setting has to be repeat each time you restart or each time your computer goes to sleep.
*# According to Apple, this setting has to be repeated each time you restart or each time your computer goes to sleep.
* Windows
* Windows
*# Restart you computer and hold down the Esc key until menu or option to get a menu appears
*# Restart you computer and hold down the Esc key until menu or option to get a menu appears.
*# The menu allows you to configure the BIOS. Look for hyperthreading control under "Performance"
*# The menu allows you to configure the BIOS. Look for hyperthreading control under "Performance."
*# Set hyperthreading control to "Disabled"
*# Set hyperthreading control to "Disabled."
*# Save and exit the BIOS configuration
*# Save and exit the BIOS configuration.
*# This change will permanently disable hyperthreading, but you can also get it back by the above process but choosing "Enabled."  
*# This change will permanently disable hyperthreading, but you can also get it back by repeating above process and choosing "Enabled."  


You can test your setting by running a calculations with processors option set to a number higher than the physical number of cores. If you request more processores than available, your setting will be changed to the maximum number of available processors. Look near the beginning of any output .mpm or .fea file to see the number of processors used by the calculations.
You can test your setting by running a calculation with processors option set to a number higher than the physical number of cores. If you request more processors than available, your setting will be changed to the maximum number of available processors. Look near the beginning of any output <tt>.mpm</tt> or <tt>.fea</tt> file to verify number of processors used by the calculations and available on your computer.


== Notes ==
== Notes ==

Revision as of 15:37, 10 June 2021

The Processors command selects the number of processors to use when running parallel versions of NairnMPM, and NairnFEA. The format is

Processors (number)

where number is the number of processors.

To select number of processors when using XML input files, enter the following comment anywhere in the file:

<!--processors #-->

where # is replaced by the number of processors. But note that this XML comment option only works when launching calculations in NairnFEAMPM or NairnFEAMPMViz. When using a command line to launch calculations, pick the number of processors with each code engine's -np option instead.

Hyperthreading

Most computers with multi-core processors also enable hyperthreading, which allows the machine to appear as if it has twice as many cores as the physical number of cores. Not surprisingly, if you are doing scientific calculations that are actually using the CPU full time, the additional of virtual cores is no benefit. For example, if you have an 8-core chip and plot calculation time vs. number of processors used, the performance will peak for 8 processors. Calculations times will not improve for more the 8 processors and may even get slightly slower. Furthermore, overhead needed to enable hyperthreading will slightly degrade calculation speed even when only using the 8 physical cores.

The maximum performance is normally to disable hyperthreading and to run with processors set to the physical number of cores. Hyperthreading can be disabled as follows:

  • MacOS
    1. Install XCode
    2. Run XCode and choose Instruments from the XCode→Other Development Tool submenu.
    3. Choose Preferences... menu command.
    4. Click on CPUs and uncheck "Hardware Multithreading."
    5. According to Apple, this setting has to be repeated each time you restart or each time your computer goes to sleep.
  • Windows
    1. Restart you computer and hold down the Esc key until menu or option to get a menu appears.
    2. The menu allows you to configure the BIOS. Look for hyperthreading control under "Performance."
    3. Set hyperthreading control to "Disabled."
    4. Save and exit the BIOS configuration.
    5. This change will permanently disable hyperthreading, but you can also get it back by repeating above process and choosing "Enabled."

You can test your setting by running a calculation with processors option set to a number higher than the physical number of cores. If you request more processors than available, your setting will be changed to the maximum number of available processors. Look near the beginning of any output .mpm or .fea file to verify number of processors used by the calculations and available on your computer.

Notes

  • Setting number of processors greater than 1 implies you are running parallel versions of code engines. If not, an error will result and no calculations will run.
  • If the requested number is greater than the available number of processors, it will be reduced to the available number of processors.