Welcome, Guest. Please Login or Register.
Nov 25th, 2024, 1:29pm

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « threads and related stufff »


   Arimaa Forum
   Arimaa
   Bot Development
(Moderator: supersamu)
   threads and related stufff
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: threads and related stufff  (Read 1402 times)
doublep
Forum Guru
*****



Badger author

   


Gender: male
Posts: 82
threads and related stufff
« on: Dec 6th, 2005, 4:53pm »
Quote Quote Modify Modify

According to Jdb, the machine the bots sit on probably has two CPUs.  Doesn't really look so, since unthreaded Aami-ra seems to consume 100% CPU, but I got interested in making in threaded anyway...
 
So here are many small questions I got in process:

  • Is it really multi-CPU and will the Computer Championship be held on multi-CPU machines?
  • Are bots allowed to use all the CPUs?
  • Does anyone know why libgthread won't compile statically (lots of `undefined reference to ...' errors)? (It compiles normally just fine.)
  • Is it possible to install libgthread on gold.arimaa.com instead? (It is a very common library, there is certainly a package for whatever distro is used on that box.)

A little more generally: are there currently bots that are able to utilise multiple CPUs? I threaded Aami-ra in two evenings, though I'm not sure all errors are terminated. My machine has only one CPU, so I cannot stress the implementation seriously, though even with one CPU and two threads I managed to find many problems Smiley.
IP Logged
jdb
Forum Guru
*****



Arimaa player #214

   


Gender: male
Posts: 682
Re: threads and related stufff
« Reply #1 on: Dec 6th, 2005, 6:25pm »
Quote Quote Modify Modify

This is a quote from an email omar sent me:
 
Quote:
Yes, you can use both CPU's. Im not sure how you do
that from the program though. I think that linux
uses the CPUs to run multiple independent processes.
So even if your program does not try to use both  
CPUs it will still benifit since it will be swapped
out less because other processes can be run on the
second CPU.
 
IP Logged
doublep
Forum Guru
*****



Badger author

   


Gender: male
Posts: 82
Re: threads and related stufff
« Reply #2 on: Dec 7th, 2005, 5:01am »
Quote Quote Modify Modify

As far as I know, threads and processes are both created with a call to fork() at the lowest level. So I think Linux can dispatch either two threads of one  process or two different processes on two CPUs.
 
I don't have any ways to check right now, though, since I cannot run threaded Aami-ra on gold.arimaa.com due to a missing library... (That's assuming gold.arimaa.com has two CPUs in the first place.)
IP Logged
99of9
Forum Guru
*****




Gnobby's creator (player #314)

  toby_hudson  


Gender: male
Posts: 1413
Re: threads and related stufff
« Reply #3 on: Dec 7th, 2005, 5:10am »
Quote Quote Modify Modify

I think it does have 2 processors.  When I run gnobby the load only goes up to 0.50.  Top still reads 100%, but that's because it's using 100% of one processor.
IP Logged
doublep
Forum Guru
*****



Badger author

   


Gender: male
Posts: 82
Re: threads and related stufff
« Reply #4 on: Dec 7th, 2005, 3:02pm »
Quote Quote Modify Modify

on Dec 6th, 2005, 4:53pm, doublep wrote:
Is it possible to install libgthread on gold.arimaa.com instead? (It is a very common library, there is certainly a package for whatever distro is used on that box.)

 
Ah, I've just looked closer and libgthread is installed there. Just not the development parts. Will check if it works with a home-compiled bot once the current game against GnoBot finishes.
IP Logged
doublep
Forum Guru
*****



Badger author

   


Gender: male
Posts: 82
Re: threads and related stufff
« Reply #5 on: Dec 9th, 2005, 4:22pm »
Quote Quote Modify Modify

OK, now it finally runs faster than before when using two CPUs. I'm still disappointed, since the speedup is merely about 5%, I sort of hoped for more... Anyway, the bot is now configured to run in two threads and use 256 MB of memory for the cache.
 
In case anyone wonders: gold.arimaa.com is indeed a two-CPU machine as can be seen in the file `/proc/cpuinfo'.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.