Contents
Performance Scaling With Cores: Introducing The SMOKE Framework
 
 
Printer-Friendly VersionPrinter-Friendly Version
 


Part of:



[More information...]
 

Latest News
spacer View All spacer
 
November 22, 2009
 
Video Game Watchdog National Institute On Media And The Family Shutting Down [11]
 
Modern Warfare 2 Infinity Ward's 'Most Successful PC Version' Yet [12]
 
New Tech, Design Details Of Project Natal To Emerge At Gamefest In February
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
November 22, 2009
 
Trion Redwood City
Sr. Environment Artist
 
Trion Redwood City
Sr. Evnironment Modeler
 
Sucker Punch Productions
3D Environment Artist
 
Sucker Punch Productions
Network Programmer
 
Sucker Punch Productions
Texture Artist
 
Sucker Punch Productions
Character Artist
 
Crystal Dynamics
Sr. Level Designer
 
Monolith Productions
Sr. Software Engineer, Engine - Monolith Productions - #113767
spacer
Latest Features
spacer View All spacer
 
November 22, 2009
 
arrow Upping The Craft: Susan O'Connor On Games Writing [6]
 
arrow Small Developers: Minimizing Risks in Large Productions - Part II [7]
 
arrow iPhone Piracy: The Inside Story [49]
 
arrow And Yet It Grows: Analyzing the Size and Growth of the European Game Market [5]
 
arrow NPD: Behind the Numbers, October 2009 [13]
 
arrow Reflecting On Uncharted 2: How They Did It [5]
 
arrow Sponsored Feature: Rasterization on Larrabee -- Adaptive Rasterization Helps Boost Efficiency
 
arrow Postmortem: Wadjet Eye's The Blackwell Convergence [2]
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
November 22, 2009
 
Time Fcuk [1]
 
Accepting the Inherent Value of Games
 
Planckogenesis, Part II: Song Structure & Gravy Train [1]
spacer
About
spacer News Director:
Leigh Alexander
Features Director:
Christian Nutt
Editor At Large:
Chris Remo
Advertising:
John 'Malik' Watson
Recruitment/Education:
Gina Gross
 
Features
  Performance Scaling With Cores: Introducing The SMOKE Framework
by Orion Granatir
8 comments
Share RSS
 
 
November 26, 2008 Article Start Previous Page 2 of 3 Next
 

Figure 3: SystemAI and SystemGraphic are subscribing to position changes from SystemPhysics.

Figure 3. SystemAI and SystemGraphic are subscribing to position changes from SystemPhysics.

The registration of objects between systems occurs during initialization of the framework using the interfaces developed in Smoke. When a system modifies its data it tells the CCM, and that information is passed on during the next frame refresh (see Figure 3). The CCM does not pass the data through to each subscribed system, but instead leaves it to the system itself to copy the data only if necessary for its present operation.

Figure 4: Interfaces make communication between systems easy.

 

Figure 4. Interfaces make communication between systems easy.

To maintain Smoke’s highly modular design, interfaces were developed between the various systems and the framework itself—a key feature. The framework’s job is to enable communication between the various systems (see Figure 4). For example, we might have a geometry interface for changing the positions of models or a behavior interface for changing AI states of specific objects. The Scheduler uses the task interface to schedule and invoke work with each system.

Running through a typical frame process in Smoke helps clarify this activity. Imagine a single frame in the engine being rendered, where the process starts with the framework’s systems subdividing the tasks for processing. The Scheduler invokes each system per frame allowing the system to naturally divide its own work into granular pieces that can be broken up into various jobs. Competent middleware is able to accomplish this quite easily, which minimizes the Scheduler’s necessary work.

Figure 5: Worker threads are assigned jobs from the pool of available processing work.

Figure 5. Worker threads are assigned jobs from the pool of available processing work.

Once all of these tasks have been created, they are collected into a single pool that all available worker threads can access. A properly designed framework allows for one worker thread per core, and this is where the power and scalability of the design really starts to play out.

Each job in the pool is then assigned to a thread (see Figure 5) based on the load of each particular thread and the framework’s estimation on how processor-intense each job is.

The one area that the Smoke developers admit is problematic is in this step: Properly balancing the load of jobs across each thread requires some kind of pre-determined knowledge about the work in each job. Obviously in a very lightweight framework, such as the one we are describing, that information is difficult to come by.

Cache coherency on the processor is another important issue to keep in mind when subdividing tasks. In the most optimal setup threads should work on blocks of data rather than random or interleaved data, allowing the processing core to access cache and memory resources in a more linear, and thus quicker, fashion.

Figure 7: Each of the worker threads has a change queue that is accessed by the CCM.

Figure 6. Each of the worker threads has a change queue that is accessed by the CCM.

During the processing of the current frame, the various worker threads and jobs post messages to the CCM (see Figure 6) indicating updates to the status of any registered objects.

Once the frame has been completed, the CCM sends those messages on to the appropriate systems that have subscribed to the updated objects before the next frame’s processing begins, allowing the updated data to propagate through the framework. And thus, the cycle repeats, and we have a fully threaded, independent-processing model for a game engine.

 
Article Start Previous Page 2 of 3 Next
 
Comments

SONG Vincent
profile image
What happen if you turn IA and particles off (fire, smoke, water in the demo) ? IA and particules can be parallelize quite easily and you can use as many core you want to compute them. And of course, when you turn the system from 8 to 1 thread, the game is slowing down...
The real chalenge would be using more complex scene to render from 1 thread to 8 threads. For exemple a farm 8 time bigger or with a lot more rigid body.

Orion Granatir
profile image
Hey SONG Vincent,
The Smoke team is working on another demo called Horsepower. This demo is supposed to show “perceivable difference" based on the number of available threads; very similar to what you are suggesting. In Horsepower, with an increasing number of threads the demo will be able to process more objects animating, using physics, and running AI. All of the source code for Smoke is available here: http://software.intel.com/en-us/articles/smoke-game-technology-demo. Please feel free to experiment with Smoke and I’d love to hear what you do with it.

SONG Vincent
profile image
Smoke handle the threading part while game developer divide game functions into small parallelizable task.
There is a lot of work to do for the last part :)
About Horsepower, it seems to be very interesting, can you give us more informations ?
I'am interesting about horsepower because I'am actualy working on a demo of my own with physics and 3D only, no animation (object or 2D), no particules, no AI. And of course I expected more objects to be compute based on the number of availlable threads :p

Orion Granatir
profile image
Each system in the Smoke demo can divide its task into smaller parallelizable parts. This is to help give some examples of how systems (like AI, graphics, fire, etc) can subdivide their work.

We will release Horsepower early next year. This demo adds LODs and multithreaded animation to the Smoke framework. The Horsepower demo shows a hilly scene with a large number of herding horses. The number of horses is dependent on the number of available threads and compute power. Just like Smoke, we are planning on giving away all the source code.

Keep me up-to-date on your demo. It sounds like an interesting project ^_^

SONG Vincent
profile image
Orion,

You can have videos of our demo over here http://www.acclib.com/2009/01/load-balancing-23012009.html
Like I said before it's just a technological demo, not a game demo :)

Rgds

VIncent

SONG Vincent
profile image
Orion,

On a corei7, I can deal with 4x more spheres on 8 threads (compare to 1 thread). Test is here : http://www.acclib.com/2009/01/load-balancing-corei7-27012009.html

Vincent

Orion Granatir
profile image
I'll have to take a closer look at your demo... nice scaling :D

Michael Yi
profile image
A couple of the developers on the Smoke team are working on the Smoke project, focusing on performance optimization. We'll be releasing articles, videos and blogging about what we did and what tools we used to extract the most performance out of Smoke. Hopefully, game
developers will find these series of articles helpful in reaching greater performance in their games.

We have already presented our first phase of optimization work on Smoke at the Intel Developer Forum in September. Luckily, the presentation was recorded and is already live on
Intel Software Network. Part 1 of the video can be found here: http://software.intel.com/en-us/videos/optimizing-a-video-game-smoke-fanning-the
-flames-to-really-make-it-burn-part-1/ which also has links to the rest of the presentation. The slides can be found here: http://www.intel.com/go/idfsessions

The presentation reviewed the demo code design and then showed a complete performance study, with step-by-step use of Intel tools:
- Benchmark and measure a baseline
- Find common memory and data race bugs with Intel® Parallel Studio
- Drill down into hot spots in the code, and highlight why they're hot with Intel Parallel Studio and Intel® VTuneTM Analyzer
- Find concurrency problems with Intel® Thread Profiler
- Show some speedups made in the code

We are planning to release the updates we made to the Smoke code in the coming weeks, which includes a performance speed up and a port of the code to
Visual Studio 2008. Both an executable and source code will be made available, as usual.

Please let us know if you have any suggestions for making Smoke better!


none
 
Comment:
 


Submit Comment