Professional Documents
Culture Documents
Desenvolvimento
de Sistemas
Embarcados
MultiCore
CURSO 2
Introdução a Computação Paralela
Embarrassingly Parallel Computations
Embarrassingly Parallel Computations
2
ITCS4145/5145, Capacitação
Parallel no Desenvolvimento
Programming de Sistemas
B. Wilkinson SpringEmbarcados
2009. MultiCore
Embarrassingly Parallel Computations
• Mandelbrot set
. (x, y)
P3 //Magic number
# example.ppm //File name
512 512 //Dimension (x,y in pixels)
255 //Maximum color value (0 – 65536)
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 255 255 255 0 0 0 0 0 0
………………… 0 0 0 0 0 0 0 0
//Pixel values (RGB) from left to right
GRAYSCALE FILTER
‘GRAYSCALED’ PIXEL
Sequential Code
sum = 0;
for (i = 0; i < N; i++) { /* N random samples */
xr = rand_v(x1, x2); /* generate next random value */
sum = sum + xr * xr - 3 * xr; /* compute f(xr) */
}
area = (sum / N) * (x2 - x1);