running same engine twice on one pc

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Werner
Posts: 2978
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

running same engine twice on one pc

Post by Werner »

Hi,
following conditions:
PC core2duo 4GB RAM Windows XP
Arena installed 2 times
running 2 matches at the same time e.g.
Toga II 1.4 Beta5c 1CPU - Rybka 1.0 beta
Toga II 1.4 Beta5c 1CPU - Hiarcs 11
all engines 256 MB hash
tbs/egbb installed on a memory stick (once only)

Question:
is this dangerous with 2 times Toga running at same time, why?
e.g.
does every engine has its own hashtables in another region of RAM?
is it possible that one engine overwrites a variable or hash entry of the other engine?
...
Werner
User avatar
hgm
Posts: 28356
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: running same engine twice on one pc

Post by hgm »

RAM use is always private to a process, so if you run two engine processes, even from te same executable, they will never affect each other's RAM.

If they use files, however, it might be tricky: they can see each other's files if you run them in the same directory, which you would need to do if you run them from the same executable. This applies to things like learn files or permanent hash. My own engine Joker writes a log file of fixed name in its directory, and running it twice can even cause one of them to crash, because its log file gets deleted by the other, and it then gets a fatal write error.

I solve this by simply making a copy of the entire Joker folder, and then install them as if they were different engines. The executable can then keep the same name, as the folder (path)name distinguishes it from its copy. Then you are 100% safe.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: running same engine twice on one pc

Post by bob »

Werner wrote:Hi,
following conditions:
PC core2duo 4GB RAM Windows XP
Arena installed 2 times
running 2 matches at the same time e.g.
Toga II 1.4 Beta5c 1CPU - Rybka 1.0 beta
Toga II 1.4 Beta5c 1CPU - Hiarcs 11
all engines 256 MB hash
tbs/egbb installed on a memory stick (once only)

Question:
is this dangerous with 2 times Toga running at same time, why?
e.g.
does every engine has its own hashtables in another region of RAM?
is it possible that one engine overwrites a variable or hash entry of the other engine?
...
Neither of those can happen. Only issue is do you have enough RAM to support that without paging?
User avatar
Werner
Posts: 2978
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

thanks for the answer

Post by Werner »

...this helps me a lot :D

best

Werner
Werner
User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 10:44 am
Location: Madrid - Spain

Re: running same engine twice on one pc

Post by Kempelen »

Hi,

I run my engine twice in my PC too, in two differents tournays, with differents winboard and directories.

What I have noted, is that if I only run a tournament, Vista task manager shows that the engine running takes 50% of CPU. It is nearly always that %...... but if I run two tournaments, the two engines that runs at a time, show % that varies from 20 to 40%. So I intuit that having more than a tournament is not a safe task. it looks like execution time is not the same between engines..... maybe an engine with an architecture could take more cpu that another with another architecture.

Saying this, do you think it is a realible test if they run with these differences in cpu execution time?

Fermin
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/
User avatar
Werner
Posts: 2978
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

Re: running same engine twice on one pc

Post by Werner »

Hi Fermin,
I did not mention such a behaviour before with engines running on 1 CPU.

What I forgot to say: When running Arena and Chessbase matches at the same time I use task manager to say CPU 0 belongs to arena and CPU 1 belongs to Chessbase before I start the matches.

Try this - I think it works fine.

best
Werner
User avatar
hgm
Posts: 28356
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: running same engine twice on one pc

Post by hgm »

I am almost continously running 4 versions of Fairy-Max on my PC, in two parallel ponder-off matches (self-play). I even run them all in the same directory, as Fairy-Max does not write any files. I do use two different instances of PSWBTM (installed in different folders) to do this, though, as PSWBTM does use files to record the tournament state (so it can continue it after a power fail).

I have never seen any case where one of the fmax.exe processes had any CPU loading different from 50% on my Core 2 Duo, except in time slices where it started or stopped searching. There it shares the 50% with its opponent, in any possible way.

The only thing I have to be careful with, is kill lists. If I use the PV.exe utility to kill hanging engines after a time forfeit, it kills them by name of the executable file (not aware of the path), and so might very well kill the executable playing in another tourney!
swami
Posts: 6659
Joined: Thu Mar 09, 2006 4:21 am

Re: running same engine twice on one pc

Post by swami »

Werner wrote:Hi,
following conditions:
PC core2duo 4GB RAM Windows XP
Arena installed 2 times
running 2 matches at the same time e.g.
Toga II 1.4 Beta5c 1CPU - Rybka 1.0 beta
Toga II 1.4 Beta5c 1CPU - Hiarcs 11
all engines 256 MB hash
tbs/egbb installed on a memory stick (once only)

Question:
is this dangerous with 2 times Toga running at same time, why?
e.g.
does every engine has its own hashtables in another region of RAM?
is it possible that one engine overwrites a variable or hash entry of the other engine?
...
I haven't thought about this, Thanks for an idea, though :D
User avatar
Ovyron
Posts: 4562
Joined: Tue Jul 03, 2007 4:30 am

Re: running same engine twice on one pc

Post by Ovyron »

Werner wrote:Question:
is this dangerous with 2 times Toga running at same time, why?
e.g.
It may not be dangerous in this case but other engines that read/write to the same file may have problems. I.E. if you try this with two Rybka 3's with Persistent Hash ON, both will be trying to write to the same file and you can get unwanted consequences.