Developer Data Modeling Mistakes: From Postgres to NoSQL
Programming the PS3
1. Programming with Linux on the
Playstation3
FOSDEM 2008
olivier.grisel@ensta.org
Architecture overview:
introducing the Cell BE
Installing Linux
SIMD programming in C/C++
Asynchronous data transfer with
the DMA
2. Who am I
Java / Python developer at Nuxeo (FOSS document
management server)
Interested in Artificial Intelligence (and need fast
Support Vector Machines)
Slides to be published at:
http://oliviergrisel.name
5. PS3 Clusters
Cheap cluster for
academic researchers
Carolina State U. and
U. Massachusetts at D.
8+1 cluster with ssh and
MPI
6. PS3 GRID Computing
PS3GRID project
based on BOINC
30,000 atoms simulation
Folding@Home
1 PFLOPS with 800
TFLOPS from PS3s
BlueGene == 280
TFLOPS
7. Linux on the PS3
Lv1 Hypervisor shipped with the default firmware
Partition utility in the Sony Game OS menu
Choose your favorite distro:
Install a powerpc64smp or ps3 kernel
Install gccspu + libspe2
8. Programming the Cell/BE in C
Program the PPE as a chief conductor to spread the
numerical code to SPEs
Use POSIX threads to start SPE subroutines in
parallel
Use SPE intrinsics to perform vector instructions
Eliminate branches as much as possible in SPE code
Align your data to 16 bytes
9. Introduction to SIMD programming
128 bits registers (SSE2, Altivec, SPE)
2 x double
4 x float
4 x int
introduce new vector types
1 vector float operation == 4 float operations
logical (and, or, cmp, ...), arithmetic (+, *, abs, ...),
shuffling
18. Doublebuffering with MFC
1. SPU queues MFC GET to fill buffer #1
2. SPU queues MFC GET to fill buffer #2
3. SPU waits for buffer #1 to finish filling
4. SPU processes buffer #1
5. SPU queues MFC PUT back content of buffer #1
6. SPU queues MFC GETB to refill buffer #1
7. SPU waits for buffer #2 to finish filling
8. SPU processes buffer #2 (...)
19. Some resources
Cell BE Programming Tutorial (ibm.com 190 pages)
IBM developerworks short programming tutorials
Search for articles by Jonathan Barlett
Barcelona Supercomputing Center (software)
http://www.bsc.es/projects/deepcomputing/linuxoncell/
PS3 programming workshops (videos)
http://www.cc.gatech.edu/~bader/CellProgramming.html
#ps3dev on freenode
20. Thanks, credits, licensing
Most schemas from excellent GFDL 'd tutorial by
Geoff Levand (Sony Corp)
http://www.kernel.org/pub/linux/kernel/people/geoff/cell
Pictures and trade marks belong to their respective
owners (Sony, IBM, Universities, Folding@Home,
PS3GRID, ...)
All remaining work is GFDL