CFD Online URL
[Sponsors]
Home > Forums > FLUENT

Running Fluent by Hyper-threading

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 12, 2014, 06:28
Question Running Fluent by Hyper-threading
  #1
Senior Member
 
Anna Tian's Avatar
 
Meimei Tian
Join Date: Jul 2012
Posts: 461
Rep Power: 6
Anna Tian is on a distinguished road
Hi,

My desktop has single CPU of 4 cores. Since it uses hyper-threading technology, the task manager shows 8 cores. When I start 8 Fluent one 'core' simulations at the same time, then every Fluent simulation get one 'core' (can be 'real' or 'fictious'). Then almost all the simulations become quite slow. I think that's because the corresponding real core and fictious core of each pair are used to run different simulation.

I'm wondering how to distribute the best combination of real cores and fictious cores to a Fluent simulation. For example, still with my desktop, supposing I need to run 4 Fluent simulations and each of them require 2 cores. How to make sure each of the 4 Fluent simulations get the right corresponding 2 cores (real and fictious cores)? Will Fluent select the right combinations to maximize its efficiency automatically?
__________________
Best regards,
Meimei
Anna Tian is offline   Reply With Quote

Old   August 13, 2014, 18:02
Default
  #2
Senior Member
 
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 525
Rep Power: 10
LuckyTran is on a distinguished road
I disable hyperthreading on all machines to avoid having this issue. That way, jobs are assigned only to physical cores. Usually with CFD there are rarely unused cpu cycles anyway and hyperthreading only slows performance.

Because of the way SMP is implemented, the distributing of tasks is up to the system job scheduler and there is nothing the user can do, sometimes the job scheduler can do nothing.

Take for example, the windows job scheduler. As far as I know, since Win7 the job scheduler is intelligent enough to prioritize physical cores before virtual cores. Before Win7 the tasks were randomly assigned and there was a possibility of a job landing landing on a physical virtual core pair and left other physical cores unloaded and idle.

I'm not sure how well linux job schedulers are in this aspect, but I think either way there's nothing users can do.
LuckyTran is online now   Reply With Quote

Old   August 13, 2014, 23:36
Question
  #3
Senior Member
 
Anna Tian's Avatar
 
Meimei Tian
Join Date: Jul 2012
Posts: 461
Rep Power: 6
Anna Tian is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
I disable hyperthreading on all machines to avoid having this issue. That way, jobs are assigned only to physical cores. Usually with CFD there are rarely unused cpu cycles anyway and hyperthreading only slows performance.

Because of the way SMP is implemented, the distributing of tasks is up to the system job scheduler and there is nothing the user can do, sometimes the job scheduler can do nothing.

Take for example, the windows job scheduler. As far as I know, since Win7 the job scheduler is intelligent enough to prioritize physical cores before virtual cores. Before Win7 the tasks were randomly assigned and there was a possibility of a job landing landing on a physical virtual core pair and left other physical cores unloaded and idle.

I'm not sure how well linux job schedulers are in this aspect, but I think either way there's nothing users can do.

Does that mean Iíd better also disable my hyper-threading even Iím using win7 system?

Thatís quite strange. I remember that there was a IBM&Fluent paper telling that hyper threading could improve the Fluent calculation speed by 5% to 8%. It seems Fluent is somehow encouraging the usage of hyper-threading if the license is not the limit.

Btw, I have another workstation, which is also running with win7 system, has 4 Intel Xeon CPU and each CPU has 8 real cores (supposing I turn off all the fictitious cores and the 8 cores per CPU left are all the real cores). Iím wondering if I start an 8 cores Fluent simulation, will the 8 cores all from the same CPU? Using the cores from the same CPU can save the data transfer time between different CPUs in the motherboard. What I run two 4 cores Fluent jobs? How will the cores being used be distributed? Does Fluent or win7 has the intelligence to run simulation by using cores from the same CPU as much as possible?
__________________
Best regards,
Meimei
Anna Tian is offline   Reply With Quote

Old   August 14, 2014, 06:01
Default
  #4
Senior Member
 
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 525
Rep Power: 10
LuckyTran is on a distinguished road
Quote:
Originally Posted by Anna Tian View Post
Does that mean Iíd better also disable my hyper-threading even Iím using win7 system?
Hyperthreading works if the CPU has available idle time and there are no other bottlenecks in the system. Given the size & scale of the jobs you're doing, I highly doubt that there is any idle time.

I still disable HT even on Win7 just to save the headaches. If any of the physical cores are sufficiently loaded when the job is scheduled (browsing a website that's playing an HD video, etc), then it's easy to get threads assigned to physical-virtual sibling cores and then you are stuck until the job is done because the threads cannot be rescheduled. Or you can get into the habit of unloading all the cores before you start Fluent (shut down all programs, etc).

Quote:
Originally Posted by Anna Tian View Post
Btw, I have another workstation, which is also running with win7 system, has 4 Intel Xeon CPU and each CPU has 8 real cores (supposing I turn off all the fictitious cores and the 8 cores per CPU left are all the real cores). Iím wondering if I start an 8 cores Fluent simulation, will the 8 cores all from the same CPU? Using the cores from the same CPU can save the data transfer time between different CPUs in the motherboard. What I run two 4 cores Fluent jobs? How will the cores being used be distributed? Does Fluent or win7 has the intelligence to run simulation by using cores from the same CPU as much as possible?
That is an interesting point. In the windows desktop environment I don't think there is a way to force it to run on the same CPU socket because the scheduler "intelligently" uses the best available cores (best = the cores currently doing the least work). In the windows server HPC environment which is used for clusters, it is possible by specifying the resources as a socket-level task so that all cores used will be on the same socket.
LuckyTran is online now   Reply With Quote

Old   August 15, 2014, 00:36
Default
  #5
Member
 
M. Nabi
Join Date: Jun 2009
Posts: 41
Rep Power: 7
mnabi is on a distinguished road
To force it to run on a specific core(s), open Task manager, go to Processes, right click and then choose "Set Affinity". There you can choose which cores you want to associate for that specific run.

From my experience, for the parallel computing (OpenMP), the multithread doesn't function with high efficiency. But as long as you have a single job, you can assign it to a specific core (real or virtual) and it works like a real core. Don't forget to don't put maximum 7 runs on 8 cores, otherwise the some runs get slow randomly.
mnabi is offline   Reply With Quote

Old   August 15, 2014, 01:29
Default
  #6
Senior Member
 
Lucky Tran
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 525
Rep Power: 10
LuckyTran is on a distinguished road
Quote:
Originally Posted by mnabi View Post
To force it to run on a specific core(s), open Task manager, go to Processes, right click and then choose "Set Affinity". There you can choose which cores you want to associate for that specific run.
That's pretty helpful. You would have to set the affinity each time or setup a specific start-up script to take advantage of the process affinity.

But how would you determine which CPUs are physical or virtual, or which CPUs belong to which socket? As far as I know, the task manager does not have this capability and you must use some form of CPUID to detect if a cpu is physical or virtual and/or which socket.
LuckyTran is online now   Reply With Quote

Old   August 16, 2014, 06:21
Question
  #7
Senior Member
 
Anna Tian's Avatar
 
Meimei Tian
Join Date: Jul 2012
Posts: 461
Rep Power: 6
Anna Tian is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
That's pretty helpful. You would have to set the affinity each time or setup a specific start-up script to take advantage of the process affinity.

But how would you determine which CPUs are physical or virtual, or which CPUs belong to which socket? As far as I know, the task manager does not have this capability and you must use some form of CPUID to detect if a cpu is physical or virtual and/or which socket.
In this way, people shall turn off hyperthreading for most of the cases if they use multi cores to run more than one simulations.
__________________
Best regards,
Meimei
Anna Tian is offline   Reply With Quote

Old   August 16, 2014, 19:21
Default
  #8
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 759
Rep Power: 14
ghost82 will become famous soon enough
I also recommend to turn off hyperthreading.
Hyperthreading must be disabled from bios.

I also read an Ansys document about increasing performances with ht, but my tests (on my cases) and many other users experiences show a not negligible increase in performances with ht off.
ghost82 is offline   Reply With Quote

Old   August 16, 2014, 23:24
Question
  #9
Senior Member
 
Anna Tian's Avatar
 
Meimei Tian
Join Date: Jul 2012
Posts: 461
Rep Power: 6
Anna Tian is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
I also recommend to turn off hyperthreading.
Hyperthreading must be disabled from bios.

I also read an Ansys document about increasing performances with ht, but my tests (on my cases) and many other users experiences show a not negligible increase in performances with ht off.

If the system will always go for the most idle CPU to ask for more cores, could I do the following to avoid turning off hyper threading?

For my case, I have 32 real cores and 32 fictitious cores. What if I always use at most 32 cores to run the Fluent simulations? Then the system will only give the work to the 32 real cores, right? I will never let the simulation use more than 32 cores, then it will usually work at the maximum speed it can, right?
__________________
Best regards,
Meimei
Anna Tian is offline   Reply With Quote

Old   August 17, 2014, 04:31
Default
  #10
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 759
Rep Power: 14
ghost82 will become famous soon enough
Yes, I think so, I would turn off ht in each node.
This was my little test:

42% gain from X5650 to E5-2643V2

As you can see if you set ht on but you set the number of threads equal to that of the physical cores you will end to a decrease in performances.
Best was to turn ht off from bios and set the number of threads to that of the physical cores.
The test was performed with a mesh of about 400000 cells, but similar results can be achieved with bigger meshes.

By monitoring the percentage of usage of the cores with ht turned on I could see that cpu0 worked near 90% (other cores at 99-100%).
With ht off all cores worked at 99-100%.
ghost82 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The monitor is flashing when running ANSYS FLUENT nvtrieu ANSYS 0 May 3, 2013 04:02
Fluent can't run in parallel when hyper threading turning on. field FLUENT 0 May 5, 2011 08:41
running multiple Fluent parallel jobs Michael Bo Hansen FLUENT 8 June 7, 2006 09:52
PVM running of FLUENT Joe Yan FLUENT 0 February 27, 2006 04:48
FLUENT 5.2.3 running on PIII 733 Burley Wang FLUENT 7 April 19, 2000 07:03


All times are GMT -4. The time now is 14:01.