Archive for the ‘Uncategorized’ Category

The attack of the parallel app!

Posted: January 19, 2011 in Uncategorized

Intro

In the past decades, traditional silicon-based “sequential” computers have reached the limits of the physics. Since the early 80s until almost a decade ago, the main trend in performance improvement was to increase the clock speed and shrink the size of the elemental transistor. New processors families came often with higher and higher core frequencies and smaller process sizes.
As you may know, the CMOS transistor technology (the one used in most of today’s electronics) is well known for consuming power when switching from one logic state to the opposite. This power is spread in the form of heat. So at 3,8 GHz it became too difficult to keep those micro-hells cool inexpensively.

Besides, at higher frequencies the period decreases, what means that the length of the trace that an electric pulse can travel shortens. This leads to problems where two functional units are too far from each other (inside the chip) and some sort of latch between them has to be placed in order to keep them working at that frequency.

Finally, Intel cancelled their plans to produce a 4 Ghz Pentium 4 in favor of dual-cores.

Today, processors and other computing devices are improved by adding parallel processing units, but this concept is not new at all. In the 70s the first multiprocessor machines began to appear at selected universities and in the 80s the equipment and tools for parallel computing became much more mature and supercomputing companies such as CRAY appeared. During the 90s and the 00s their computing power and electric power consumption grew exponentially.

However, CPUs are not the only parallel processors you can find. Graphics cards (even the oldest fixed-function GPUs) have always had an inherently parallel architecture due to the fact that many graphics computations and other stuff needed for rendering a frame can be carried out in parallel (for example, the 3DFX Vodoo2 had 2 parallel texturing units back in 1998).

Now graphic cards can be programmed in several ways. The first programmable cards allowed the user to replace certain stages of the graphics pipeline such as the rasterization with their own programs (i.e shaders) running on the GPU in parallel with the CPU.

People wanting to use the GPU for general non-graphics purposes those days used to encode the data into textures, run a shader in the GPU and get back the results embedded into another texture. The development of a hardware and software architecture for allowing the execution of general purpose programs on the GPU was just a matter of time and today we can do so with technologies like CUDA and OpenCL. This is called General Purpose computation on Graphics Processing Units, or GPGPU.

Now, most of the largest supercomputers rated at the top 500 (which is now headed by the chinese GPGPU-based Tianhe-1A with 2.57 petaflops/s) are leveraging this technologies that provide tons of computing power with lower electric power consumption than traditional systems.

Saving lives massively

There’s a wide range of problems that unless aided by a supercomputer would not be viable to solve. But… where do I begin searching?

You might be asking yourself: In which kind of problems are the biggest supercomputers being used?

Supercomputer usage (November '10)Take a look at the graph (Top500 supercomputers usage for November ’10), you’ll see a big fat “Not Specified” piece of the pie. I’m not sure what it means but I guess it must be military or government undisclosed projects, or perhaps secret industrial commercially-aimed applications.

The next biggest field of application is research. This makes sense as pharmaceutics and universities make extensive use of them. As you can see, supercomputer applications range in nature from Aerospace to Finance.

Let’s take a look at the paper “

Simulation and modeling of synuclein-based “protofibril”structures: as a means of understanding the molecular basis of Parkinson’s disease“.

 

In a nutshell, the researchers at the University of California–San Diego conducted a study to determine how the alpha-synuclein (which are unknown-function proteins) aggregate and are bound to membranes thus eventually preventing normal cell functions that are associated with Parkinson’s disease.

These membrane-binding surfaces can be treated with pharmaceutical intervention for dissolution.

 

For their purpose, they used molecular modeling and simulation techniques to guess the folding pathway of the protein into structures that bind to membranes.

 

 

They first developed a program called MAPAS to assess how strongly the protein interacts with the membrane.

 

 

Then they ran a set of Molecular Dynamics on the IBM BlueGene. This basically gave the membrane regions with more binding probability.

 

 

With this data they performed more Molecular simulation on that regions to simulate the binding process.

 

 

As they say in the paper, the results of the MAPAS program matched already known results in a test problem.

 

 

In mi opinion, the BlueGene isn’t actually better suited for this applications than others out there but I guess that it was more accessible for the researchers since it was conceived for biomolecular research and because of geographical proximity (California).

 

This project took 1.2 million processor hours.

What’s next?

Turns out that the parallel paradigm is already and is going to be the future trend. So learning this technologies is worth it, but this of course doesn’t come for free. Parallel applications are harder to write and debug than sequential ones. The programmer must face new difficulties like race conditions which lead to synchronization problems which, in turn, might end up with dead-locks or incorrect results if not watched closely.

Another important aspect of parallelism for performance is how a global problem is split down into smaller ones which can be solved individually by different processing elements and then put back together to compute the final result. This is, of course, absolutely problem (and machine)-dependent and might not be an easy, yet important, task. Once again “a good programmer must know the machine he’s programming for“.

The medium-term goal is reaching 1 Exaflop processing power and it looks feasible that computer technology changes once more in the meanwhile. The Moore’s law, which held true for decades is no longer applicable for transistors. However it can be extrapolated to processors.



As a matter of fact technology is continuously and quickly evolving. Who knows where it will lead us to in the future!

The good old demoscene

Posted: January 16, 2011 in Uncategorized

The last week I was assigned some homework for a subject called Advanced Rendering.

What I have to do is find a tunnel effect from the demo scene that I like and comment it.

Well, after watching TONS of demos, some of them as old as 1994, which required a bit of black sorcery such as Dosbox or Wine. A lot of great stuff came across, like this state-of-the-art metaballs tunnel featuring equipotential surfaces and advanced lighting.

This is kickass stuff, but since we were asked to avoid repeating the same demo and this is highly findable I wanted to dig (a lot) deeper into the demoscene.

During my journey I watched a lot of impressive old school stuff for that era such as pixel shading in the Amiga or Full Scene Post Processing FX in early 1998.

But none of them were really catching my eye until I found We Cell, by Kewlers (2004). Here’s the video:

The demo itself is brilliant for that era, but let’s go to the tunnel part at 1:03

It might look like some sort of polygonal mesh, but it isn’t. Unlike classic tunnel effects, everything you see is made of 2D sprites.

The walls of the tunnel are basically cleverly positioned sprites. Their brightness and size decreases with their distance to the camera. The lighting here looks static.

There’s also a Depth Of Field effect which plays with a Gaussian Blur depending on the distance of each sprite to the camera. As we ride the tunnel we see little spheres that approach the camera. These are also sprites.

If you download the demo and open de “data” subdirectory there you’ll find all the sprites as JPG files. They’re not dynamically generated.

All trough the tunnel we can see a HUD with some text at the top left corner and some sort of irregular frame wrapping the scene (the HUD can be also seen in the “data” dir). Along with the HUD, a bunch of translucent cells ascending or falling can also be seen in the left half of the screen as well.

Both the HUD, bubbles and camera are sequenced and animated with the music, what gives a live organic and rich environment worth watching.

Even more impressive is the fact that they used NO SHADERS at all! so everything must be software computed. I guess that CPU-intensive effects like the DOF (Depth Of Field) must be written in raw assembler as usual in the demoscene.

I had run the demo a couple of times to see if the tunnel shape is dynamically generated or it’s already precomputed and it looks like it’s dynamic.

There’s another tunnel at 4:25 but it uses the very same tricks and techniques.

Here’s the info about the demo:

Release date: August 2004

Party: Assembly 2004

Platform: Windows

Exe size: 5.5 Mb (download link at scene.org)

I have no info about the graphics API or the Workflow tools used here, but it looks like pure C/ASM + OpenGL.

Now let’s talk about this demo and its creators:

Kewlers was a finnish-based demogroup. Their legacy, their slogan “Kewlers doesn’t suck at all”, and their productions marked an era of newschool productions with oldschool soul.

We cell is a demo presented to the Assembly ’04 that got the fifth position. Kewlers did never win the first price in any of the four Assembly parties they participated in with productions such as Variform, we cell, 1995 and “a significant deformation near the cranium”. But they got 6 scene.org awards in 3 different years. None of them for “we cell” which was nominated for 4 categories: Best demo, Best effects, Best soundtrack and Public choice.

In a world of pixel shaders, Curly Brace, the main coder wanted to innovate by making a great production without using those new hardware possibilities that everyone was then using. He archieved magnificent scenes without a polygon or a shader (just sprites, particles, and software effects).

In the other hand we have the music of Little Bitchard, one of the most versatile and prolific musicians of the recent story.

Kewlers brought the best of the oldschool to newschool, the code innovation, simplicity and direct impact.

Unfortunately after their following great demo, 1995, in 2006 they quitted the demoscene.

Last active members:

– Actor Doblan (musician, graphic artist)

– Albert Huffman (coder)

– Curly Brace (coder, 3D artist)

– DashNo (graphic artist)

– Fred Funk (musician, graphic artist)

– Little Bitchard (musician)

– Math Daemon (coder)

– Mel Funktion (musician)

– Scootr Lovr (coder, 3D artist)

(sources: escena.org, wikipedia)

I remember the old times when I used to watch demos on my 486DX2@66Mhz !!

Welcome to PixelClock !

Posted: January 16, 2011 in Uncategorized, Welcome

Hi everybody,

Welcome to my blog. Here you will find some information about me and my work as well as my personal projects and (hopefully) interesting news about the always exciting world of Computer Graphics and hardware.

A bit about me:

My name’s Miguel Angel Exposito (Mike for short :-D). I’m a computer engineer from Spain. I’m primarily interested in computer graphics, real-time graphics applications, simulation, videogame development, and graphics or gaming-realated hardware.

My interest in CG comes from the fact that the field has experienced an impressive evolution towards photorealism in the past few years and I’d like to be a part of it. Besides it’s a highly dynamic and challenging sector which involves cutting-edge technology.

My background covers computer science, computer graphics and digital electronics. I have strong working C/C++ skills but I’m very familiar with many other different languages and environments such as Java, PHP, ActionScript (2.0/3.0), various assemblers and some others in Windows, Linux or OSX systems. I’m also familiar with parallel programming and optimization for efficiency.

I also know quite a bit about hardware design and prototyping (VHDL/Verilog, FPGAs, PCB design and manufacturing, microcontrollers (mostly PICs), etc.) and I have as well designed and built a bunch of different gadgets such an oven timer, a frame-buffer graphics processor, a Bluetooth 32-button gamepad or a homemade video-game console/media center (work in progress…) and worked on several hardware/software projects.

I think that a good programmer must really know the machine he’s programming for.

I’m fluent in OpenGL and familiar with the OpenSceneGraph middleware for real-time visualization and other libraries, languages and tools for simulation such as GLSL, VRJuggler, or OpenDynamics Engine.

I had worked for 4 years at LSyM (the Laboratory for Simulation and Modeling) at the University of Valencia (Spain) where I had been involved on several commercial products like the Tower Crane training simulator, the Backhoe simulator, a couple of web-based training simulators and had fully designed and built custom data acquisition hardware (that I used for my degree thesis (in spanish)). While working there I had also done a bit of research on computer-based education and co-authored a couple of papers:

“A Web Browser-Based 3D Simulation architecture for education and training” (CSEDU’10)

“Building of a Motion feedback Roller Coaster Simulator: A case Study” (ISC’10)

(You can either search for them or I can post links if anyone is interested, just let me know)

For the last project I had the opportunity to work with an electro-hydraulic Stewart motion platform and a full-featured C.A.V.E system that I helped to assemble and for which I wrote some software.

I’m familiar with the Cell processor (the heart of the PlayStation 3 system). When I was studying my degree I made an extensive report of its architecture and wrote a couple of parallel applications leveraging the hardware capabilities. This motivated the creation of the PlayStation 3 computing cluster at the University of Valencia as you can see in this lab assignment (if you speak Spanish – Section “Agradecimientos”).

I find video game consoles and their hardware architecture especially interesting so I have contributed to the scene of various platforms like the Sega Genesis (MegaDrive in Europe and Japan) or the PSP for which I ported the OpenThreads library and a portion of the OpenSceneGraph library with the open source toolchain. I’m also interested in emulation and dynamic recompilation of machine code.

In such a competitive world like CG is, it’s very important to stay up-to-date so books like GPU Gems or Game programming Gems are always on my shelf and sites like GameDev, NeHe or Gamasutra are always sitting at my favorites list. I keep an eye on the latest SIGGRAPH publications as well.

I have very extensive knowledge about the Adobe Flash technology with several projects in my portfolio. Right now I’m using Flash along with Scaleform to produce a Hi-Quality UI for a game I’m working on as part of my Masters degree.

I consider myself a self-taught and curious guy who’s always investigating and learning something new. I just can’t stop learning.

I have the TOEFL certification and good reading/writing/speaking/listening skills. I enjoy watching my favorite movies and TV shows in their original version which is usually American English. I also speak Spanish as my mother language and Valencian.

My other hobbies are playing electric guitar rock style, swimming, traveling and reading. I also enjoy hanging around with my friends.

I’ve just finished my Master’s  degree in Computer Graphics, Games and Virtual Reality at URJC (Madrid, Spain) where I learned state-of-the-art technologies such as CUDA and CG.

I’d love to end up working for a big company, maybe abroad….