Darwinbots Forum

Bots and Simulations => Evolution and Internet Sharing Sims => Topic started by: jknilinux on November 23, 2009, 01:15:21 PM

Title: cycles/sec
Post by: jknilinux on November 23, 2009, 01:15:21 PM
What's the most cycles/second anyone has ever achieved, with a decently large population/sim size? What hardware did you use?
Title: cycles/sec
Post by: Numsgil on November 23, 2009, 01:39:49 PM
I managed 1000 bots at 1 cycle/sec I think (maybe more like .6 cycles/sec)...  That was on my 2 Ghz P4.  The program is single threaded and single core speed increases have mostly stalled in the last 5 years or so, so I doubt anyone's managed anything much more than that.  Even if you're running Darwinbots on some sort of super computer, they're super parallel, not super serial.

Of course with a multi core machine you could run multiple instances and connect them with teleporters.
Title: cycles/sec
Post by: jknilinux on December 19, 2009, 11:24:22 PM
I don't have a multi-core machine, so this may be a simple question, but how do  you get one DB to run on on core and the other DB to run on the second? You can't just go to task manager and click "run off of processor 2" or something, can you?


*EDIT: By "DB", I mean darwinbots/other program
Title: cycles/sec
Post by: Numsgil on December 20, 2009, 12:49:24 AM
Operating systems will usually evenly split a single threaded process across multiple processors.  So for instance, if you have a dual core machine DB2 will use 50% of the first processor and 50% of the second.
Title: cycles/sec
Post by: Testlund on December 20, 2009, 10:55:42 AM
Quote from: jknilinux
I don't have a multi-core machine, so this may be a simple question, but how do  you get one DB to run on on core and the other DB to run on the second? You can't just go to task manager and click "run off of processor 2" or something, can you?


*EDIT: By "DB", I mean darwinbots/other program

Yes, you can!    If you select the process tab and right-click on a process you can chose which core it should run on.

It's quite remarkable that there are many new games/programs not optimised for more than 1 core, now when even dual-cores are getting old and you have quad-cores!

Software makers are starting to lack behind. It used to be the other way around. I have a few old game titles that it took several years before there were hardware that could run them smoothly.

Software and hardware makers should talk to each other more often.
Title: cycles/sec
Post by: jknilinux on December 20, 2009, 02:14:48 PM
Nums: Wait, if it splits a single-threaded process across 2 cores, isn't that pretty much automatic parallelization? I thought multiple cores won't increase the speed of a single-threaded process...

Testlund: Great! So, assuming I have a 4-core processor, would DB run faster if I run 1 big sim or if I run 4 small sims and assign 1 to each core, and connect them with teleports?
Title: cycles/sec
Post by: Numsgil on December 20, 2009, 02:32:51 PM
Quote from: Testlund
It's quite remarkable that there are many new games/programs not optimised for more than 1 core, now when even dual-cores are getting old and you have quad-cores!

Software makers are starting to lack behind. It used to be the other way around. I have a few old game titles that it took several years before there were hardware that could run them smoothly.

Software and hardware makers should talk to each other more often.

The problem is that for many decades home PCs were single core machines, and that single core was getting exponentially faster.  Hardware makers have since hit a brick wall in single core speed, so they've begun branching out "horizontally" with more cores.  But programming for more cores requires more than one thread, and programming with multiple threads is hard because you can't always predict what one thread is doing during another thread's execution.  They might be trying to write to the same place in memory, and then they'll stomp on each other and you'll get impossible-to-track-down bugs.  So you need to use special commands to make sure that doesn't happen.  But if you use too many of those commands your program will actually run slower.

Quote from: jknilinux
Nums: Wait, if it splits a single-threaded process across 2 cores, isn't that pretty much automatic parallelization? I thought multiple cores won't increase the speed of a single-threaded process...

It splits them across multiple cores to load balance.  But only one core is ever active at a single time.  So 50% of two cores is still only 1 core worth of processing power.

Quote
Testlund: Great! So, assuming I have a 4-core processor, would DB run faster if I run 1 big sim or if I run 4 small sims and assign 1 to each core, and connect them with teleports?

4 smaller sims.
Title: cycles/sec
Post by: Testlund on December 20, 2009, 07:42:14 PM
Here's an example of DB running on two cores connected with teleporters.
Title: cycles/sec
Post by: jknilinux on December 21, 2009, 01:19:22 AM
Awesome! Thanks!