CUDA

CUDA is cheap, easily programed, rapidly developed parallel computing.

If you were plowing a field, which would you rather use?Two strong oxen or 1024 chickens?
Seymour Cray

Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.
Maimonides

Coding

I learn by doing.

I learn a new computer language by editing existing stuff

Practice puts brains in your muscles.
Sam Snead

Coding Mechanics

Mechanics are important

You need to learn to use appropriate tools.

Linux is the appropriate OS for Sci Comp

http://www.top500.org/lists/2014/06/

http://www.bbc.com/news/10187248

My tools are very last century,

A text editor.  I use gedit.

A compiler

Make and a makefile

Fancy tools are built on top of these basic tools

In theory there is no difference between theory and practice. In practice there is.
Yogi Berra

Editors

gedit is simple and is on almost every linux box in the world.

Make

make is on every linux box on the world

All you do is type make

It executes commands in a MakeFile

We will wind up having to write tiny makefiles.

Everything Should Be Made as Simple as Possible, But Not Simpler
Einstein

Updates and Different GPUs

The machines in this room are supposed to be indentical

They are not

Instead of being annoyed

I am thinking of this as enabling GPU comparisons.

SIMD and SIMT

The Invidia folks insist that CUDA is SIMT.  However

If a machine quacks like SIMD and waddles like SIMD, it’s SIMD. 
John Shadid

I know how to make 4 horses pull a cart - I don' t know how to make 1024 chickens do it.
Enrico Clementi

Monte Carlo Simulation

A long time ago. Buffon’s needle problem was proposed as a way to measure π.  
http://en.wikipedia.org/wiki/Buffon’s_needle

The real technique for real problems called MC Simulation is traditionally 
introduced by throwing darts at a quarter circular board.

This MC technique consumes vast amounts of random numbers

we are going to work on this problem

There are 3 rules to follow when parallelizing large codes. Unfortunately, no one knows what these rules are.
 W. Somerset Maugham, Gary Montry

Monte Carlo Simulation: Mathematica Code

n=14;
sample=RandomReal[{0,1},{n,2}];
ListPlot[
sample,
Prolog->{Pink,Disk[{0,0},1]},
PlotRange->{{0,1},{0,1}},
AspectRatio->Automatic,
Frame->True,
PlotLabel->S[sample,Norm[#]<1&]
]

Map[Floor,
Map[Norm,sample]
]