This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full 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 2D arrays •Thinking about “grain size” •Pointtopoint communications •Reading and printing 2D matrices •Analyzing performance when computations and communications overlap CS6643 F'11 Lec13 2 Outline •Allpairs shortest path problem •Dynamic 2D arrays •Parallel algorithm design •Pointtopoint communication •Block row matrix I/O •Analysis and benchmarking CS6643 F'11 Lec13 3 Allpairs 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 n1 for i g 0 to n1 for j g 0 to n1 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, …, k1 Shortest path from k to j through 0, 1, …, k1 Shortest path from i to j through 0, 1, …, k1 Computed in previous iterations Dynamic 1D Array Creation CS6643 F'11 Lec13 7 A Heap Runtime Stack Dynamic 2D Array Creation CS6643 F'11 Lec13 8 Heap Runtime 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.
 Fall '08
 STAFF

Click to edit the document details