Image Processing A case study for a domain decomposed MPI code - - PowerPoint PPT Presentation

image processing
SMART_READER_LITE
LIVE PREVIEW

Image Processing A case study for a domain decomposed MPI code - - PowerPoint PPT Presentation

Image Processing A case study for a domain decomposed MPI code Domain Decomposition 1 Starting with a big array: 2 Domain Decomposition 2 Split it into pieces: 3 Domain Decomposition 3 Assign pieces to processors: 4 Domain


slide-1
SLIDE 1

Image Processing

A case study for a domain decomposed MPI code

slide-2
SLIDE 2

Domain Decomposition 1

  • Starting with a big array:

2

slide-3
SLIDE 3

Domain Decomposition 2

  • Split it into pieces:

3

slide-4
SLIDE 4

Domain Decomposition 3

  • Assign pieces to processors:

4

slide-5
SLIDE 5

Domain Decomposition 4

  • Use Halos to deal with interactions

5

slide-6
SLIDE 6

Edge detection / image reconstruction

6

hundreds of iterations single pass

slide-7
SLIDE 7

Edge detection

  • Compare pixel to its four nearest neighbours
  • pixel values are from 0 (black) to 255 (white)
  • Pad 2D arrays with halos
  • in serial code, halo values set to white (i.e. 255)

7

edgei, j =imagei+1, j +image

1, j+1 +imagei-1, j +imagei, j-1 -4 imagei, j

slide-8
SLIDE 8

Image reconstruction

  • Jacobi Solver to undo the simple edge detection algorithm

(a five-point stencil)

  • simple example of discretised partial differential equation with

nearest-neighbour interactions

  • actually solving
  • Repeat many times
  • in parallel, must update halo values from neighbours every iteration

8

newi, j = 1 4

  • ldi+1, j +old1, j+1 +oldi-1, j +oldi, j-1 -edgei, j

( )

Ñ2image = edge

slide-9
SLIDE 9

Domain Decomposition

  • Different choices in C and Fortran

9

slide-10
SLIDE 10

The case study

  • I provide you with:
  • More detailed printed instruction
  • Tar-ball (Choice of C or Fortran)
  • Input routine
  • Output routine
  • Couple of input files
  • Tasks
  • Write a serial code (with halos for fixed boundary conditions)
  • check that the serial code works!!
  • Distribute the work onto the processors; separate reconstructions
  • Get the halos exchanged; single reconstruction, identical to serial
  • Further suggestions on the instruction sheet

10