Dr. Dobb's - Programming the Cell Processor

Three developers affiliated with the Pacific Northwest National Laboratory provide an in depth look for Dr. Dobb's Journal at the options for optimizing a breadth first search (written in C) on the Cell Processor.

For the non-technical the results can be summarized as "On a Pentium 4 HT running at 3.4 GHz, this algorithm is able to check 24-million edges per second. On the Cell, at the end of our optimization, we achieved a performance of 538-million edges per second. This is an impressive result, but came at the price of an explosion in code complexity. While the algorithm in Listing One fits in 60 lines of source code, our final algorithm on the Cell measures 1200 lines of code"

Definitely one for the programmers amongst us.

ITR6215d ago

This reminds me of my MS paint project.
Make MS Paint in VB and C++.

Took me weeks to do it in C++.
Took only 2 days to do it in VB.

achira6215d ago

nice, but try to make a good game in VB. no chance! poor crap can be made with VB, but if you want to make something advance you must use C++.

ItsDubC6215d ago

C/C++ is extremely powerful but requires a lot more knowledge and experience to be used effectively. C/C++ is more flexible and gives developers more control over memory management and object state.

VB is geared toward rapid development, particularly w/ respect to GUIs. Some tasks cannot be done in VB but the language provides some built-in functions that are not provided by the standard C/C++ library and therefore must be implemented from scratch or through the use of another library. VB was developed by Microsoft and is therefore designed to run on the Windows platform.

I would try to explain breath-first search but it's much easier to understand visually, so here's a link for anyone interested:


QuackPot6215d ago (Edited 6215d ago )

Why many ports to the PS3 have been poor...and why articles comparing the same game on the xbox 360 and ps3 are for idiots.

If the developers aren't willing to put in the time and effort then you're going to get crappy results. Thankfully, Oblivion was an exception to the rule.

But as they gain more experience and the tools and/or start off developing the games from the Ps3, we're going to get some awesome results.

BIadestarX6215d ago

@QuackPot, fine lets all agree that this is the reason why many developers are making crappy games for the PS3.

Is that a good thing?

Making a system that allow games to be developed without needing rocket scientists is also power. Making games for the PS3 may cost a lot more to developers to make games and therefore limiting the support for the PS3 since it can go out of their budget.

This is why microsoft has being so succesful pushing technologies like asp.net (this site is made with it), C#, .net framework, etc.

They are easly to develop... so instead of developers focusing on figuring out how make the thing run they can focus on the actual product or game.

It possible that the cell or Sony's too may allow you to create a game that runs at 1,000,000 frames per second and regarles of the fact the game needs only 60fps you still have to read a full manual, test, debug... test debug... and write "1200 lines of code" when you can do achive the same results on the other consoles with only "60 lines of code".

Everyone understand there there is a benefit to the power that can be achived on the PS3 and that's great... but the price that developers have to pay for the extra features that they may not need to use is... that what suppost to be simple, easy and quick takes as much to do as complicated things. This is why there are stuff that are simple to do on the 360 that requires a lot more efford on the PS3 which is reflecting on the games that are made for both platform.

Also, this proves the other fact... games on the PS3 are larger since they require more code. A game on the 360 will probably be 2 times smaller than the PS3 version... not even considering compression technologies.

TylerDurden6215d ago (Edited 6215d ago )

More lines of code, means more bugs, means longer dev times.

Also more lines of code means bigger working set which can impact perf.

Also devs prefer ease of use over power/performance(Not saying that ps3 is more powerful than 360 or vice versa)

Think about all the various abstraction layers that make things easier, but with each layer there is a reduction in perf.
Assembly->C/C++->.NET/J ava

Which of these languages if coded properly offers the best perf?

Which of these languages is the most complex?

Which of these programming languages is least used?

Lord Anubis6215d ago

You don't know what you are talking about. :|

Fart_Bubbles6215d ago

it's obvious that blade has NO experience programming.

being a programmer myself I can tell you firshand that "interfaces" like VB only abstract the programmer away from the hardware and are inherently weaker and more rigid in what you can accomplish.

in other words you are following someone elses method for writing code.
that's all it is, pre-packaged code.

In order to really make hardware do what you want you have to be able to drill down to the actualy bits and bytes. THERE IS NOOOO WAY AROUND THIS.

I looked into writing applications for windows and quickly got turned off by it. Everything is managed for you, you have no access to memory,the harddrive,Main(), etc. It's all handled thru the infamous microsoft message pump. When this function stops working is when you see your program "freeze" and stop processing input (I.E. you banging on your kayboard like a retarded monkey trying to being the program back.

Microsoft and windows are a scourge for the computer world.

Sony is forcing a shift away from the microsoft method of doing things and I praise them for that.

TylerDurden6215d ago

C/C++ is also an abstraction layer.

Also programming to interfaces and not implementation is a pretty strong recommendation from any CS prof. Encapsulation and reusiability are foundations of oop. But from the sounds of it you must write everything from scratch in assembly.

Shoot even programmers who write Drivers use some sort of Driver model

BIadestarX6215d ago (Edited 6215d ago )

"it's obvious that blade has NO experience programming."

I have more 12 years of working experience in software/web development.

Why oh why do I have to be taking picture and proving stuff to these kids.

"VB only abstract the programmer away" Dude I also write programs in assembly (See one of my assembly books on one of the pictures).

Stop talking about the things you don't know.

So, you are a programer... lol... what compiler do you use. What languages do you program with? I know C++, heck I started programming using GWBasic.
I even know Java... Most of my work is web development and currently working on projects using asp.net.
Did you know this website is designed using asp.net? probably C# or vb.net... are you saying this site sucks?

Let me try to lecture the ignorants...

lets start with the "vb statement you came up with".

vb.net, C# an any .net framework language compiles in a manner known as just-in-time compilation (JIT) into native code. In other words vb.net or C# generate
the same code once compiled.

Here educate yourself and learn about before you open your mouth and someone has to embarraze your with facts:

Here is a comparison chart .. take a look at C#/.net release compare to many other compilers.


Obviously C is after but look at the difference... is that worth spending a few hundred thousads in development and debuging?

Anyways.. I am including pictures of some of my books... including game programming books to prove I am a programmer.
I'm also including pictures of my computers (office at home) which is running visual studio.net 2005 and one of the books from my library (also in another picture).

I was going to take a picture of one of my pay check from my job so I can prove that I do this for a living. Then again... I think this should prove I am not making it up.
Now, that I've prove... let's see what you go. Picture please. If you can't provide evidence you are a programer as I did... it's safe to say.. you are full of it and know $h!t.
You turn.

You should listen to TylerDurden he prove better than I can how much you know.
"C/C++ is also an abstraction layer.". "Shoot even programmers who write Drivers use some sort of Driver model"

Funny... some people think that to work and to be great it must be hard and difficult.

artman6213d ago

wow you are truly programmer.... I can see almost programming books for microsoft software there... are you really a big fans of microsoft?
I know that directx is interesting for gaming, even 3D studio max support directx. oh 3D max is made for windows only.
nice :)

+ Show (7) more repliesLast reply 6213d ago
SmokeyMcBear6215d ago

**Breaking news**

**Programming the cell is hard** hehe. Well the cell is capable of so much, but there is a lot of work that needs to be put into it. Guess the trade off is how much time an effort is worth the results.

nice_cuppa6215d ago

prove the power with the games.

do you now see why there are so many cell and rsx threads.


whengeeksgobad6215d ago

all of this talk means next to nothing. No one disputes the power of the cell and everyone can dream/argue about its potential. People try to say that these sorta things drive hardware sales in a way, they do - but not the way that sony would like. All these programmers and engineers building "ps3 clusters" aren't buying RFOM to go with it. Hence, Sony takes a loss on the hardware and has no chance to recup on the software sales. The cell is great but people shouldn't take this any sort of news that this proves any dominance of one console or another.

Fart_Bubbles6215d ago

think of the two consoles as race cars, one is less powerful but easier to drive so you see the driver pull out right away

the other is way more powerful yet requires a high degree of training to handle correctly, in other words not everyone can drive this beast and often end up playing it safe.

you take a guess which one is which

closedxxx6215d ago (Edited 6215d ago )

The end of the article reads:

"In short, the Cell offers an impressive potential for performance. However, due to its architecture and limited support offered by the compiler, you can't expect to exploit this potential by just recompiling your current applications. Applications must be radically redesigned in terms of computation and data transfers. Computational bottlenecks must often be analyzed and addressed manually, and data transfers must be properly orchestrated in order to hide their latency completely under the computational delays."

Basically, unless something is built from the ground up for the Cell to process, don't expect drastic improvements over a system that has a different processor running at the same speed.

SONY went for the "Cutting Edge" factor when they decided on the Cell for the PS3, but with very little in the way of tools to efficiently program with the cell, they've left many developers hanging out to dry.

VirtualGamer6215d ago

Sony Supports Game developers not guys making breadth-first searching on graphs as fast as possible.

Xi6215d ago (Edited 6215d ago )

they did it with the ps2, toy story like renderings. And they did it with the ps3, 4d, killzone, etc. had they just said it was a little bit more powerful, and let the games speak for themselves then there wouldn't be all this rioting.

artman6215d ago

not only sony MS also talk the same for windows and 360... all companies said everything is more than reality... it's a fact.
if you own a company you will also do the same.
that's business

closedxxx6215d ago

Microsoft is using proven technology, and they have provided developers with outstanding tools to program for their platforms. SONY threw a new technology into mass production before they ever had the software experience to utilize it.

Yes, everyone hypes their technology, but that's just a numbers game.
The CELL is like nothing that most game developers have used before whereas the XBOX360 is not that far removed from a PC.

Xi6215d ago (Edited 6215d ago )

a hyperbole and hype. What sony said, is that it would render cgi, 4d, run games 2 1080p monitors at 60 fps. There's a huge difference between that, and saying that the system is the most powerful hardware released. Then there's the other part where they played "project renders" and said it was in game. People expected cgi and so far they've got 360.

right DJ and that proof is what?
the games look like 360 games.
Lair(looks bland) and uncharted look they can be done on the 360.
mgs4 can be done on the 360(kojima himself said that)
the white engine is open source and can run on other platforms
gt we haven't seen anything yet, and gthd looks the same as forza(except in the replay where they up the AA)
warhawk? you're using that as an example?
not to mention half of those games are slated for next year. Sorry DJ but you make a horrid case.

DJ6215d ago

with the Emotion Engine from PS2, as well as some amazing new features. We're already seeing proof of Cell's dominance with games like Uncharted, Ratchet, Motorstorm, Getaway, Lair, Warhawk, Gran Turismo, Metal Gear, Final Fantasy, etc.

+ Show (1) more replyLast reply 6215d ago