Download presentation
Presentation is loading. Please wait.
1
1 Short Course on Grid Computing Jornadas Chilenas de Computación 2010 INFONOR-CHILE 2010 November 15th - 19th, 2010 Antofagasta, Chile Dr. Barry Wilkinson University of North Carolina Charlotte Oct 13, 2010 © Jeremy Villalobos/Barry Wilkinson Session 4 UNC-Charlotte’s Grid Computing “Seeds” framework 1
2
2 Acknowledgement The following slides based upon materials provided by Jeremy Villalobos, PhD student Department of Computer Science, University of North Carolina at Charlotte. and describes his Grid computing framework called Seeds.
3
Overview Running Parallel Applications on the Grid The Seeds Framework Skeletons and Patterns 3
4
Opportunities in Running Parallel Application on The Grid Aggregate multiple computer clusters to work on the same problem and Solve problems faster Or solve bigger problem Reduce electricity use Or postpone future equipment acquisition 4
5
Challenges in Running Parallel Application on The Grid Heterogeneity Connectivity Security Programmability Performance (Scalability) 5
6
A Distributed Environment 6
7
MPI and OpenMP OpenMP (Shared Memory) Easy to program High performance Does not scale MPI (Distributed Memory) Hard to program High performance Can scale 7
8
Seeds Framework Overview Specifications Deployment Network Creation Communication 8
9
Seeds Specifications Topology: Network Overlay/Hybrid Network Connectivity: Direct, Through NAT, and Shared memory Programming Style: Skeleton/Pattern Based Parallel Memory Management: Message- passing with use of shared memory if available Self-deployment: Using Java Cog Kit and Globus Load-balancing: expected on the patterns 9
10
Seeds Development Layers Basic Intended for programmers that have basic parallel computing background Based on Skeletons and patterns Advanced: Used to add or extend functionality like: Create new patterns Optimize existing patterns or Adapt existing pattern to non-functional requirements specific to the application Expert: Used to provide basic services: Deployment Security Communication/Connectivity Changes in the environment 10
11
Deployment Scheduling Deployment in Globus – Use of Globus GSIFTP to transfer the “seed” folder – Use of GRAM to submit the job to run the seed nodes – Network creation starts Deployment in SSH also possible 11
12
Network Creation Determine the network environment: NAT, WAN, NAT-UPNP Determine GridNode Leader (DirectorRDV) Idle waiting for patterns 12
13
Communication Direct (regular socket) Indirect NAT server NAT client NAT server and client Shared Memory 13
14
Skeletons and Patterns Skeletons/Patterns are recurring parallel algorithms that have been simplified to a general form that can be applied to solve problems from different computer science fields 14
15
Skeletons Skeletons are: Functional programming constructs, Stateless Data-parallel Resemble trees 15
16
Pattens Patterns are: State-full, Synchronous loop-parallel Also data-parallel 16
17
Skeletons/Patterns A dvantages Implicit parallelization Avoid deadlocks Avoid race conditions Reduction in code size [3] Abstracts the Grid/Cloud environment Disadvantages Takes away some of the freedom from the user programmer New approach to learn Performance told (5% for skeletons on top of MPI [PASM]) 17
18
Interfaces 18
19
Seed Skeletons/ Patterns 19
20
Areas of Research Adding extensions to improve patterns and skeletons programming approach Adding automatic scalability to pattern/skeletons Automatically adjust to processors available Automatic grain size How the heterogeneous environment affect load- balancing How to educate future skeleton/pattern programmers (think parallel) Impact of skeleton/patterns on popular algorithm 20
21
Related Work Research projects in Skeletons/Patterns Lithium/Muskel[1][2] CO 2 P 3 S[3] PASM[4] eSkels[5] SkeTo[6] Triana[7] In Industry MapReduce (Google)[8] Threaded Building Blocks (TBB)( Intel)[9] 21
22
References M. Aldinucci, M. Danelutto, and P. Teti, “An advanced environment supporting structured parallel programming in Java,” Future Generation Computer Systems, vol. 19, 2003, pp. 611-626. M. Aldinucci, M. Danelutto, and P. Dazzi, “MUSKEL: An expandable Skeleton Environment,” Scalable Computing: Practice and Experience, Vol. 8, Number 4, pp. 325–341. http://calvados.di.unipi.it/storage/paper_files/2007_SCPE_muskel.pdf S.M. S. Bromling, “Pattern-Based Parallel Programming,” Int. Conference on Parallel Processing - ICPP 2002, Aug. 2002. http://www.cs.uiuc.edu/homes/snir/PPP/skeleton/cops.pdf Goswami D, Singh A, and Preiss B. R, “From Design Patterns to Parallel Architectural Skeletons,” Journal of Parallel and Distributed Computing - JPDC 2002. http://www.brpreiss.com/papers/published/2002/jpdc/paper.pdf M. Cole, “Bringing skeletons out of the closet: a pragmatic manifesto for skeletal parallel programming,” Parallel Computing, vol. 30, 2004, pp. 389-406. K. Matsuzaki, H. Iwasaki, K. Emoto, and Z. Hu, “A library of constructive skeletons for sequential style of parallel programming,” Proceedings of the 1st international conference on Scalable information systems - InfoScale '06, Hong Kong: 2006, pp. 13-es. M.C. Gomes, O.F. Rana, and J.C. Cunha, “Pattern operators for grid environments,” Sci. Program., vol. 11, 2003, pp. 237-261. J. Dean and S. Ghemawat, “MapReduce,” Communications of the ACM, vol. 51, 2008, p. 107. “TBB Home,” http://www.threadingbuildingblocks.org/, Apr. 2010. 22
23
Hands-on session Deploy a Seeds workpool skeleton to compute using Monte Carlo method – all code given. Just local computer used for this session although remote computers could be used. Needs Seeds installed. For session, will also need Java, ant, and Eclipse installed First prepared ant script used to deploy workpool Then Eclipse IDE used to run same program Later Eclipse example for numerical integration - code partially given. Will need to fill in missing parts. 23
24
24 Basis on Monte Carlo calculations is use of random selections In this case, circle formed with a square Points within square chosen randomly Fraction of points within circle = /4 calculation
25
25 Can limit calculation to one quadrant and get same result Actually computes an integral
26
26 Code Initial part package edu.uncc.grid.example.workpool; import java.util.Random; import java.util.logging.Level; import edu.uncc.grid.pgaf.datamodules.Data; import edu.uncc.grid.pgaf.datamodules.DataMap; import edu.uncc.grid.pgaf.interfaces.basic.Workpool; import edu.uncc.grid.pgaf.p2p.Node; public class MonteCarloPiModule extends Workpool { private static final long serialVersionUID = 1L; private static final int DoubleDataSize = 1000; double total; int random_samples; Random R; public MonteCarloPiModule() { R = new Random(); } @Override public void initializeModule(String[] args) { total = 0; // reduce verbosity for logging information Node.getLog().setLevel(Level.WARNING); // set number of random samples random_samples = 3000; }
27
27 Compute method public Data Compute(Data data) { // input gets the data produced by DiffuseData() DataMap input = (DataMap )data; // output will emit the partial answers done by this method DataMap output = new DataMap (); Long seed = (Long) input.get("seed"); // get random seed Random r = new Random(); r.setSeed(seed); Long inside = 0L; for (int i = 0; i < DoubleDataSize ; i++) { double x = r.nextDouble(); double y = r.nextDouble(); double dist = x * x + y * y; if (dist <= 1.0) { ++inside;// = 1L; } output.put("inside", inside);// store partial answer to return //to GatherData() return output; }
28
Diffuse and gather methods public Data DiffuseData(int segment) { DataMap d =new DataMap (); d.put("seed", R.nextLong()); return d; // returns a random seed for each job unit } public void GatherData(int segment, Data dat) { DataMap out = (DataMap ) dat; Long inside = (Long) out.get("inside"); total += inside; // aggregate answer from all the worker nodes. } public double getPi() { // returns value of pi based on the job done by all the workers double pi = (total / (random_samples * DoubleDataSize)) * 4; return pi; } public int getDataCount() { return random_samples; } 28
29
Running example using ant script Get prepared package PiApprox.zip Contains everything needed: Seeds P code Numerical integration code Run ant script Will compile all software and run PiApprox program 29
30
Using Eclipse Advantage of using the ant script first is everything is deployed (seed folder, etc.) 30
31
Questions 31
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.