1 / 9

Master/Workers Model Example

Master/Workers Model Example. Research Computing UNC - Chapel Hill Instructor: Mark Reed Email : markreed@unc.edu. Master/Workers Model. Often embarrassingly parallel Master: decomposes the problem into small tasks distributes to workers

isla
Download Presentation

Master/Workers Model Example

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Master/Workers Model Example Research Computing UNC - Chapel Hill Instructor: Mark Reed Email: markreed@unc.edu

  2. Master/Workers Model • Often embarrassingly parallel • Master: • decomposes the problem into small tasks • distributes to workers • gathers partial results to produce the final result • Workers: • work • pass results back to master • request more work (optional) • Mapping/Load Balancing • Static • Dynamic Master worker worker worker worker

  3. Master/Workers Load Balance • Iterations may have different and unpredictable run times • Systematic variance • Algorithmic variance • Goal is to balance load balance and overhead Some Schemes • Block decomposition, static chunking • Round Robin decomposition • Self scheduling • assign one iteration at a time • Guided dynamic self-scheduling • Assign 1/P of the remaining iterations (P = # procs)

  4. Bag of Tasks • embarrassingly parallel • master/workers model • Comes up in context of: • parameter studies, sweep • Monte Carlo • need parallel random numbers, e.g. SPRNG • image processing

  5. An Illustrative Example • a master list with a set of tasks • a list of filenames to read • each task can be done independently • read file which has one line, an index and a text string • master process gathers all the results and assembles them • order text based on index and print result • assemble jumbled text into coherent poem

  6. sample input %more poem.masterlist poem.100.dat poem.101.dat poem.102.dat poem.103.dat poem.104.dat poem.105.dat poem.106.dat poem.107.dat poem.108.dat ... %more poem.*.dat :::::::::::::: poem.100.dat :::::::::::::: 77 the :::::::::::::: poem.101.dat :::::::::::::: 76 that :::::::::::::: poem.102.dat :::::::::::::: 75 for

  7. workerbee.c • See code

  8. Results The Road Not Taken Two roads diverged in a yellow wood,And sorry I could not travel bothAnd be one traveler, long I stoodAnd looked down one as far as I couldTo where it bent in the undergrowth;Then took the other, as just as fair,And having perhaps the better claimBecause it was grassy and wanted wear,Though as for that the passing thereHad worn them really about the same,

  9. Results And both that morning equally layIn leaves no step had trodden black.Oh, I marked the first for another day!Yet knowing how way leads on to wayI doubted if I should ever come back.I shall be telling this with a sighSomewhere ages and ages hence:Two roads diverged in a wood, and I,I took the one less traveled by,And that has made all the difference. Robert Frost

More Related