|
[Sponsors] |
July 11, 2023, 11:48 |
About hyperthreading in CFD
|
#1 |
Member
Song Young Ik
Join Date: Apr 2022
Location: South Korea
Posts: 57
Rep Power: 4 |
I heard that hyperthreading doesn't help in CFD, including openfoam
So, for example lets say that I have 8 core 16 thread cpu. Then If I use MPI and set core to n=8, does it show almost same effect with n=16? Or former one use 4 core with HT and latter use 8 core with HT so make difference? In hardware info thread, it explains about core, and in graph they show x axis as thread but actually used # of core, so I am very confused now... |
|
July 11, 2023, 12:43 |
|
#2 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46 |
X-axis in my graphs is usually threads. Which is supposed to mean software threads.
It is further implied that each software thread runs on its own physical core exclusively. Simultaneous multi-threading (SMT) or Hyperthreading does not add many compute resources to a physical core. It's mostly a few additional registers, to have two or more threads running on the same physical core, at the same time. Without going into an unnecessary amount of detail: SMT generally doesn't help with CFD. It can improve calculation speed a bit, with low core count CPUs. I.e. in situations where the memory subsystem is not a limiting factor. But when given the choice between a 4-core CPU with SMT2, and a similar CPU with 8 physical cores, the latter will always be faster. Not just for CFD. |
|
July 12, 2023, 05:51 |
|
#3 | |
Member
Song Young Ik
Join Date: Apr 2022
Location: South Korea
Posts: 57
Rep Power: 4 |
Quote:
I have one question related to this. I saw many people suggest to turn off hyperthreading form BIOS. But when we use program such as openfoam with MPI, MPI doesn't use hyperthreaded cores, but only one slot per physical core. Does it make difference too? |
||
July 12, 2023, 06:23 |
|
#4 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46 |
With everything installed correctly, all software and hardware versions being compatible to each other, and running your software the "right" way, disabling SMT should not be necessary these days.
Caveat here is "should". Turning it off is just one thing less to worry about, when you have a dedicated CFD/FEA machine. |
|
July 15, 2023, 16:09 |
|
#5 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 65 |
MPI does not know which core is physical and which is virtual. MPI cannot tell threads to only use physical cores. The job scheduler decides which cores (physical or hyperthreaded) to use. And more importantly, you must know the correct number of threads to tell the mpi to launch.
Hyperthreading can be on or off but you need to understand the differences for each case as a user. For example, with hyperthreading on, you should only launch 1-8, or 16 mpithreads and never 9-15. With hyperthreading off, you should only launch 1-8 threads and never 9-16 (or over 9000). Using the wrong number will make the case run slower with HT or without HT. Hyperthreading is recommended to be off because it simplifies things and makes everything idiot proof. It doesn't help anyway and it is much easier to explain to someone, always use 8 threads. There is simply less to explain. |
|
July 16, 2023, 15:54 |
|
#6 | |
Senior Member
Will Kernkamp
Join Date: Jun 2014
Posts: 316
Rep Power: 12 |
Quote:
|
||
July 20, 2023, 16:51 |
|
#7 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 65 |
You are mixing up an mpi which is just a protocol and a job scheduler. And yes of course every job scheduler (as I clearly said) desires to spread out jobs. But consider that you are a typical office analyst with 100 browser tabs open, youtube videos playing, spotify sreaming music to your headset, CREO open trying to rebuild a model, your manager is telling you to finish your timesheet, and now you go launch your CFD,and more and more. How does the job scheduler know you want to spread your job out across only physical cores when your machine is already 100% loaded? The answer is the infamous "Warning: processor affinity not set"
|
|
July 23, 2023, 20:07 |
|
#8 |
Senior Member
Will Kernkamp
Join Date: Jun 2014
Posts: 316
Rep Power: 12 |
If that is your problem then you can tell mpi exactly where you want your threads to run.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cfd to ansys thermal to ansys structural interface | ssixr | ANSYS | 17 | July 31, 2015 15:18 |
STAR-Works : Mainstream CAD with CFD | CD adapco Group Marketing | Siemens | 0 | February 13, 2002 12:23 |
Where do we go from here? CFD in 2001 | John C. Chien | Main CFD Forum | 36 | January 24, 2001 21:10 |
ASME CFD Symposium, Atlanta, July 2001 | Chris R. Kleijn | Main CFD Forum | 0 | August 21, 2000 04:49 |
Which is better to develop in-house CFD code or to buy a available CFD package. | Tareq Al-shaalan | Main CFD Forum | 10 | June 12, 1999 23:27 |