# 11f6643lec13 - Floyd’s Algorithm Rajendra V Boppana...

This preview shows pages 1–4. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Floyd’s Algorithm Rajendra V. Boppana Slides adapted from M.J. Quinn, Parallel Programming in C with MPI and OpenMP, McGraw Hill, 2004 CS6643 F'11 Lec13 1 Objectives •Creating 2-D arrays •Thinking about “grain size” •Point-to-point communications •Reading and printing 2-D matrices •Analyzing performance when computations and communications overlap CS6643 F'11 Lec13 2 Outline •All-pairs shortest path problem •Dynamic 2-D arrays •Parallel algorithm design •Point-to-point communication •Block row matrix I/O •Analysis and benchmarking CS6643 F'11 Lec13 3 All-pairs Shortest Path Problem CS6643 F'11 Lec13 4 A E B C D 4 6 1 3 5 3 1 2 6 3 6 4 7 10 12 6 3 7 3 10 9 5 12 2 A B C D E A B C D 4 8 1 11 E The adjacency matrix for the graph Floyd’s Algorithm CS6643 F'11 Lec13 5 for k g 0 to n-1 for i g 0 to n-1 for j g 0 to n-1 a[i,j] g min ( a[i,j] , a[i,k] + a[k,j] ) endfor endfor endfor Why It Works CS6643 F'11 Lec13 6 i k j Shortest path from i to k through 0, 1, …, k-1 Shortest path from k to j through 0, 1, …, k-1 Shortest path from i to j through 0, 1, …, k-1 Computed in previous iterations Dynamic 1-D Array Creation CS6643 F'11 Lec13 7 A Heap Run-time Stack Dynamic 2-D Array Creation CS6643 F'11 Lec13 8 Heap Run-time Stack Bstorage B Designing Parallel Algorithm •Partitioning •Communication •Agglomeration and Mapping CS6643 F'11 Lec13 9 Partitioning •Domain or functional decomposition? •Domain or functional decomposition?...
View Full Document

## This note was uploaded on 01/29/2012 for the course CS 6643 taught by Professor Staff during the Fall '08 term at The University of Texas at San Antonio- San Antonio.

### Page1 / 8

11f6643lec13 - Floyd’s Algorithm Rajendra V Boppana...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online