CODESHOP: Making the Most of Cell
Date: Wednesday, October 31 @ 11:12:14 UTC
Topic: Playstation 3


With programmers finding it difficult to take full advantage of PS3, tools company Codeplay hopes its new parallelism system will ease the pain.

In many respects, PlayStation 3 is an anachronism. The pinnacle of Sony Computer Entertainment’s decade-old philosophy that focuses on proprietary chip design to gain performance and long-term production efficiencies, it’s been outflanked by Microsoft’s off-the-shelf approach and Nintendo’s control-is-everything attitude. And with its main architect, one-time CEO and the father of the PlayStation Ken Kutaragi, no longer in charge, it’s likely that PlayStation 4 will be a very different beast.

Of course, in terms of the current console war, it’s still early days. PlayStation 3 remains the most powerful gaming device, as well as providing the best future-proofed option in terms of consumer electronics, although cynics might say that at its original launch price it should’ve made the tea, too.

For developers, however, the dilemma is how to make the most of its exotic configuration – notably its CPU. Even now, years after the initial interest in the design has died down, Cell’s configuration of one main processor driving eight Synergistic Processing Elements (SPEs) via what’s called the Element Interconnect Bus (EIB) makes it one of the most fascinating pieces of silicon coders can get their hands on.

For example, outside of games, researchers at the STI Center of Competence for the Cell Processor continue to publish papers with titles such as ‘Fastest Fourier Transform on Cell’ and ‘On the Design and Analysis of Irregular Algorithms on Cell’, while its use in scientific applications such as Folding@Home, as well as MMOG hosting, demonstrates its potential. One hardware integrator, Mercury Computer Systems, recently released software which enables companies to use retail PlayStation 3s to build high-performance clusters for the analysis of data from financial transactions, oil and gas field exploration, biotechnology and video compression.

Because if there’s one thing Cell is excellent at, it’s handling vast amounts of information as the EIB enables high throughput while the parallelism inherent in the SPEs means tasks can be processed very efficiently. The issue for developers is making sure information is presented in the right way.

With the exception of specific architectures such as Intel’s Streaming SIMD Instructions or PS2’s Vector Units, few game programmers have had much experience of writing well-organized parallelized code. And games aren’t the easiest pieces of software to apply to parallel hardware, anyway.



Read on there is alot more to this story


According to Andrew Richards (pictured), CEO of Scottish programming tools company Codeplay, the problem is that games work differently to scientific work.

“We’ve looked at various parallel programming languages such as OpenMP, which is an industry-standard way of doing parallelism, but it relies on data being in arrays rather than in data structures,” he says. Incidentally, OpenMP is the basis of IBM’s own research into compilers for getting the most out of Cell. “This assumption is fair enough for scientific applications but isn’t true of games,” Richards continues. “A lot of game data is in complex data structures because game enemies don’t line up in a long line. They move around, so you need a data structure that can handle issues such as which enemies are visible at any time.”

Equally, when it comes to games, the type of processing carried out on a CPU is varied, typically involving tasks such as artificial intelligence, audio and physics calculations, as well as setting up the rendering to be sent over to the graphics card. In addition, many developers have existing engines that run to hundreds of thousands of lines of code. Retrospectively getting these into shape to get the most out of the Cell part of the equation just adds further complexity to the task.

That’s why, after originally setting up shop to offer its VectorC compiler for PlayStation 2, Andrew Richards and his team decided to take a different approach with PlayStation 3. Instead of working on compilers, which have to be written directly for each piece of hardware to automatically make your code run well, Codeplay’s solution is its general-purpose Sieve C++ Parallel Programming System, which acts as a frontend to official compilers provided by hardware companies.

“In the past we took the view that we would take your existing program and automatically parallelize it across various processors, but with PlayStation 3 we’ve come to the conclusion that what you need to do is rewrite parts of your code,” Richards says. “The trick is that we can ensure it’s a small change and one that our tools will help you make.”

{moscallout}It seems as if game coders, as well as PS3 owners, will be waiting to make the most of Sony’s hardware for some time to come.{moscallout}The Sieve system works by forcing programmers to carefully think about which areas of their code will give the best performance boost when spread across several SPEs. Once these are defined in what Richards refers to as Sieve blocks, the system will check that there are no dependencies which would stop the code being successfully spread across multiple processors. The reason it’s called Sieve is because it enables coders to sieve out data modifications from within these blocks, thus removing an enormous number of dependencies in the process.

“You need an intelligent user because this isn’t a case of shoveling something in one end and watching it come out as parallelized code at the other, but Sieve will give the programmers considerable assistance in terms of marking up their code and telling them if things can be parallelized or not,” Richards explains.

Still, as he confesses, Sieve itself remains something of a research project at present. It’s currently being sent out to various university groups and selected game companies to see how useful they find it. At best, Richards reckons it will be ready for widespread deployment in summer 2008.

In the meantime, though, there are plenty of other companies looking to provide similar smarts. Official PlayStation 3 tools provider SN Systems is working on its own Cell-based compiler technology, while US middleware company Emergent will be offering its Floodgate data streaming API as part of its Gamebryo engine; something that’s expected in early 2008. It seems as if game coders, as well as PlayStation 3 owners, will be waiting to make the most of Sony’s hardware for some time to come.



News-Source: Next-Gen





This article comes from XBOX-HQ.COM
https://www.xbox-hq.com/html

The URL for this story is:
https://www.xbox-hq.com/html/modules.php?name=News&file=article&sid=4078