N 0n int for upperdiag in 1n do forall diagpos in

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: sequence alignment algorithm, but it illustrates an important parallel paradiagm: wavefront computaIon CSEP 524: Parallel ComputaIon Winter 2013: Chamberlain *Source of running example: Wikipedia 71 Smith- Waterman Naïve Task- Parallel Approach: proc computeH(i,j) { if (i==0 || j == 0) then return 0; else var h1, h2, h3: int; begin h1 = computeH(i-1, j-1); begin h2 = computeH(i-1, j); begin h3 = computeH(i, j-1); Note: Recomputes most subexpressions redundantly This is a case for dynamic programming! return f(h1,h2,h3); } CSEP 524: Parallel ComputaIon Winter 2013: Chamberlain 72 Smith- Waterman Dynamic Programming Approach: 0 1 2 3 4 5 6 7 8 0 0 0 0 0 0 0 0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 CSEP 524: Parallel ComputaIon Winter 2013: C...
View Full Document

Ask a homework question - tutors are online