Messaging Runtime Integrating


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Messaging Runtime Integrating

  1. 1. High Performance Multi-Paradigm Messaging Runtime Integrating Grids and Multicore Systems e-Science 2007 Conference Bangalore India December 13 2007 Geoffrey Fox, Huapeng Yuan, Seung-Hee Bae Community Grids Laboratory, Indiana University Bloomington IN 47404 Xiaohong Qiu Research Computing UITS , Indiana University Bloomington IN George Chrysanthakopoulos, Henrik Frystyk Nielsen Microsoft Research, Redmond WA [email_address] ,
  2. 2. Abstract of Multicore Salsa Parallel Programming 2.0 <ul><li>eScience applications need to use distributed Grid environments where each component is an individual or cluster of multicore machines. These are expected to have 64-128 cores 5 years from now and need to support scalable parallelism. </li></ul><ul><li>Users will want to compose heterogeneous components into single jobs and run seamlessly in both distributed fashion and on a future “Grid on a chip” with different subsets of cores supporting individual components. </li></ul><ul><li>We support this with a simple programming model made up of two layers supporting traditional parallel and Grid programming paradigms (workflow) respectively. </li></ul><ul><li>We examine for a parallel clustering application, the Concurrency and Coordination Runtime CCR from Microsoft as a multi-paradigm runtime that integrates the two layers. </li></ul><ul><li>Our work uses managed code (C#) and for AMD and Intel processors shows around a factor of 5 better performance than Java. CCR has MPI pattern and dynamic threading latencies of a few microseconds that are competitive with the performance of standard MPI for C. </li></ul>
  3. 3. Some links <ul><li>See for references -- select tag oldies for venerable links; tags like MPI Applications Compiler have obvious significance </li></ul><ul><li> for recent work including publications </li></ul><ul><li>My tutorial on parallel computing </li></ul><ul><li> </li></ul>
  4. 4. Too much Computing? <ul><li>Historically both grids and parallel computing have tried to increase computing capabilities by </li></ul><ul><ul><li>Optimizing performance of codes at cost of re-usability </li></ul></ul><ul><ul><li>Exploiting all possible CPU’s such as Graphics co-processors and “ idle cycles ” (across administrative domains) </li></ul></ul><ul><ul><li>Linking central computers together such as NSF/DoE/DoD supercomputer networks without clear user requirements </li></ul></ul><ul><li>Next Crisis in technology area will be the opposite problem – commodity chips will be 32-128way parallel in 5 years time and we currently have no idea how to use them on commodity systems – especially on clients </li></ul><ul><ul><li>Only 2 releases of standard software (e.g. Office) in this time span so need solutions that can be implemented in next 3-5 years </li></ul></ul><ul><li>Intel RMS analysis : Gaming and Generalized decision support (data mining) are ways of using these cycles </li></ul>
  5. 5. Intel’s Projection
  6. 6. Too much Data to the Rescue? <ul><li>Multicore servers have clear “universal parallelism” as many users can access and use machines simultaneously </li></ul><ul><li>Maybe also need application parallelism (e.g. datamining) as needed on client machines </li></ul><ul><li>Over next years, we will be submerged of course in data deluge </li></ul><ul><ul><li>Scientific observations for e-Science </li></ul></ul><ul><ul><li>Local (video, environmental) sensors </li></ul></ul><ul><ul><li>Data fetched from Internet defining users interests </li></ul></ul><ul><li>Maybe data-mining of this “too much data” will use up the “too much computing” both for science and commodity PC’s </li></ul><ul><ul><li>PC will use this data(-mining) to be intelligent user assistant ? </li></ul></ul><ul><ul><li>Must have highly parallel algorithms </li></ul></ul>
  7. 7. Parallel Programming Model <ul><li>If multicore technology is to succeed, mere mortals must be able to build effective parallel programs on commodity machines </li></ul><ul><li>There are interesting new developments – especially the new Darpa HPCS Languages X10, Chapel and Fortress </li></ul><ul><li>However if mortals are to program the 64-256 core chips expected in 5-7 years, then we must use near term technology and we must make it easy </li></ul><ul><ul><li>This rules out radical new approaches such as new languages </li></ul></ul><ul><li>Remember that the important applications are not scientific computing but most of the algorithms needed are similar to those explored in scientific parallel computing </li></ul><ul><li>We can divide problem into two parts: </li></ul><ul><ul><li>“ Micro-parallelism”: High Performance scalable (in number of cores) parallel kernels or libraries </li></ul></ul><ul><ul><li>Macro-parallelism: Composition of kernels into complete applications </li></ul></ul><ul><li>We currently assume that the kernels of the scalable parallel algorithms/applications/libraries will be built by experts with a </li></ul><ul><li>Broader group of programmers (mere mortals ) composing library members into complete applications. </li></ul>
  8. 8. Multicore SALSA at CGL <ul><li>S ervice A ggregated L inked S equential A ctivities </li></ul><ul><li>Aims to link parallel and distributed (Grid) computing by developing parallel applications as services and not as programs or libraries </li></ul><ul><ul><li>Improve traditionally poor parallel programming development environments </li></ul></ul><ul><li>Developing set of services (library) of multicore parallel data mining algorithms </li></ul><ul><li>Looking at Intel list of algorithms (and all previous experience), we find there are two styles of “ micro-parallelism ” </li></ul><ul><ul><li>Dynamic search as in integer programming, Hidden Markov Methods (and computer chess); irregular synchronization with dynamic threads </li></ul></ul><ul><ul><li>“ MPI Style ” i.e. several threads running typically in SPMD (Single Program Multiple Data); collective synchronization of all threads together </li></ul></ul><ul><li>Most Intel RMS are “MPI Style” and very close to scientific algorithms even if applications are not science </li></ul>
  9. 9. Intel’s Application Stack
  10. 10. Scalable Parallel Components <ul><li>How do we implement micro-parallelism? </li></ul><ul><li>There are no agreed high-level programming environments for building library members that are broadly applicable. </li></ul><ul><li>However lower level approaches where experts define parallelism explicitly are available and have clear performance models. </li></ul><ul><li>These include MPI for messaging or just locks within a single shared memory. </li></ul><ul><li>There are several patterns to support here including the collective synchronization of MPI, dynamic irregular thread parallelism needed in search algorithms, and more specialized cases like discrete event simulation . </li></ul><ul><li>We use Microsoft CCR as it supports both MPI and dynamic threading style of parallelism </li></ul>
  11. 11. There is MPI style messaging and .. <ul><li>OpenMP annotation or Automatic Parallelism of existing software is practical way to use those pesky cores with existing code </li></ul><ul><ul><li>As parallelism is typically not expressed precisely, one needs luck to get good performance </li></ul></ul><ul><ul><li>Remember writing in Fortran, C, C#, Java … throws away information about parallelism </li></ul></ul><ul><li>HPCS Languages should be able to properly express parallelism but we do not know how efficient and reliable compilers will be </li></ul><ul><ul><li>High Performance Fortran failed as language expressed a subset of parallelism and compilers did not give predictable performance </li></ul></ul><ul><li>PGAS (Partitioned Global Address Space) like UPC, Co-array Fortran, Titanium, HPJava </li></ul><ul><ul><li>One decomposes application into parts and writes the code for each component but use some form of global index </li></ul></ul><ul><ul><li>Compiler generates synchronization and messaging </li></ul></ul><ul><ul><li>PGAS approach should work but has never been widely used – presumably because compilers not mature </li></ul></ul>
  12. 12. Summary of micro-parallelism <ul><li>On new applications , use MPI/locks with explicit user decomposition </li></ul><ul><li>A subset of applications can use “ data parallel ” compilers which follow in HPF footsteps </li></ul><ul><ul><li>Graphics Chips and Cell processor motivate such special compilers but not clear how many applications can be done this way </li></ul></ul><ul><li>OpenMP and/or Compiler-based Automatic Parallelism for existing codes in conventional languages </li></ul>
  13. 13. Composition of Parallel Components <ul><li>The composition (macro-parallelism) step has many excellent solutions as this does not have the same drastic synchronization and correctness constraints as one has for scalable kernels </li></ul><ul><ul><li>Unlike micro-parallelism step which has no very good solutions </li></ul></ul><ul><li>Task parallelism in languages such as C++, C#, Java and Fortran90; </li></ul><ul><li>General scripting languages like PHP Perl Python </li></ul><ul><li>Domain specific environments like Matlab and Mathematica </li></ul><ul><li>Functional Languages like MapReduce , F# </li></ul><ul><li>HeNCE, AVS and Khoros from the past and CCA from DoE </li></ul><ul><li>Web Service/Grid Workflow like Taverna, Kepler, InforSense KDE, Pipeline Pilot (from SciTegic) and the LEAD environment built at Indiana University. </li></ul><ul><li>Web solutions like Mash-ups and DSS </li></ul><ul><li>Many scientific applications use MPI for the coarse grain composition as well as fine grain parallelism but this doesn’t seem elegant </li></ul><ul><li>The new languages from Darpa’s HPCS program support task parallelism (composition of parallel components) decoupling composition and scalable parallelism will remain popular and must be supported. </li></ul>
  14. 14. Integration of Services and “MPI”/Threads <ul><li>Kernels and Composition must be supported both inside chips (the multicore problem) and between machines in clusters (the traditional parallel computing problem) or Grids. </li></ul><ul><li>The scalable parallelism (kernel) problem is typically only interesting on true parallel computers (rather than grids) as the algorithms require low communication latency. </li></ul><ul><li>However composition is similar in both parallel and distributed scenarios and it seems useful to allow the use of Grid and Web composition tools for the parallel problem. </li></ul><ul><ul><li>This should allow parallel computing to exploit large investment in service programming environments </li></ul></ul><ul><li>Thus in SALSA we express parallel kernels not as traditional libraries but as (some variant of) services so they can be used by non expert programmers </li></ul><ul><li>Bottom Line: We need a runtime that supports inter-service linkage and micro-parallelism linkage </li></ul><ul><li>CCR and DSS have this property </li></ul><ul><ul><li>Does it work and what are performance costs of the universality of runtime? </li></ul></ul><ul><ul><li>Messaging need not be explicit for large data sets inside multicore node. However still use small messages to synchronize </li></ul></ul>
  15. 15. CICC Chemical Informatics and Cyberinfrastructure Collaboratory Web Service Infrastructure Portal Services RSS Feeds User Profiles Collaboration as in Sakai Core Grid Services Service Registry Job Submission and Management Local Clusters IU Big Red, TeraGrid, Open Science Grid Quantum Chemistry OSCAR Document Analysis InChI Generation/Search Computational Chemistry (Gamess, Jaguar etc.) Need to make all this parallel
  16. 16. Deterministic Annealing for Data Mining <ul><li>We are looking at deterministic annealing algorithms because although heuristic </li></ul><ul><ul><li>They have clear scalable parallelism (e.g. use parallel BLAS ) </li></ul></ul><ul><ul><li>They avoid (some) local minima and regularize ill defined problems in an intuitively clear fashion </li></ul></ul><ul><ul><li>They are fast (no Monte Carlo) </li></ul></ul><ul><ul><li>I understand them and Google Scholar likes them </li></ul></ul><ul><li>Developed first by Durbin as Elastic Net for TSP </li></ul><ul><li>Extended by Rose (my student then; now at UCSB)) and Gurewitz (visitor to C 3 P) at Caltech for signal processing and applied later to many optimization and supervised and unsupervised learning methods. </li></ul><ul><li>See K. Rose , &quot; Deterministic Annealing for Clustering, Compression, Classification, Regression, and Related Optimization Problems ,&quot; Proceedings of the IEEE, vol. 80, pp. 2210-2239, November 1998 </li></ul>
  17. 17. High Level Theory <ul><li>Deterministic Annealing can be looked at from a Physics, Statistics and/or Information theoretic point of view </li></ul><ul><li>Consider a function (e.g. a likelihood ) L({y}) that we want to operate on (e.g. maximize ) </li></ul><ul><li>Set L  ({y  },T) =  L({y}) exp(- ({y  } - {y}) 2 /T ) d{y} </li></ul><ul><ul><li>Incorporating entropy term ensuring that one looks for most likely states at temperature T </li></ul></ul><ul><ul><li>If {y} is a distance , replacing L by L  corresponds to smearing or smoothing it over resolution  T </li></ul></ul><ul><li>Minimize Free Energy F = -Ln L  ({y  },T) rather than energy E = -Ln L ({y}) </li></ul><ul><ul><li>Use mean field approximation to avoid Monte Carlo (simulated annealing) </li></ul></ul>
  18. 18. Deterministic Annealing for Clustering I <ul><li>Illustrating similarity between clustering and Gaussian mixtures </li></ul><ul><li>Deterministic annealing for mixtures replaces by and anneals down to mixture size </li></ul>
  19. 19. Deterministic Annealing for Clustering II <ul><li>This is an extended K-means algorithm guaranteed not to diverge </li></ul><ul><li>Start with a single cluster giving as solution y 1 as centroid </li></ul><ul><li>For some annealing schedule for T, iterate above algorithm testing correlation matrix in x i about each cluster center to see if “elongated” </li></ul><ul><li>Split cluster if elongation “long enough”; splitting is a phase transition in physics view </li></ul><ul><li>You do not need to assume number of clusters but rather a final resolution  T or equivalent </li></ul><ul><li>At T=0 , uninteresting solution is N clusters; one at each point x i </li></ul>
  20. 20. <ul><li>Minimum evolving as temperature decreases </li></ul><ul><li>Movement at fixed temperature going to local minima if not initialized “correctly </li></ul>Deterministic Annealing Solve Linear Equations for each temperature Nonlinearity removed by approximating with solution at previous higher temperature F({y}, T) Configuration {y}
  21. 21. Clustering Data <ul><li>Cheminformatics was tested successfully with small datasets and compared to commercial tools </li></ul><ul><li>Cluster on properties of chemicals from high throughput screening results to chemical properties (structure, molecular weight etc.) </li></ul><ul><li>Applying to PubChem (and commercial databases) that have 6-20 million compounds </li></ul><ul><ul><li>Comparing traditional fingerprint (binary properties) with real-valued properties </li></ul></ul><ul><li>GIS uses publicly available Census data; in particular the 2000 Census aggregated in 200,000 Census Blocks covering Indiana </li></ul><ul><ul><li>100MB of data </li></ul></ul><ul><li>Initial clustering done on simple attributes given in this data </li></ul><ul><ul><li>Total population and number of Asian , Hispanic and Renters </li></ul></ul><ul><li>Working with POLIS Center at Indianapolis on clustering of SAVI ( Social Assets and Vulnerabilities Indicators ) attributes at ) for community and decision makers </li></ul><ul><ul><li>Economy, Loans, Crime, Religion etc. </li></ul></ul>
  22. 22. 30 Clusters 10 Clusters Renters Asian Hispanic Total 30 Clusters
  23. 23. In detail, different groups have different cluster centers
  24. 24. Where are we? <ul><li>We have deterministically annealed clustering running well on 8-core (2-processor quad core) Intel systems using C# and Microsoft Robotics Studio CCR/DSS </li></ul><ul><li>Could also run on multicore-based parallel machines but didn’t do this (is there a large Windows quad core cluster on TeraGrid?) </li></ul><ul><ul><li>This would also be efficient on large problems </li></ul></ul><ul><li>Applied to Geographical Information Systems (GIS) and census data </li></ul><ul><ul><li>Could be an interesting application on future broadly deployed PC’s </li></ul></ul><ul><ul><li>Visualize nicely on Google Maps (and presumably Microsoft Virtual Earth) </li></ul></ul><ul><li>Applied to several Cheminformatics problems and have parallel efficiency but visualization harder as in 150-1024 (or more) dimensions </li></ul><ul><li>Will develop a family of such parallel annealing data-mining tools where basic approach known for </li></ul><ul><ul><li>Clustering </li></ul></ul><ul><ul><li>Gaussian Mixtures (Expectation Maximization) </li></ul></ul><ul><ul><li>and possibly Hidden Markov Methods </li></ul></ul>
  25. 25. Microsoft CCR <ul><li>Supports exchange of messages between threads using named ports </li></ul><ul><li>Fewer more general primitives than MPI </li></ul><ul><li>FromHandler: Spawn threads without reading ports </li></ul><ul><li>Receive: Each handler reads one item from a single port </li></ul><ul><li>MultipleItemReceive: Each handler reads a prescribed number of items of a given type from a given port. Note items in a port can be general structures but all must have same type. </li></ul><ul><li>MultiplePortReceive: Each handler reads a one item of a given type from multiple ports. </li></ul><ul><li>JoinedReceive: Each handler reads one item from each of two ports. The items can be of different type. </li></ul><ul><li>Choice: Execute a choice of two or more port-handler pairings </li></ul><ul><li>Interleave: Consists of a set of arbiters (port -- handler pairs) of 3 types that are Concurrent, Exclusive or Teardown (called at end for clean up). Concurrent arbiters are run concurrently but exclusive handlers are </li></ul><ul><li> </li></ul>
  26. 26. Preliminary Results <ul><li>Parallel Deterministic Annealing Clustering in C# with speed-up of 7 on Intel 2 quadcore systems </li></ul><ul><li>Analysis of performance of Java, C, C# in MPI and dynamic threading with XP, Vista, Windows Server, Fedora, Redhat on Intel/AMD systems </li></ul><ul><li>Study of cache effects coming with MPI thread-based parallelism </li></ul><ul><li>Study of execution time fluctuations in Windows (limiting speed-up to 7 not 8!) </li></ul>
  27. 27. Parallel Multicore Deterministic Annealing Clustering Parallel Overhead on 8 Threads Intel 8b Speedup = 8/(1+Overhead) 10000/(Grain Size n = points per core) Overhead = Constant1 + Constant2 / n Constant1 = 0.05 to 0.1 (Client Windows) due to thread runtime fluctuations 10 Clusters 20 Clusters
  28. 28. Parallel Multicore Deterministic Annealing Clustering “ Constant1” Increasing number of clusters decreases communication/memory bandwidth overheads Parallel Overhead for large (2M points) Indiana Census clustering on 8 Threads Intel 8b This fluctuating overhead due to 5-10% runtime fluctuations between threads
  29. 29. Parallel Multicore Deterministic Annealing Clustering “ Constant1” Increasing number of clusters decreases communication/memory bandwidth overheads Parallel Overhead for subset of PubChem clustering on 8 Threads (Intel 8b) The fluctuating overhead is reduced to 2% ( as bits not doubles ) 40,000 points with 1052 binary properties (Census is 2 real valued properties)
  30. 30. Intel 8-core C# with 80 Clusters: Vista Run Time Fluctuations for Clustering Kernel <ul><li>2 Quadcore Processors </li></ul><ul><li>This is average of standard deviation of run time of the 8 threads between messaging synchronization points </li></ul>Number of Threads Standard Deviation/Run Time
  31. 31. Intel 8 core with 80 Clusters: Redhat Run Time Fluctuations for Clustering Kernel <ul><li>This is average of standard deviation of run time of the 8 threads between messaging synchronization points </li></ul>Number of Threads Standard Deviation/Run Time
  32. 32. Basic Performance of CCR
  33. 33. MPI Exchange Latency in µs (20-30 µs computation between messaging) Machine OS Runtime Grains Parallelism MPI Exchange Latency Intel8c:gf12 (8 core 2.33 Ghz) (in 2 chips) Redhat MPJE (Java) Process 8 181 MPICH2 (C) Process 8 40.0 MPICH2: Fast Process 8 39.3 Nemesis Process 8 4.21 Intel8c:gf20 (8 core 2.33 Ghz) Fedora MPJE Process 8 157 mpiJava Process 8 111 MPICH2 Process 8 64.2 Intel8b (8 core 2.66 Ghz) Vista MPJE Process 8 170 Fedora MPJE Process 8 142 Fedora mpiJava Process 8 100 Vista CCR (C#) Thread 8 20.2 AMD4 (4 core 2.19 Ghz) XP MPJE Process 4 185 Redhat MPJE Process 4 152 mpiJava Process 4 99.4 MPICH2 Process 4 39.3 XP CCR Thread 4 16.3 Intel4 (4 core 2.8 Ghz) XP CCR Thread 4 25.8
  34. 34. CCR Overhead for a computation of 23.76 µs between messaging Rendez vous Intel8b: 8 Core Number of Parallel Computations (μs) 1 2 3 4 7 8 Spawned Pipeline 1.58 2.44 3 2.94 4.5 5.06 Shift 2.42 3.2 3.38 5.26 5.14 Two Shifts 4.94 5.9 6.84 14.32 19.44 MPI Pipeline 2.48 3.96 4.52 5.78 6.82 7.18 Shift 4.46 6.42 5.86 10.86 11.74 Exchange As Two Shifts 7.4 11.64 14.16 31.86 35.62 Exchange 6.94 11.22 13.3 18.78 20.16
  35. 35. Cache Line Interference
  36. 36. Cache Line Interference <ul><li>Early implementations of our clustering algorithm showed large fluctuations due to the cache line interference effect discussed here and on next slide in a simple case </li></ul><ul><li>We have one thread on each core each calculating a sum of same complexity storing result in a common array A with different cores using different array locations </li></ul><ul><li>Thread i stores sum in A(i) is separation 1 – no variable access interference but cache line interference </li></ul><ul><li>Thread i stores sum in A(X*i) is separation X </li></ul><ul><li>Serious degradation if X < 8 (64 bytes) with Windows </li></ul><ul><ul><li>Note A is a double (8 bytes) </li></ul></ul><ul><ul><li>Less interference effect with Linux – especially Red Hat </li></ul></ul>
  37. 37. Cache Line Interference <ul><li>Note measurements at a separation X of 8 (and values between 8 and 1024 not shown) are essentially identical </li></ul><ul><li>Measurements at 7 (not shown) are higher than that at 8 (except for Red Hat which shows essentially no enhancement at X<8) </li></ul><ul><li>If effects due to co-location of thread variables in a 64 byte cache line, the array must be aligned with cache boundaries </li></ul><ul><ul><li>In early implementations we found poor X=8 performance expected in words of A split across cache lines </li></ul></ul>
  38. 38. DSS Section <ul><li>We view system as a collection of services – in this case </li></ul><ul><ul><li>One to supply data </li></ul></ul><ul><ul><li>One to run parallel clustering </li></ul></ul><ul><ul><li>One to visualize results – in this by spawning a Google maps browser </li></ul></ul><ul><ul><li>Note we are clustering Indiana census data </li></ul></ul><ul><li>DSS is convenient as built on CCR </li></ul>
  39. 39. Timing of HP Opteron Multicore as a function of number of simultaneous two-way service messages processed (November 2006 DSS Release) <ul><li>Measurements of Axis 2 shows about 500 microseconds – DSS is 10 times better </li></ul>DSS Service Measurements