Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Super long term goal] variable cores  (Read 1227 times)

alfie275

  • Bay Watcher
    • View Profile
[Super long term goal] variable cores
« on: March 29, 2009, 02:02:27 pm »

Ofcourse first multicore would have to be implemented but heres my idea:

Basically multicore but you can assign a task to a core by way of init.txt. Fo example it might look like this on a single core:

[AI:1]
[FLUIDS:1]
[HEAT:1]
[PHYSICS:1]
etc..

Dual core:


[AI:1]
[FLUIDS:2]
[HEAT:1]
[PHYSICS:2]
etc..

Three core:

[AI:1]
[FLUIDS:2]
[HEAT:3]
[PHYSICS:1]
etc..

Quad core:


[AI:1]
[FLUIDS:2]
[HEAT:3]
[PHYSICS:4]
etc..

And so on.
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275

profit

  • Bay Watcher
  • Finely Crafted Engravings... Or it didn't happen.
    • View Profile
Re: [Super long term goal] variable cores
« Reply #1 on: March 29, 2009, 03:17:01 pm »

Actually, in a dwarf fortress built to handle multi-core processors. Each of the following will be broken into more than one thread.  Pathfinding and jobfinding for example may be given a thread for EVERY call to it.

Since the build and tear times for a thread are nearly nothing in terms of processor overhead, most likely they will just be created when they are needed and destroyed when they are not.

I know most shaders are parallelised to the hilt, along with most current physics offloading that is done.

Heat, Fluids, Physics, in a perfect world will be sent to the PhysX api, and it will parallise it all abstractly and return the values to dwarf fortress through the api when it is done computing them in the video card.

The pathfinding and job finding will start at the top of the loop, creating a separate thread for each one that needs to be done.  And at the bottom of the loop before they are used, a mutex will be checked to make sure that the thread has completed, then the main thread will pull all the information from them and display the results.

Logged
Mods and the best utilities for dwarf fortress
Community Mods and utilities thread.

alfie275

  • Bay Watcher
    • View Profile
Re: [Super long term goal] variable cores
« Reply #2 on: March 29, 2009, 03:27:20 pm »

The reason I posted this was because I am getting an 8.8ghz quadcore which means if it uses only one core it will be slower than my current 3.6 ghz single core. You don't by any chance know of a single core emulator?
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275

Aldaris

  • Bay Watcher
  • [LIBERAL] [WANNABE_DORF] [CAVE_ADAPTED]
    • View Profile
Re: [Super long term goal] variable cores
« Reply #3 on: March 29, 2009, 03:42:01 pm »

I believe you have to google 'virtual machine' to get off to a good start.
Logged
but Baron Aqizzar had the firm advantage, battering Cthulhu with his Mighty Chin.
^Totally not out of context, promise.
The Liberal Crime Squad Community game, now with a Liberal Overdose of Liberally aplied Liberalism. -Liberally. (UBER-Hiatus, next update somewhere between now and 2012.)

profit

  • Bay Watcher
  • Finely Crafted Engravings... Or it didn't happen.
    • View Profile
Re: [Super long term goal] variable cores
« Reply #4 on: March 29, 2009, 03:48:57 pm »

if it is 8.8 ghz then it is MUCH faster than a 3.6 ghz even if you are only using a single core.

However I have never seen such a fast quad core proccesor. Are you sure you do not mean a 2.2ghz Quad core?

Hz is cycles per second the cores run at... The number of cores is just that... a number of processors they have squeezed onto a die.

There is no way to make dwarf fortress currently use the full power of modern multi-cored machines.   (Well except starting 4 copies of it)

For reasons I dont want to get into there is no way to create an "emulator" to force a single thread process into a multi-threaded one.  Although the windows kernel will faithfully distribute the load across all 4 of your cores, giving each one about 25% usage.

But yes, dwarf fortress does need some massive code overhauling in order to take advantage of the multi-cored machines.

 It is just that Mr. adams does not know how to do it yet.  When he learns how to do it properly, it will be in the game, and windows will balance the threads seamlessly, and you will play a lag free game.

*ps if you really want a proccess to run on a single thread, simply start the program, then go into task manager, and change the affinity from all 4 processors to just the one you want.

« Last Edit: March 29, 2009, 03:50:43 pm by profit »
Logged
Mods and the best utilities for dwarf fortress
Community Mods and utilities thread.

alfie275

  • Bay Watcher
    • View Profile
Re: [Super long term goal] variable cores
« Reply #5 on: March 29, 2009, 04:21:52 pm »

I meant 8.8 ghz over all so 2.2ghz per core.
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275

profit

  • Bay Watcher
  • Finely Crafted Engravings... Or it didn't happen.
    • View Profile
Re: [Super long term goal] variable cores
« Reply #6 on: March 29, 2009, 05:14:14 pm »

I meant 8.8 ghz over all so 2.2ghz per core.

Ahhh =)   

In the future, refer to it as a 2.2 Ghz Quad Core.   The reason why is because the Ghz is just a timing signal, the actual work being done can vary greatly. 

But to give you actual information.  Yes, dwarf fortress will run slower on your quad core machine.   UNLESS, you are switching from a 3.6Ghz Intel Pentium 4 Proccessor to a 2.2 Ghz AMD Phenom Quad Core.

The reason behind that is because the Ghz is just a timing signal, AMD chips do more per clock cycle than intel pentium 4 chips do.   The difference can be astounding when programs do certain ops as pentium 4's can take more than 15 clock cycles to complete them.

But I am sorry from a real life perspective, Dwarf fortress will likely be slower, with the only difference being you can run 4 of them at once with no further slowdown.

This will be the case until it is re-programmed to take advantage of multicore machines.

* PS. Just noticed you mentioned 3 core machines...  As far as I know, there will never be a machine that features an odd number of cores..   The reason being is they will not fit squarely on a die. (Well possibly a 9 core)

1 Core ->
[]

Spoiler (click to show/hide)

2 Cores ->
[][]

Spoiler (click to show/hide)

4 Cores ->
[][]
[][]

Spoiler (click to show/hide)

8 cores  ->

[][][][]
[][][][]

16 Cores ->

[][][][]
[][][][]
[][][][]
[][][][]

« Last Edit: March 29, 2009, 05:28:09 pm by profit »
Logged
Mods and the best utilities for dwarf fortress
Community Mods and utilities thread.

Gertack

  • Bay Watcher
    • View Profile
Re: [Super long term goal] variable cores
« Reply #7 on: March 29, 2009, 08:11:12 pm »

3-cores exist.  In a 3 core they can just put the L2/L3 cache in the extra area, or downgrade a 4-core that has one busted from manufacturing defects.
Logged

profit

  • Bay Watcher
  • Finely Crafted Engravings... Or it didn't happen.
    • View Profile
Re: [Super long term goal] variable cores
« Reply #8 on: March 29, 2009, 08:21:49 pm »

3-cores exist.  In a 3 core they can just put the L2/L3 cache in the extra area, or downgrade a 4-core that has one busted from manufacturing defects.
ahh yes amd is doing such things...
http://www.engadget.com/2007/09/16/is-amd-readying-three-core-processors/
but I contend, it is still technically a 4 core chip, just with one turned off =)

Logged
Mods and the best utilities for dwarf fortress
Community Mods and utilities thread.