Toga 3.12SE MP with sources.

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

ernest
Posts: 2053
Joined: Wed Mar 08, 2006 8:30 pm

Re: Toga 3.12SE MP with sources.

Post by ernest »

Eelco de Groot wrote:I think you would have to do a recompile to change it, there is a line
const int NumberThreads = 2;
in search.h For a quad it should be changed to four, then it should work I think but only on a quad?
Is there a way to know where this "2" is in the .exe itself?
Then this could easily be changed with a Hex Editor.

By the way, all the Toga 3.1.2SE versions run on my Intel Core 2 Duo,
but only the P3, P2 and P1 versions run on my old AMD Athlon XP 2000+ (which has the SSE instructions).
With the other versions, including Toga 3.12SE MP, I get a Windows error when I try to execute. Do you know why?
User avatar
Eelco de Groot
Posts: 4697
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: Toga 3.12SE MP with sources.

Post by Eelco de Groot »

ernest wrote:
Eelco de Groot wrote:I think you would have to do a recompile to change it, there is a line
const int NumberThreads = 2;
in search.h For a quad it should be changed to four, then it should work I think but only on a quad?
Is there a way to know where this "2" is in the .exe itself?
Then this could easily be changed with a Hex Editor.

By the way, all the Toga 3.1.2SE versions run on my Intel Core 2 Duo,
but only the P3, P2 and P1 versions run on my old AMD Athlon XP 2000+ (which has the SSE instructions).
With the other versions, including Toga 3.12SE MP, I get a Windows error when I try to execute. Do you know why?
Hello Ernest,

Letting loose a Hex editor to change this seems a bit unnessary when there are the sources available. I'm not sure everything would work with threads is 4 but if this version is still a shared hashtable implementation I don't think there would be much difficulties. Maybe Denis would make a new compile for quad testing if people who just can't wait for a new version to pop up on the net would ask him nicely?

I can't test any of this so no guarantees...

About the SSE I don't know, it could be that the compiler also looks for SSE2 support and the Athlon XP 2000 did not have that in its SSE unit. But I doubt very much if the actual Toga program can make any use of SSE or SSE2, SSE3, these are after all floating point instructions that mainly help in multimedia applications, the graphics is very floating point intensive. But Toga does not use any floating point instructions anywhere, so I think it is no real optimizatization to let the compiler try to make use of it.

Making a change so that the number of threads can be a UCI option I think I could probably do that without breaking the code 8-) But maybe somebody else is working on it?

Regards, Eelco
User avatar
Denis P. Mendoza
Posts: 415
Joined: Fri Dec 15, 2006 9:46 pm
Location: Philippines

Re: Toga 3.12SE MP with sources.

Post by Denis P. Mendoza »

Thomas Gaksch already mentioned that the new Toga release will come soon - Toga II 1.4 beta5c. Based on CCRL statistics, it already proved a significant improvement in elo strength. Let's just say, it's already in the oven :wink: .

To clarify something about the MP code, here is what Thomas Gaksch himself said:

"There is no uci parameter for the number of threads. you have to edit it in the search.h file and const int NumberThreads = 1;"

Change it to 2 for dual-core mode, 4 for quad-core, 8 for 8-core. Maxthreads was 16, so it's the maximum..

Eelco said it right! So no hexeditor can do that as well.

Chris already mentioned that the 312SEMP version was a an adaptation of his engine inside the leaked old beta version of Thomas Gaksch's engine, using "share hashtable implementation". IMHO the guy made a good editing, since it's working pretty well.

Well Eelco. you really know my weakness :) . I really can't deny nice people :D :D :D .

But let's just wait for the release of the new official Toga. IT'S COMING REALLY SOON!
ernest
Posts: 2053
Joined: Wed Mar 08, 2006 8:30 pm

Re: Toga 3.12SE MP with sources.

Post by ernest »

Denis P. Mendoza wrote:To clarify something about the MP code, here is what Thomas Gaksch himself said:
"There is no uci parameter for the number of threads. you have to edit it in the search.h file and const int NumberThreads = 1;"
Change it to 2 for dual-core mode, 4 for quad-core, 8 for 8-core. Maxthreads was 16, so it's the maximum..
Eelco said it right! So no hexeditor can do that as well.
Thanks, Denis!
But still, who would bother (or have the means...) to compile a new version, after modifying search.h, when it is much simpler to patch a byte or two of the .exe with an hexeditor?
Also, can you perhaps answer to why your versions TogaIIv3.1.2SE_P4_SSE2.exe and Toga II 3.1.2SEp4.exe, as well as the TogaII312SE_MP.exe don't run on my old AMD Athlon XP +2000 (I get a Windows error). Of course they all run fine on my Intel Core 2 Duo.
User avatar
Denis P. Mendoza
Posts: 415
Joined: Fri Dec 15, 2006 9:46 pm
Location: Philippines

Re: Toga 3.12SE MP with sources.

Post by Denis P. Mendoza »

ernest wrote:
Denis P. Mendoza wrote:To clarify something about the MP code, here is what Thomas Gaksch himself said:
"There is no uci parameter for the number of threads. you have to edit it in the search.h file and const int NumberThreads = 1;"
Change it to 2 for dual-core mode, 4 for quad-core, 8 for 8-core. Maxthreads was 16, so it's the maximum..
Eelco said it right! So no hexeditor can do that as well.
Thanks, Denis!
But still, who would bother (or have the means...) to compile a new version, after modifying search.h, when it is much simpler to patch a byte or two of the .exe with an hexeditor?
Also, can you perhaps answer to why your versions TogaIIv3.1.2SE_P4_SSE2.exe and Toga II 3.1.2SEp4.exe, as well as the TogaII312SE_MP.exe don't run on my old AMD Athlon XP +2000 (I get a Windows error). Of course they all run fine on my Intel Core 2 Duo.
Hello Ernest,

I'll be glad to compile a customized one for your Athlon XP.:D.

If a simple hexediting can do it, why not. I only said it can't, because I don't know that patching procedure for the "MP byte" editing. Well, I stand corrected. Give me a sample, as I also want to learn such stuff.

With regards to the compiles:

TogaIIv3.1.2SE_P4_SSE2.exe was the original compile for Chris Formula by another good compiler which I haven't met yet. It's compatible with Intel Pentium 4 and other newer versions of AMD. That is why Chris asked me to compile separate builds.

Toga II 3.1.2SEp3.exe runs on PIII and above processors (fit for your pc)while Toga II 3.1.2SEp4.exe runs on PIV and above. Sad to say I used a command switch for SSE, so this build will not run on your hardware if you don't have SSE. The previous one is just OK! But i also made a special build for older pc after making the Checkov version for Eelco. Check it here:
http://kirr.homeunix.org/chess/discussi ... bbd1935971
or download it:
http://kirr.homeunix.org/chess/discussi ... hp?id=8971
I also own an old pc to use my compiles there. And these PI and PII exe/s run faster than the ones with SSE functions. I'll probably avoid using this intrinsic function in my single cpu chess engine projects, unless needed.

TogaII312SE_MP.exe may also be SSE enabled, same as the last. If it doesn't run, the problem is mostly hardware incompatibilities. Give me a maximum of 1-day. I'll send you a pm for the link.
User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: Toga 3.12SE MP with sources.

Post by Zach Wegner »

ernest wrote:But still, who would bother (or have the means...) to compile a new version, after modifying search.h, when it is much simpler to patch a byte or two of the .exe with an hexeditor?
This wouldn't work. const ints get hardcoded into the exe at compile time, so you would have to change the instructions in multiple places. And forget about changing MaxThreads.
ernest
Posts: 2053
Joined: Wed Mar 08, 2006 8:30 pm

Re: Toga 3.12SE MP with sources.

Post by ernest »

Zach Wegner wrote:This wouldn't work. const ints get hardcoded into the exe at compile time, so you would have to change the instructions in multiple places.
Thanks Zach. I understand what you say.
But then, what will be the solution (hopefully the one Thomas will build...) in order to obtain a MP version adapted or adaptable to 1, 2, 4, 8... cores?
User avatar
Denis P. Mendoza
Posts: 415
Joined: Fri Dec 15, 2006 9:46 pm
Location: Philippines

Re: Toga 3.12SE MP with sources.

Post by Denis P. Mendoza »

ernest wrote:
Zach Wegner wrote:This wouldn't work. const ints get hardcoded into the exe at compile time, so you would have to change the instructions in multiple places.
Thanks Zach. I understand what you say.
But then, what will be the solution (hopefully the one Thomas will build...) in order to obtain a MP version adapted or adaptable to 1, 2, 4, 8... cores?
Hello Ernest'

Get the newly released src here:
http://www.superchessengine.com/Toga1.4beta5c.zip

Open search.h with your text editor and look for these scripts:

// constants

const int MultiPVMax = 10;
const int MaxThreads = 16;
const int NumberThreads = 8;

This is what Zach is talking about.

Leave MaxThreads as it is and edit/save NumberThreads to the number of cpu or cores prior to compiling. The value "8" means its for 8-cpu, as an example.

I hope it clears the issue.

Check your messagebox as promised.