Convekta Logo
Chess Software Sourcebook
Join Chess Reviews<>
Convekta Logo
[Image]
 
Hyperthreading and processors
keywords: Athlon, P4, Pentium, Multiprocessor, Hyperthreading, Performance, Shredder
Robert Pawlak
Wednesday, October 08, 2003

Hyperthreading provides an important performance boost for users of chess applications. While it will not increase the performance of chess engines, it will improve the responsiveness of the chess software you use, especially if it is multithreaded.

Note also that most programs cannot tell the difference between a hyperthreaded and a dual CPU system. Thus some default settings which are appropriate for true dual CPU systems are not appropriate for single CPU systems.

Lest you accuse Bob of being an Intel bigot, he has to admit to being a big AMD fan. He was an Athlon devotee until hyperthreading arrived.

Introduction

A perennial question on many chess discussion boards and mailing lists is "Which processor should I purchase for chess?" The answer used to be pretty straightforward - get an Athlon processor. In general, for equivalent clock and PR ratings, the Athlon outperforms the P4 (Pentium 4) in integer operations. And integer operations are what matters for chess engines.

However, there is another factor that needs to be considered when buying a new computer. First off, the differences in integer performance of 10-20% are really not that significant. It might make a difference of a handful of ELO points at best. Furthermore, I think that usability and responsiveness are more important issues than absolute performance or nodes per second. And thus, because of a technique called hyperthreading (HT), that is employed in some P4 and Xeon processors, the P4 has an edge.

Simply put, the P4 processor with HT can do more than one thing at a time. For an illustration of what this means for something like a powerpoint presentation, you can see this video and article and Tom's Hardware Guide (THG). If you read the appropriate article at THG, you'll also see that HT is most beneficial to multithreaded applications.

Furthermore, just about any chess database or chess playing program is multithreaded. Typically, one thread or thread(s) is dedicated to the user interface, and another to the chess engine. In CA, things like searches, entering annotations, and the like run under one thread while engines run under another. Thus, HT gives you something like two virtual processors, to run CA. Of course, this is a bit of a simplification, since the operating system, antivirus software, etc are also employing threads as well.

Lest you think HT is a free ride, you also need to realize that while two virtual processors are created, they have to share instruction units in the Central Processing Unit (CPU). This means that you don't get twice the performance from HT. And in fact, this contention for resources can actually slow some engines down, if they use multiple threads.

Practical Considerations

One interesting fact is that the Shredder engine is multithreaded. This is because it is meant to be run in a multiprocessing environment, where there are truly two physical processors. For the reasons outlined in the previous paragraph, having two threads is not the same as having two processors, since there is much higher contention for resources within the CPU. So you'll get the best system responsiveness from having Shredder use a single thread. Let's look at how to configure this within Chess Assistant.

I will assume that you've got the Shredder engine installed. To access the threads setting for Shredder, you'll need to go into the options dialog (the "Engines setup" selection in the "Tools" menu"). From there, highlight the Shredder engine, and then click the "Personalities" button. If this button is dimmed, you'll first have to load Shredder into memory, and then the button will work. You can do this by clicking on the "Load" button.

After you do that, you should see the following dialog box. On the right hand side of the dialog box, you should see a setting called "Threads". By default, at least on my system, this was set to two. For reasons outlined previously in this article, for best responsiveness, you'd like this set to one. To do that, click on the extreme left side of the slider bar.

If you do in fact have two processors (and hence have a dual Athlon or Xeon system), you can leave this set at two, and this will certainly result in the highest quality analysis. But you will still get better responsiveness from CA by leaving it at one. If you have a four processor machine, then you can leave this set at two, since you've got plenty of extra CPU capacity available.

CA has one other setting that is of interest to users of P4 and multiprocessor systems. It turns out that the BGA (BackGround Analysis) manager can use more than one processor as well. For best system responsiveness, you should make sure that the BGA manager uses only one client. This is because in the background analysis modes, each client can run one engine. If you start two clients, you'll be running two engines, and hence two threads (and CA won't get the spare thread like it normally would). To change this setting, go to the "Engines" menu, and select "Background analysis properties". You should see the dialog box below. Make sure that none of the SMP (symmetric multiprocessing) options are checked.

Conclusion

It should be clear from the above discussion that HT is not a panacea, and is not as good as having two physical processors. However, it can provide a better computing experience by decreasing the latency within the operating system. In conditions where one engine is running while CA is being used, HT allows CA to respond to user inputs very quickly. Perhaps surprisingly, the key to getting that responsiveness with a HT processor is to set up your engines to use a single thread.

Addendum

This article was written before the AMD 64-bit processors were released. These processors have very good integer performance, but do not have anything like hyperthreading (of course, Opterons can be used in a two processor configuration).

 

 







ChessAssistant is a trademark of ChessOK
Syndication available through rss.xml
Click on my name to send me e-mail (must have javascript on)