Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I disable HyperThreading to run parallel simulations?

My computer has a quadcore i7 processor. I'm studying parallelization of scientific simulations. How does hyperthreading impact on parallel performances? I know I should never use more than 4 working processes to get descent performances. But should I disable hyperthreading as well? Does it have an impact on parallel performances?

like image 733
Charles Brunet Avatar asked Mar 09 '12 15:03

Charles Brunet


2 Answers

In my experience, running electromagnetic modelling and inversion codes, the answer is yes, you should disable hyperthreading. But this is not the sort of question which is well answered by other people's anecdotes (not even mine, fascinating and true as they are).

You are the student, this is definitely a topic worth your time spent in coming to your own conclusions. There are so many factors involved that my experience running my codes on my platforms is nearly worthless to you.

like image 159
High Performance Mark Avatar answered Sep 21 '22 12:09

High Performance Mark


Under Linux, if you have 4 busy threads on an i7 it will place each one on a different core. Provided the other half of the core is idle, the performance should be the same. If you are running another program, it is debatable as to whether having hyperthreading to run the extra programs or context switching is better. (I suspect less context switching is better)

A common mistake is assuming that if you use 8 threads instead of 4 it will be twice as fast. It might be only slightly faster (in which case it might still be worth it) or slightly slower (in which case limit your program to 4 threads) I have found examples of where using double the number of threads was slightly faster. IMHO, Its all a matter of test it to find the optimal number and use that many.

The only time I can see you need to turning HT off is when you have no control over how your application behaves and using 4 threads is faster.

like image 20
Peter Lawrey Avatar answered Sep 20 '22 12:09

Peter Lawrey