f2f computing an introduction
play

F2F Computing An Introduction Ulrich Norbisrath Teooriapevad Plvas - PowerPoint PPT Presentation

F2F Computing An Introduction Ulrich Norbisrath Teooriapevad Plvas 2008/01/26 Ulrich Norbisrath (http://ulno.net) F2F Computing An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 1/15 Outline Anecdote


  1. F2F Computing – An Introduction Ulrich Norbisrath Teooriapäevad Põlvas 2008/01/26 Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 1/15

  2. Outline ● Anecdote – final computations ● The Grid yesterday – small history ● The Grid today – some new approaches ● The Grid tomorrow – F2F Computing ● Demo – how you should not compute Pi ● F2F Computing 2.0 (F2F2) – the future of F2F Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 2/15

  3. Final Computations ● Student must do final computations for deadline – (of course to late, evening before) ● Big computational task (needs about 100 hours computation time, i.e. rendering) ● What to do now? Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 3/15

  4. The Grid Yesterday A Small History ● One computer -> Supercomputer ● Supercomputer -> Cluster Computer ● Cluster computer -> Grid – Networked clusters and single computers – Managed – Sophisticated security model ● However: Administrative effort enormous for users and system administrators Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 4/15

  5. The Grid Today ● Moving to webservices – Ease for users: better documentation, debugging – Ease for administrators: better compatibility ● Desktop Grids BOINC (SETI@home at.al.), MiG – Ease for users: very much (no effort at all) (MiG: zero size install, just web-browser) – Ease for administrators: nearly no ease Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 5/15

  6. The Grid Tomorrow – The Frid ● How can we set up a Grid spontaneously without effort? – no effort for administrators – no effort for users ● How can it be as easy as making a conference chat in Skype or other Instant messaging (IM) programs? ● Answer: combine social networks from IM with peer-to-peer (P2P) -> Friend to Friend -> Frid Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 6/15

  7. The structure, we find today MSN, Jabber (Googletalk), STUN Yahoo, ICQ, AOL, [Skype] 1.2.1.34 NAT 1.2.2.56 192.168.4.1 NAT 192.168.2.1 WLAN 192.168.4.10 192.168.4.11 192.168.2.99 1.2.3.45 F2F Client F2F Client F2F Client F2F Client Ulrich Jenn Eero Ilja Jabber MSN Jabber Jabber MSN Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 7/15

  8. F2F Computing Architecture SIP Communicator F2FComputing GUI plugin F2F applications Application GUI (multi-protocol chat) layer F2FComputing API F2FCore Computation Job layer Peer Task Communication SIP Communicator TCP UDP (Skype) (JXTA) (IPv6) layer Instant Messaging IPv4 IPv4 Stun MSN YAHOO ICQ AOL Jabber (Skype) Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 8/15

  9. F2F Application Development Concepts Job * is cre a te d by * 1 1 Pe e r knows consists of * * * 1 runs in * is frie nd T a sk * Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 9/15

  10. Monte Carlo Pi (don't try this at home)  ● depicted area is 4 1 ● choose uniformly distributed random points ● compute average and multiply with 4 8/10 * 4 = 3.2 ● do this >>10 times ● 3.1415926... 1 Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 10/15

  11. Demo Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 11/15

  12. Master (1/2) public class PiMasterTask extends Task { public void runTask() { this.getJob().submitTasks( "ee.ut.f2f.examples.pi.PiSlaveTask", this.getJob().getPeers().size(), this.getJob().getPeers()); Collection<String> taskIDs = this.getJob().getTaskIDs(); // TaskIDs // Get Proxies Collection<TaskProxy> slaveProxies = new ArrayList<TaskProxy>(); for (String taskID: taskIDs) { if (taskID == this.getTaskID()) continue; // not mastertask TaskProxy proxy = this.getTaskProxy(taskID); if (proxy != null) slaveProxies.add(proxy); } Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 12/15

  13. Master (2/2) long intervalms = 2000L; // compute interval long maxpoints = 1000000000L; // total points to compute AtomicLongVector received = new AtomicLongVector( 0, 0 ); for (TaskProxy proxy: slaveProxies) { // Send intervaltime proxy.sendMessage(new Long(intervalms)); } while (received.getUnSyncTotal() < maxpoints) { Thread.sleep(100); for (TaskProxy proxy: slaveProxies) { // check proxies while (proxy.hasMessage()) { AtomicLongVector receivedvector = (AtomicLongVector) proxy.receiveMessage(); received.add( receivedvector ); } } } F2FDebug.println("The computed Pi is : " + received.getUnSyncPositive() * 4.0 / received.getUnSyncTotal()); } } Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 13/15

  14. Slave public class PiSlaveTask extends Task { AtomicLongVector computedPoints = new AtomicLongVector (0,0); MersenneTwisterRNG random = new MersenneTwisterRNG(); public void runTask() { TaskProxy masterProxy = this.getTaskProxy(this.getJob().getMasterTaskID()); long intervalms = ( (Long)masterProxy.receiveMessage() ).longValue(); // Start a thread which computes the points ComputePoints compTask = new ComputePoints (); compTask.start(); while (true) { // Send the computed points back to the master Long stopcondition = (Long) masterProxy.receiveMessage( intervalms ); if ( stopcondition != null ) if ( stopcondition.longValue() == 0 ) break; masterProxy.sendMessage( computedPoints ); computedPoints.set(0, 0); } //reset } private class ComputePoints extends Thread { public void run() { double x = random.nextDouble(); double y = random.nextDouble(); if( x*x + y*y < 1.0 ) // check if in circle computedPoints.positiveHit(); else computedPoints.negativeHit(); } } } Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 14/15

  15. F2F Computing 2.0 (F2F2) ● In communication layer – UDP hole punching – Skype adapter ● Real P2P applications (not only embarassingly parallel) – MPI layer – Network topology – F2F2F – Correspoding security/trust concept ● Adapters to classic Grids Ulrich Norbisrath (http://ulno.net) F2F Computing – An Introduction 2008/01/24 University of Tartu http://f2f.ulno.net 15/15

Recommend


More recommend