Distributed and Parallel Processing George Wells.

Slides:



Advertisements
Similar presentations
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
Advertisements

RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
Remote Method Invocation (RMI) Mixing RMI and sockets
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Remote Method Invocation in Java Bennie Lewis EEL 6897.
Java Remote Method Invocation (RMI) In Java we implement object systems: O1O2 O3 thread 1thread 2 execution scheme JVM 1JVM 2 distribution scheme.
Remote Method Invocation
The road to reliable, autonomous distributed systems
FONG CHAN SING (143334) WONG YEW JOON (143388). JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
EEC-681/781 Distributed Computing Systems Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Introduction to Remote Method Invocation (RMI)
How Does Remote Method Invocation Work? –Systems that use RMI for communication typically are divided into two categories: clients and servers. A server.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
1 Java Programming II Java Network II (Distributed Objects in Java)
CS 584 Lecture 18 l Assignment » Glenda assignment extended to the Java RMI Deadline » No Java RMI Assignment l Test » Friday, Saturday, Monday.
Architecture of Software Systems RMI and Distributed Components Martin Rehák.
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
15 - RMI. Java RMI Architecture Example Deployment RMI is a part of J2SE (standard edition), but is used by J2EE) A J2EE server is not nessesary for using.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Java RMI: Remote Method Invocation January 2000 Nancy McCracken Syracuse University.
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI RMI is the java API that facilitate distributed computing by allowing remote method calls. A remote method call represents a method invocation between.
RMI – Command Line CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
RMI Continued IS Outline  Review of RMI  Programming example.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
RMI - Eclipse CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
Fall 2007cs4251 Distributed Computing Umar Kalim Dept. of Communication Systems Engineering 17/10/2007.
RMI Observing the Distributed Pattern. Adrian German Lecturer, Computer Science Indiana University Bloomington.
Seminar on Service Oriented Architecture Distributed Systems Architectural Models From Coulouris, 5 th Ed. SOA Seminar Coulouris 5Ed.1.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
DISTRIBUTED OBJECTS AND REMOTE INVOCATION 1. 2 Topics  Middleware  Remote Method Invocation  Remote Procedure Call.
 Java RMI Distributed Systems IT332. Outline  Introduction to RMI  RMI Architecture  RMI Programming and a Sample Example:  Server-Side RMI programming.
Remote Method Invocation A Client Server Approach.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Remote Method Invocation RMI architecture stubs and skeletons for remote services RMI server and client in Java Creating an RMI Application step-by- step.
1 RMI Russell Johnston Communications II. 2 What is RMI? Remote Method Invocation.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Distributed programming in Java Faculty:Nguyen Ngoc Tu Session 5 - RMI.
Netprog Java RMI1 Remote Method Invocation.
Using RMI The Example of A Remote Calculator 1. Parts of A Working RMI System A working RMI system is composed of several parts. –Interface definitions.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Distributed and Parallel Processing George Wells.
Distributed and Parallel Processing George Wells.
Remote Method Invocation Internet Computing Workshop Lecture 17.
Principles of Software Development
Java Distributed Object System
Java Remote Method Invocation (RMI)
Broker in practice: Middleware
Remote Method Invocation
What is RMI? Remote Method Invocation
Extending Java RMI for Dynamic Reconfiguration
Remote Method Invocation
Java RMI (more) CS-328 Internet Programming.
Chapter 40 Remote Method Invocation
Remote method invocation (RMI)
Chapter 46 Remote Method Invocation
Using RMI -The Example of A Remote Calculator
Chapter 46 Remote Method Invocation
CS 584 Lecture 18 Assignment Glenda assignment extended to the Java RMI Deadline No Java RMI Assignment Test Friday, Saturday, Monday.
Java Remote Method Invocation
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

Distributed and Parallel Processing George Wells

Java: Remote Method Invocation (RMI) Write Java interface to specify actions to be performed by remote objects – Must extend java.rmi.Remote – Methods must throw java.rmi.RemoteException – Parameters/return values must be Serializable Write class that implements interface Create object – “Export” to obtain stub – Register to make available on network

Example: Remote Mandelbrot Service Interface import java.rmi.Remote; import java.rmi.RemoteException; /** This interface specifies the remote object * methods. */ public interface MandelbrotCalculator extends Remote { public byte[][] calculateMandelbrot (int xsize, int ysize, double x1, double x2, double y1, double y2) throws RemoteException; } // interface MandelbrotCalculator

Server import java.rmi.registry.Registry; import java.rmi.registry.LocateRegistry; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; public class MandelbrotServer implements MandelbrotCalculator { public byte[][] calculateMandelbrot (...) {... // As normal } // calculateMandelbrot public static void main (String args[]) {... } // main } // class MandelbrotServer

The main Method try { MandelbrotServer ms = new MandelbrotServer(); MandelbrotCalculator stub = (MandelbrotCalculator) UnicastRemoteObject.exportObject(ms, 0); // Bind remote object stub in registry Registry reg = LocateRegistry.getRegistry(); reg.bind("MandelbrotService", stub); System.out.println("Mandelbrot Server ready"); } catch (Exception e)...

RMI — Client Side Lookup remote object using registry – Returns stub (implements the interface) Call methods of stub

Client... import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.RemoteException; public class MandelbrotClient extends Applet implements Runnable, MouseListener, MouseMotionListener {... // Remote server object MandelbrotCalculator calc;... } // class MandelbrotClient

Client: Initialisation public void init() {... try { Registry registry = LocateRegistry.getRegistry(); calc = (MandelbrotCalculator) registry.lookup("MandelbrotService"); } catch (Exception e) {... } } // init

Client: Using the Remote Object private void generateImage () { byte[][] image = null; try { image = calc.calculateMandelbrot (xsize, ysize, x1, x2, y1, y2); } catch (RemoteException exc) {... } display(image); done = true; repaint(); } // generateImage

Running the Registry The JDK includes the registry program: rmiregistry

Practical 3 Use RMI to implement a simple message service Server holds messages for users – Hash table indexed by user name list of messages Client(s) – Deposit message for a user – Retrieve all messages for a user

Other Distributed Object Models CORBA – Standard for remote object calls – Supports many programming languages DCOM – Distributed Component Object Model SOAP – Web-oriented – XML over HTTP

Object Space Models High level of abstraction Logically shared memory – Sometimes called virtual shared memory

Level of Abstraction LowHigh Ease of Use Performance Performance & Ease of Use of Middleware Layers

Shared, Associative, Virtual Memory Process A Process B Process C Process D Tuple Space

Linda “Coordination Language” for concurrent programming – Host Language (Java, C++, anything) Shared Memory Communication Model – “Tuple Space” – Decoupling of Communicating Processes Temporal decoupling Spatial decoupling Small set of operations: out, rd, in, rdp, inp

Linda Primitive Operations out(t) – output tuple t to tuple space in(t) – input a tuple from tuple space which matches the template/antituple t – Removes the matching tuple rd(t) – read a tuple from tuple space which matches the template/antituple t inp(t) and rdp(t) – Like in(t) and rd(t) but do not block

Matching A template/antituple is matched using associative matching – Number of fields must match – Types of fields must match – Values of any defined fields must match E.g. in(”element”, i+1, j, ?result) might match (”element”, 3, 4, 5)

Linda (continued) Example: out(”point”, 23, 5) in(”point”, ?x, ?y) Tuple Space Associative matching (”point”, 23, 5)

Tuple Groups Implementation strategy to improve performance Place similar tuples into groups Tuples within a group must match – Number and type of fields – Value of constant fields

Simple Example Boss() { int i; for (i=1; i < 1000; i++} { out(“ping”); in(“pong”); } Worker() { int i; for (i=1; i < 1000; i++} { in(“ping”); out(“pong”); }

Adaptive Parallelism: Piranha Based on Linda Parallel computation using a pool of processors Processors can come and go during computation

Adaptive Parallelism Linda provides anonymous communication between processes Processes can be stopped, moved to another processor and restarted – Other processes are unaffected Linda provides an abstraction that hides the details of the pool of processors

Unreliable Nodes May join or withdraw from a computation Are only allowed to run client processes

Reliable Nodes May not withdraw from computation Hold the Linda tuple space One reliable node is configured as the master node – Controls the computation

Load Monitoring Used to control participation of nodes Based on – Number of runnable processes – Number of users logged on – Number of active users – Console activity

Speedup Measurement (Placing 14 Queens)

Bioinformatics Application Searching human genome for specific “protein patterns” Implemented using Java on Linux Time on one processor: – 4 hours 48 minutes Time on 50 processors: – 12 minutes 27 seconds

Speedup: Bioinformatics Application (1GB Data)

eLinda Three new features: – Programmable Matching Engine (PME) – Broadcast output operation ( wr ) – Multimedia support Three implementations: – fully distributed tuple space – centralised tuple space – centralised with local caching of broadcast tuples