parallel boxes jam
play

Parallel Boxes & Jam Jose Rodriguez Rotem David Robert Tolda - PowerPoint PPT Presentation

Parallel Boxes & Jam Jose Rodriguez Rotem David Robert Tolda Hahn Chong Fred Clark Jr. PB & J Introduction Language for Distributed Computing (2+ processors) Useful for Parallelism Amdahls Law : speedup = 1/(1-P)


  1. Parallel Boxes & Jam Jose Rodriguez Rotem David Robert Tolda Hahn Chong Fred Clark Jr.

  2. PB & J Introduction ● Language for Distributed Computing (2+ processors) ● Useful for Parallelism •Amdahl’s Law : speedup = 1/(1-P) where P is fraction of code that can be run in parallel •speedup = 1/((P/N)+S) where N is number of processors and S is the serial fraction ● Useful for Fault Tolerant Execution – Critical Applications

  3. Team Progress Feature vs Module ● Feature ● Implement in all files ● Create Tests ● Merge into Master (GitHub)

  4. PB & J Library ● Data Types ○ Long, Double, Boolean, String ○ Map, Array ● 2 Functions make this language unique ○ Spread ○ Jam

  5. Arrays and Maps ● For maximizing the potential to solve distributed problems. ● Useful for distributing jobs and retrieving their results.

  6. Jam and Spread master(map slaves, array args){ ... Runtime argument. ... array result <- jam: spread: factor( @searchStarts , n, |slaves|); print("Result: " ~ result); } array factor(array starts, long n, long slaves) { ... }

  7. Prime Factorization master(map slaves, array args){ ... Runtime argument. long n <- args[0]; array searchStarts; ... get the place for each slave to start long iterations <- (n / |slaves|) - 1; ... size of slaves long start <- 1; for(long m <- 0; m < |slaves|; m <- m + 1) { searchStarts[m] <- start + (m * 2); } ... spread the starting points to the slaves array result <- jam: spread: factor(@searchStarts, n, |slaves|); print("Result: " ~ result); }

  8. Prime Factorization array factor(array starts, long n, long slaves) { long start <- starts[0]; array factors; for(long i <- start; i <= n / 2; i <- i + (2 * slaves)) { print("Trying " ~ i); if( i > 1 && n % i = 0) { ...it is not prime factors[|factors|] <- i; } } if(|factors| > 0) { -> factors; } -> null; }

  9. PB & J Code Generation

  10. PB&J Execution ● Running on Slaves ○ java -jar PBJ.jar -slave [port] ● Running on Master ○ java -jar PBJ.jar slave_ip[:port];ip2;ip3... args

  11. Lessons & Advice ● Make sure everyone knows how to use version control ● Meet regularly and work consistently ● Don’t try to put too much in your language

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend