MPI and MapReduce CCGSC 2010 Flat Rock NC September 8 - - PowerPoint PPT Presentation

mpi and mapreduce
SMART_READER_LITE
LIVE PREVIEW

MPI and MapReduce CCGSC 2010 Flat Rock NC September 8 - - PowerPoint PPT Presentation

MPI and MapReduce CCGSC 2010 Flat Rock NC September 8 2010 Geoffrey Fox gcf@indiana.edu h.p://www.infomall.org


slide-1
SLIDE 1

MPI ¡and ¡MapReduce ¡

CCGSC ¡2010 ¡Flat ¡Rock ¡NC ¡ September ¡8 ¡2010 ¡ Geoffrey Fox

gcf@indiana.edu ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡h.p://www.infomall.org ¡ ¡ ¡ ¡h.p://www.futuregrid.org ¡ ¡ ¡

Director, Digital Science Center, Pervasive Technology Institute Associate Dean for Research and Graduate Studies, School of Informatics and Computing Indiana University Bloomington ¡

slide-2
SLIDE 2

MapReduce ¡

  • Implementa;ons ¡(Hadoop ¡– ¡Java; ¡Dryad ¡– ¡Windows) ¡support: ¡

– SpliHng ¡of ¡data ¡with ¡customized ¡file ¡systems ¡ – Passing ¡the ¡output ¡of ¡map ¡func;ons ¡to ¡reduce ¡func;ons ¡ – Sor;ng ¡the ¡inputs ¡to ¡the ¡reduce ¡func;on ¡based ¡on ¡the ¡intermediate ¡ keys ¡ – Quality ¡of ¡service ¡

  • 20 ¡petabytes ¡per ¡day ¡(on ¡an ¡average ¡of ¡400 ¡machines) ¡processed ¡

by ¡Google ¡using ¡MapReduce ¡September ¡2007 ¡

Map(Key, ¡Value) ¡ ¡ ¡ Reduce(Key, ¡List<Value>) ¡ ¡ ¡ Data ¡Partitions Reduce ¡Outputs A ¡hash ¡function ¡maps ¡ the ¡results ¡of ¡the ¡map ¡ tasks ¡to ¡reduce ¡tasks ¡

slide-3
SLIDE 3

MapReduce ¡“File/Data ¡Repository” ¡Parallelism ¡

Instruments Disks Map1 ¡ Map2 ¡ Map3 ¡ Reduce ¡ Communication Map ¡ ¡ ¡ ¡ ¡ ¡= ¡(data ¡parallel) ¡computa;on ¡reading ¡and ¡wri;ng ¡data ¡ Reduce ¡= ¡Collec;ve/Consolida;on ¡phase ¡e.g. ¡forming ¡mul;ple ¡ global ¡sums ¡as ¡in ¡histogram ¡ Portals ¡ /Users ¡

MPI ¡or ¡IteraNve ¡MapReduce ¡

Map ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Reduce ¡ ¡ ¡ ¡ ¡ ¡Map ¡ ¡ ¡ ¡ ¡ ¡ ¡Reduce ¡ ¡ ¡ ¡ ¡Map ¡ ¡ ¡ ¡

slide-4
SLIDE 4

Typical ¡ApplicaNon ¡Challenge: ¡

DNA ¡Sequencing ¡Pipeline ¡

Illumina/Solexa ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Roche/454 ¡Life ¡Sciences ¡ ¡ ¡ ¡ ¡Applied ¡Biosystems/SOLiD ¡

Modern ¡Commercial ¡Gene ¡Sequencers ¡

Internet ¡

Read ¡ Alignment ¡

Visualization Blocking Sequence Alignment/ Assembly MDS Dissimilarity Matrix N(N-1)/2 values FASTA File N Sequences block Pairings Pairwise clustering

MapReduce ¡ MPI ¡

Linear ¡Algebra ¡or ¡ExpectaNon ¡MaximizaNon ¡based ¡data ¡mining ¡poor ¡

  • n ¡MapReduce ¡– ¡equivalent ¡to ¡using ¡MPI ¡wri;ng ¡messages ¡to ¡disk ¡and ¡

restar;ng ¡processes ¡each ¡step/itera;on ¡of ¡algorithm ¡

slide-5
SLIDE 5

Metagenomics ¡ This ¡visualizes ¡results ¡of ¡ dimension ¡reduc;on ¡to ¡ 3D ¡of ¡30000 ¡gene ¡ sequences ¡from ¡an ¡ environmental ¡sample. ¡ The ¡many ¡different ¡ genes ¡are ¡classified ¡by ¡ clustering ¡algorithm ¡and ¡ visualized ¡by ¡MDS ¡ dimension ¡reduc;on ¡

slide-6
SLIDE 6

All-­‑Pairs ¡Using ¡MPI ¡or ¡DryadLINQ ¡

0 ¡ 5000 ¡ 10000 ¡ 15000 ¡ 20000 ¡ 35339 ¡ 50000 ¡ DryadLINQ ¡ MPI ¡

Calculate ¡ ¡Pairwise ¡Distances ¡(Smith ¡Waterman ¡Gotoh) ¡

125 ¡million ¡distances ¡ 4 ¡hours ¡& ¡46 ¡minutes ¡

  • Calculate ¡pairwise ¡distances ¡for ¡a ¡collec;on ¡of ¡genes ¡(used ¡for ¡clustering, ¡MDS) ¡
  • Fine ¡grained ¡tasks ¡in ¡MPI ¡
  • Coarse ¡grained ¡tasks ¡in ¡DryadLINQ ¡
  • Performed ¡on ¡768 ¡cores ¡(Tempest ¡Cluster) ¡

MoreH, ¡C., ¡Bui, ¡H., ¡Hollingsworth, ¡K., ¡Rich, ¡B., ¡Flynn, ¡P., ¡& ¡Thain, ¡D. ¡(2009). ¡All-­‑Pairs: ¡An ¡Abstrac;on ¡for ¡Data ¡Intensive ¡Compu;ng ¡on ¡ Campus ¡Grids. ¡IEEE ¡Transac*ons ¡on ¡Parallel ¡and ¡Distributed ¡Systems ¡, ¡21, ¡21-­‑36. ¡

slide-7
SLIDE 7

Smith ¡Waterman ¡ ¡ MPI ¡DryadLINQ ¡Hadoop ¡

0.000 ¡ 0.005 ¡ 0.010 ¡ 0.015 ¡ 0.020 ¡ 0.025 ¡ 10000 ¡ 20000 ¡ 30000 ¡ 40000 ¡

Time ¡ ¡per ¡Actual ¡CalculaNon ¡(ms) ¡

  • No. ¡of ¡Sequences ¡

Hadoop ¡SW-­‑G ¡ MPI ¡SW-­‑G ¡ DryadLINQ ¡SW-­‑G ¡

Hadoop ¡is ¡Java; ¡MPI ¡and ¡Dryad ¡are ¡C# ¡

slide-8
SLIDE 8

Twister(MapReduce++) ¡

  • Streaming ¡based ¡communica;on ¡
  • Intermediate ¡results ¡are ¡directly ¡

transferred ¡from ¡the ¡map ¡tasks ¡to ¡the ¡ reduce ¡tasks ¡– ¡eliminates ¡local ¡files ¡

  • Cacheable ¡map/reduce ¡tasks ¡
  • Sta;c ¡data ¡remains ¡in ¡memory ¡
  • Combine ¡phase ¡to ¡combine ¡reduc;ons ¡
  • User ¡Program ¡is ¡the ¡composer ¡of ¡

MapReduce ¡computa;ons ¡

  • Extends ¡the ¡MapReduce ¡model ¡to ¡

iteraNve ¡computaNons ¡ Data ¡Split ¡ D

MR ¡ Driver ¡ User ¡ Program ¡

Pub/Sub ¡Broker ¡Network ¡ D File ¡System ¡ Worker ¡Nodes ¡ M D ¡ Map ¡Worker ¡ Reduce ¡Worker ¡ MRDeamon ¡ Data ¡Read/Write ¡ CommunicaNon ¡ Reduce ¡(Key, ¡List<Value>) ¡ ¡ Iterate ¡ Map(Key, ¡Value) ¡ ¡ ¡ Combine ¡(Key, ¡List<Value>) ¡ User ¡ Program ¡ Close() ¡ Configure() ¡ StaNc ¡ data ¡ δ ¡flow ¡ Different ¡synchronizaNon ¡and ¡intercommunicaNon ¡ mechanisms ¡used ¡by ¡the ¡parallel ¡runNmes ¡

slide-9
SLIDE 9

IteraNve ¡and ¡non-­‑IteraNve ¡ComputaNons ¡

K-­‑means ¡ Performance ¡of ¡K-­‑Means ¡ Smith ¡Waterman ¡is ¡a ¡non ¡iteraNve ¡ case ¡and ¡of ¡course ¡runs ¡fine ¡

slide-10
SLIDE 10

Matrix ¡Mul;plica;on ¡64 ¡cores ¡

Square ¡blocks ¡ ¡ ¡ ¡ ¡ ¡ ¡ Twister ¡ Row/Col ¡decomp ¡ Twister ¡ Square ¡blocks ¡ ¡ ¡ OpenMPI ¡

slide-11
SLIDE 11

Performance of Pagerank using ClueWeb Data (Time for 20 iterations) using 32 nodes (256 CPU cores) of Crevasse

slide-12
SLIDE 12

Fault ¡Tolerance ¡and ¡MapReduce ¡

  • MPI ¡does ¡“maps” ¡followed ¡by ¡“communica;on” ¡including ¡

“reduce” ¡but ¡does ¡this ¡itera;vely ¡

  • There ¡must ¡(for ¡most ¡communica;on ¡pa.erns ¡of ¡interest) ¡be ¡

a ¡strict ¡synchroniza;on ¡at ¡end ¡of ¡each ¡communica;on ¡phase ¡

– Thus ¡if ¡a ¡process ¡fails ¡then ¡everything ¡grinds ¡to ¡a ¡halt ¡

  • In ¡MapReduce, ¡all ¡Map ¡processes ¡and ¡all ¡reduce ¡processes ¡

are ¡independent ¡and ¡stateless ¡and ¡read ¡and ¡write ¡to ¡disks ¡

– As ¡1 ¡or ¡2 ¡(reduce+map) ¡itera;ons, ¡no ¡difficult ¡synchroniza;on ¡ issues ¡

  • Thus ¡failures ¡can ¡easily ¡be ¡recovered ¡by ¡rerunning ¡process ¡

without ¡other ¡jobs ¡hanging ¡around ¡wai;ng ¡

  • Re-­‑examine ¡MPI ¡fault ¡tolerance ¡in ¡light ¡of ¡MapReduce ¡

– Relevant ¡for ¡Exascale? ¡

  • Re-­‑examine ¡MapReduce ¡in ¡light ¡of ¡MPI ¡experience ¡….. ¡
slide-13
SLIDE 13

MPI ¡& ¡Itera;ve ¡MapReduce ¡papers ¡

  • MapReduce ¡on ¡MPI ¡Torsten ¡Hoefler, ¡Andrew ¡Lumsdaine ¡and ¡Jack ¡Dongarra, ¡Towards ¡

Efficient ¡MapReduce ¡Using ¡MPI, ¡Recent ¡Advances ¡in ¡Parallel ¡Virtual ¡Machine ¡and ¡ Message ¡Passing ¡Interface ¡Lecture ¡Notes ¡in ¡Computer ¡Science, ¡2009, ¡Volume ¡ 5759/2009, ¡240-­‑249 ¡

  • MPI ¡with ¡generalized ¡MapReduce ¡
  • Jaliya ¡Ekanayake, ¡Hui ¡Li, ¡Bingjing ¡Zhang, ¡Thilina ¡Gunarathne, ¡Seung-­‑Hee ¡Bae, ¡Judy ¡Qiu, ¡

Geoffrey ¡Fox ¡Twister: ¡A ¡Run;me ¡for ¡Itera;ve ¡MapReduce, ¡Proceedings ¡of ¡the ¡First ¡ Interna*onal ¡Workshop ¡on ¡MapReduce ¡and ¡its ¡Applica*ons ¡of ¡ ¡ACM ¡HPDC ¡2010 ¡ conference, ¡Chicago, ¡Illinois, ¡June ¡20-­‑25, ¡2010 ¡ h.p://grids.ucs.indiana.edu/ptliupages/publica;ons/twister__hpdc_mapreduce.pdf ¡ ¡ ¡ h.p://www.itera;vemapreduce.org/ ¡

  • Grzegorz ¡Malewicz, ¡Ma.hew ¡H. ¡Austern, ¡Aart ¡J. ¡C. ¡Bik, ¡James ¡C. ¡Dehnert, ¡Ilan ¡Horn, ¡

Naty ¡Leiser, ¡and ¡Grzegorz ¡Czajkowski ¡Pregel: ¡A ¡System ¡for ¡Large-­‑Scale ¡Graph ¡Processing, ¡ Proceedings ¡of ¡the ¡2010 ¡interna*onal ¡conference ¡on ¡Management ¡of ¡data ¡ ¡Indianapolis, ¡ Indiana, ¡USA ¡Pages: ¡135-­‑146 ¡2010 ¡

  • Yingyi ¡Bu, ¡Bill ¡Howe, ¡Magdalena ¡Balazinska, ¡Michael ¡D. ¡Ernst ¡HaLoop: ¡Efficient ¡Itera;ve ¡

Data ¡Processing ¡on ¡Large ¡Clusters, ¡Proceedings ¡of ¡the ¡VLDB ¡Endowment, ¡Vol. ¡3, ¡No. ¡1, ¡ The ¡36th ¡Interna*onal ¡Conference ¡on ¡Very ¡Large ¡Data ¡Bases, ¡September ¡1317, ¡2010, ¡

  • Singapore. ¡
  • Matei ¡Zaharia, ¡Mosharaf ¡Chowdhury, ¡Michael ¡J. ¡Franklin, ¡Sco. ¡Shenker, ¡Ion ¡Stoica ¡

Spark: ¡Cluster ¡Compu;ng ¡with ¡Working ¡Sets ¡poster ¡at ¡ h.p://radlab.cs.berkeley.edu/w/upload/9/9c/Spark-­‑retreat-­‑poster-­‑s10.pdf ¡ ¡ ¡

slide-14
SLIDE 14

AzureMapReduce ¡

slide-15
SLIDE 15

Scaled ¡Timing ¡with ¡ ¡ Azure/Amazon ¡MapReduce ¡

1000 ¡ 1100 ¡ 1200 ¡ 1300 ¡ 1400 ¡ 1500 ¡ 1600 ¡ 1700 ¡ 1800 ¡ 1900 ¡ Time ¡(s) ¡ Number ¡of ¡Cores ¡* ¡Number ¡of ¡files ¡

Cap3 ¡Sequence ¡Assembly ¡

Azure ¡MapReduce ¡ Amazon ¡EMR ¡ Hadoop ¡Bare ¡Metal ¡ Hadoop ¡on ¡EC2 ¡

slide-16
SLIDE 16

Cap3 ¡Cost ¡

0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ 16 ¡ 18 ¡ 64 ¡* ¡ ¡ ¡ 1024 ¡ 96 ¡* ¡ ¡ ¡ 1536 ¡ 128 ¡* ¡ 2048 ¡ 160 ¡* ¡ 2560 ¡ 192 ¡* ¡ 3072 ¡ Cost ¡($) ¡

  • Num. ¡Cores ¡* ¡Num. ¡Files ¡

Azure ¡MapReduce ¡ Amazon ¡EMR ¡ Hadoop ¡on ¡EC2 ¡

slide-17
SLIDE 17

Smith ¡Waterman: ¡“Scaled ¡Speedup” ¡Timing ¡

0 ¡ 500 ¡ 1000 ¡ 1500 ¡ 2000 ¡ 2500 ¡ 3000 ¡ Adjusted ¡Time ¡(s) ¡

  • Num. ¡of ¡Cores ¡* ¡Num. ¡of ¡Blocks ¡

Azure ¡MR ¡ Amazon ¡EMR ¡ Hadoop ¡on ¡EC2 ¡ Hadoop ¡on ¡Bare ¡Metal ¡

slide-18
SLIDE 18

Smith ¡Waterman: ¡daily ¡effect ¡

1000 ¡ 1100 ¡ 1200 ¡ 1300 ¡ 1400 ¡ 1500 ¡ 1600 ¡ 1700 ¡

Time ¡(s) ¡

EMR ¡ Azure ¡MR ¡ Azure ¡MR ¡Adj. ¡

slide-19
SLIDE 19

SWG ¡ ¡Cost ¡

0 ¡ 5 ¡ 10 ¡ 15 ¡ 20 ¡ 25 ¡ 30 ¡ 64 ¡* ¡1024 ¡ 96 ¡* ¡1536 ¡ 128 ¡* ¡2048 ¡160 ¡* ¡2560 ¡192 ¡* ¡3072 ¡ Cost ¡($) ¡

  • Num. ¡Cores ¡* ¡Num. ¡Blocks ¡

AzureMR ¡ Amazon ¡EMR ¡ Hadoop ¡on ¡EC2 ¡

slide-20
SLIDE 20

TwisterMPIReduce ¡

  • Run;me ¡package ¡suppor;ng ¡subset ¡of ¡MPI ¡

mapped ¡to ¡Twister ¡

  • Set-­‑up, ¡Barrier, ¡Broadcast, ¡Reduce ¡

TwisterMPIReduce

PairwiseClustering ¡ ¡ MPI MulN ¡Dimensional ¡ Scaling ¡MPI GeneraNve ¡ Topographic ¡Mapping ¡ MPI Other ¡…

Azure ¡Twister ¡(C# ¡C++) ¡Java ¡Twister Microsom ¡Azure FutureGrid Local ¡ Cluster Amazon ¡ EC2

slide-21
SLIDE 21

Some ¡Issues ¡with ¡AzureTwister ¡ and ¡AzureMapReduce ¡

  • Transpor;ng ¡data ¡to ¡Azure: ¡Blobs ¡(HTTP), ¡Drives ¡

(GridFTP ¡etc.), ¡Fedex ¡disks ¡

  • Intermediate ¡data ¡Transfer: ¡Blobs ¡(current ¡choice) ¡

versus ¡Drives ¡(should ¡be ¡faster ¡but ¡don’t ¡seem ¡to ¡be) ¡

  • Azure ¡Table ¡v ¡Azure ¡SQL: ¡Handle ¡all ¡metadata ¡
  • Messaging ¡Queues: ¡Use ¡real ¡publish-­‑subscribe ¡system ¡

in ¡place ¡of ¡Azure ¡Queues ¡to ¡get ¡scaling ¡(?) ¡with ¡mul;ple ¡ brokers ¡– ¡especially ¡AzureTwister ¡

  • Azure ¡Affinity ¡Groups: ¡Could ¡allow ¡be.er ¡data-­‑compute ¡

and ¡compute-­‑compute ¡affinity ¡

slide-22
SLIDE 22

Research ¡Issues ¡

  • Clouds ¡are ¡suitable ¡for ¡“Loosely ¡coupled” ¡data ¡parallel ¡applica;ons ¡
  • “Map ¡Only” ¡(really ¡pleasingly ¡parallel) ¡certainly ¡run ¡well ¡on ¡clouds ¡

(subject ¡to ¡data ¡affinity) ¡with ¡many ¡programming ¡paradigms ¡

  • Parallel ¡FFT ¡and ¡adap;ve ¡mesh ¡PDE ¡solver ¡very ¡bad ¡on ¡MapReduce ¡

but ¡suitable ¡for ¡classic ¡MPI ¡engines. ¡ ¡

  • MapReduce ¡is ¡more ¡dynamic ¡and ¡fault ¡tolerant ¡than ¡MPI; ¡it ¡is ¡

simpler ¡and ¡easier ¡to ¡use ¡

  • Is ¡there ¡an ¡intermediate ¡class ¡of ¡problems ¡for ¡which ¡Itera;ve ¡

MapReduce ¡useful? ¡

– Long ¡running ¡processes? ¡ – Mutable ¡data ¡small ¡in ¡size ¡compared ¡to ¡fixed ¡data(base)? ¡ – Only ¡support ¡reduc;ons? ¡ – Is ¡it ¡really ¡different ¡from ¡a ¡fault ¡tolerant ¡MPI? ¡ – Mul;core ¡implementa;on ¡ – Link ¡to ¡HDFS ¡or ¡equivalent ¡data ¡parallel ¡file ¡system ¡ – Will ¡AzureTwister ¡run ¡sa;sfactorily? ¡

slide-23
SLIDE 23

FutureGrid ¡in ¡a ¡ ¡Nutshell ¡

  • FutureGrid ¡provides ¡a ¡testbed ¡with ¡a ¡wide ¡variety ¡of ¡compu;ng ¡

services ¡to ¡its ¡users ¡

– Suppor;ng ¡users ¡developing ¡new ¡applica;ons ¡and ¡new ¡middleware ¡ using ¡Cloud, ¡Grid ¡and ¡Parallel ¡compu;ng ¡(Hypervisors ¡– ¡Xen, ¡KVM, ¡ ScaleMP, ¡Linux, ¡Windows, ¡Nimbus, ¡Eucalyptus, ¡Hadoop, ¡Globus, ¡ Unicore, ¡MPI, ¡OpenMP ¡…) ¡ ¡ – So|ware ¡supported ¡by ¡FutureGrid ¡or ¡users ¡ – ~5000 ¡dedicated ¡cores ¡distributed ¡across ¡country ¡

  • The ¡FutureGrid ¡testbed ¡provides ¡to ¡its ¡users: ¡

– A ¡rich ¡development ¡and ¡tes;ng ¡pla~orm ¡for ¡middleware ¡and ¡applica;on ¡ users ¡looking ¡at ¡interoperability, ¡func;onality ¡and ¡performance ¡ ¡ – A ¡rich ¡educa;on ¡and ¡teaching ¡pla~orm ¡for ¡advanced ¡cyberinfrastructure ¡ classes ¡

  • Each ¡use ¡of ¡FutureGrid ¡is ¡an ¡experiment ¡that ¡is ¡reproducible ¡
  • Cloud ¡infrastructure ¡supports ¡loading ¡of ¡general ¡images ¡on ¡

Hypervisors ¡like ¡Xen; ¡FutureGrid ¡dynamically ¡provisions ¡so|ware ¡ as ¡needed ¡onto ¡“bare-­‑metal” ¡using ¡Moab/xCAT ¡based ¡ environment ¡

slide-24
SLIDE 24

FutureGrid: ¡a ¡Grid/Cloud ¡ Testbed ¡

  • OperaNonal: ¡IU ¡Cray ¡opera;onal; ¡ ¡ ¡ ¡IU ¡, ¡UCSD, ¡UF ¡& ¡UC ¡IBM ¡iDataPlex ¡opera;onal ¡
  • Network, ¡NID ¡opera;onal ¡
  • TACC ¡Dell ¡running ¡acceptance ¡tests ¡– ¡ready ¡~September ¡15 ¡

NID: ¡Network ¡

Impairment ¡Device ¡

Private ¡ Public ¡ FG ¡Network ¡

slide-25
SLIDE 25

FutureGrid ¡Dynamic ¡ Provisioning ¡Results ¡

0:00:00 ¡ 0:00:43 ¡ 0:01:26 ¡ 0:02:10 ¡ 0:02:53 ¡ 0:03:36 ¡ 0:04:19 ¡ 4 ¡ 8 ¡ 16 ¡ 32 ¡

Total ¡Provisioning ¡Time ¡minutes ¡

Time ¡

Time ¡elapsed ¡between ¡reques;ng ¡a ¡job ¡and ¡the ¡jobs ¡reported ¡start ¡ ;me ¡on ¡the ¡provisioned ¡node. ¡The ¡numbers ¡here ¡are ¡an ¡average ¡of ¡2 ¡ sets ¡of ¡experiments. ¡ Time ¡minutes ¡ Number ¡of ¡nodes ¡

slide-26
SLIDE 26

200 ¡papers ¡submi.ed ¡to ¡main ¡track; ¡4 ¡days ¡of ¡tutorials ¡