Grille: la plate-forme ObjectWeb ProActive

Preview:

Citation preview

Denis Caromel 1

Denis CaromelInstitut Universitaire de France (IUF)

OASIS TeamINRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis

GridUse, june 2004

Grille:la plate-forme ObjectWeb ProActive

1. LES GrilleS2. Objets Répartis et Asynchrones3. Composants répartis, parallèles et hiérarchiques4. Déploiement, Environnements interactifs5. Exemples d’applications ProActive6. Vrais Systèmes P2P en action

Denis Caromel 2

Programming

ProActive:a global solution for the GRID

Composing

Deploying

W r a p p i n g

Figures: Web Page Hits: ~ 1K-2K months,Downoad: 150-300 / month, Users: ?? us, mx, br, cl, ch, it, ...

Denis Caromel 3

Denis Caromel 4

Enterprise Grids

Internet

EJBServletsApache Databases

Denis Caromel 5

Scientific Grids

Internet

Clusters

ParallelMachine

LargeEquipment

Denis Caromel 6

Internet Grids

Internet

Job management forembarrassingly parallel application (e.g. SETI)

Denis Caromel 7

The multiple GRIDs

• Scientific Grids

• Enterprise Grids

• Intranet and Internet Grids

Strong convergence in process!

At least at the infrastructure level, i.e. WS

Denis Caromel 8

Grid: from enterprise ... to regionalVery hard deployment problems … right from the beginning

Denis Caromel 9

Grid: from regional ... to worldwideCommunication Supélec-Los Angeles: 70 ms Light Speed

Challenge: Hide the latency !

Define adequate programming model

Denis Caromel 10

Distributed Objects andComponents

ProActiveProgramming

Denis Caromel 11

Model:• Remote Mobile Objects, Group Communications• Asynchronous Communications with synchro: automatic Futures• OO SPMD, Migration, Non Functional Exceptions (NFE)Environment:• XML Deployment, dynamic class-loading, PKI security• Various protocols: rsh,ssh,LSF,Globus,BPS, ...• Graphical Visualization and monitoring: IC2D

ProActive: A Java API + Tools for the GRIDParallel, Distributed, Mobile, Activities, across the world !

SMP ClustersLANDesktop

Denis Caromel 12

A

Creating AO and Groups

Typed Group Java or Active Object

A ag = newActiveGroup (“A”, […], VirtualNode)V v = ag.foo(param);...v.bar(); //Wait-by-necessity

V

Group, Type, and Asynchrony

are crucial for Cpt. and GRID

JVM

Denis Caromel 13

Explicit Synchronizations

Single Future Synchronization:• ProActive.isAwaited (v);

• .waitFor (v);

Vectors of Futures:• .waitForAll (Vector); // getOne

• .waitForAny (Vector);

Group Synchronization:• ProActiveGroup.waitOne(groupB); // getOne

• .waitAll(groupB);

Group Predicates:• noneArrived, kArrived(i), allAwaited, ...

A ag = newActive (“A”, […], VirtualNode)V v = ag.foo(param);... v.bar(); //Wait-by-necessity

Denis Caromel 14

Seamless Reuse / Granularity ControlTwo key features:• Polymorphism between standard and active objects

• Type compatibility for classes (and not only interfaces)• Needed and done for the future objects also• Dynamic mechanism (dynamically achieved if needed)

• Wait-by-necessity: inter-object synchronization• Systematic, implicit and transparent futures

Ease the programming of synchronizations, and the reuse of routines

"A"

"pA"

ap_a

foo (A a){ a.g (...); v = a.f (...); ... v.bar (...);}

Denis Caromel 15

ProActive : Reuse and seamlessTwo key features:• Polymorphism between standard and active objects

• Type compatibility for classes (and not only interfaces)• Needed and done for the future objects also• Dynamic mechanism (dynamically achieved if needed)

• Wait-by-necessity: inter-object synchronization• Systematic, implicit and transparent futures (“value to come”)

Ease the programming of synchronizations, and the reuse of routines

"A"

"pA"

ap_a

foo (A a){ a.g (...); v = a.f (...); ... v.bar (...);}

O.foo(a) : a.g()and a.f() are« local »

O.foo(p_a): a.g()and a.f()are«remote + Async.»

O

Denis Caromel 16

Standard system at Runtime

Denis Caromel 17

Mobility

Same semantics guaranteed (RDV, FIFO order point to point, asynchronous)

Safe migration (no agent in the air!)

Local references if possible when arriving within a VM

Tensionning (removal of forwarder)

Denis Caromel 18

Mobility

Same semantics guaranteed (RDV, FIFO order point to point, asynchronous)

Safe migration (no agent in the air!)

Local references if possible when arriving within a VM

Tensionning (removal of forwarder)

Denis Caromel 19

Mobility

Same semantics guaranteed (RDV, FIFO order point to point, asynchronous)

Safe migration (no agent in the air!)

Local references if possible when arriving within a VM

Tensionning (removal of forwarder)

direct

Denis Caromel 20

Mobility

Same semantics guaranteed (RDV, FIFO order point to point, asynchronous)

Safe migration (no agent in the air!)

Local references if possible when arriving within a VM

Tensionning (removal of forwarder)

direct

direct

Denis Caromel 21

Mobility

Same semantics guaranteed (RDV, FIFO order point to point, asynchronous)

Safe migration (no agent in the air!)

Local references if possible when arriving within a VM

Tensionning (removal of forwarder)

direct

direct

forwarder

Denis Caromel 22

Mobility

Same semantics guaranteed (RDV, FIFO order point to point, asynchronous)

Safe migration (no agent in the air!)

Local references if possible when arriving within a VM

Tensionning (removal of forwarder)

direct

direct

forwarder

Denis Caromel 23

Mobility

Same semantics guaranteed (RDV, FIFO order point to point, asynchronous)

Safe migration (no agent in the air!)

Local references if possible when arriving within a VM

Tensionning (removal of forwarder)

direct

direct

forwarder

Denis Caromel 24

Mobility

Same semantics guaranteed (RDV, FIFO order point to point, asynchronous)

Safe migration (no agent in the air!)

Local references if possible when arriving within a VM

Tensionning (removal of forwarder)

direct

direct

forwarder

Denis Caromel 25

Parallel, Distributed, Hierarchical

for the Grid

Composing

Denis Caromel 26

A CORBA Component

MyBusiness

Component

Component interface

Facets

Eventsources

Eventsinks

Attributes

Receptacles

OF

FE

RE

DR

EQ

UIR

ED

Courtesy of Philippe Merle, Lille, OpenCCM platform

Denis Caromel 27

Building CCM Applications =Assembling CORBA Component Instances

Provide + Use, but flat assembly

Denis Caromel 28

Content

Controller

The Fractal model:Hierarchical Component

Defined by E. Bruneton, T. Coupaye, J.B. Stefani, INRIA & FT

Denis Caromel 29

Content

Controller

Interface = access point

Denis Caromel 30

Content

Controller

Hierarchical model : composites encapsulate primitives encapsulate Java code

Denis Caromel 31

Content

Controller

Binding = interaction

Denis Caromel 32

Binding = interaction

Content

Controller

Denis Caromel 33

Controllers : non-functional properties

ComponentIdentity

BindingController

LifeCycleController

ContentController

Content

Controller

Component = runtime entity

Denis Caromel 34

3. Parallel and composite component

1. Primitive component

2. Composite component

ProActive Components for the GRID An activity, a process, …potentially in its own JVM

C D

Composite: Hierarchical, and

Distributed over machines

Parallel: Composite

+ Broadcast (group)

Denis Caromel 35

ProActive Component DefinitionA component is:

• Formed from one (or several) Active Object

• Executing on one (or several) JVM

• Provides a set of server ports: Java Interfaces

• Uses a set of client ports: Java Attributes

• Point-to-point or Group communication between components

Hierarchical:• Primitive component: define with Java code and a descriptor

• Composite component: composition of primitive + composite

• Parallel component: multicast of calls in composites

Descriptor:• XML definition of primitive and composite (ADL)

• Virtual nodes capture the deployment capacities and needs

Virtual Node is a very important abstraction for GRID components

Denis Caromel 36

A

A

B

C

P

Group proxyGroup proxy

A

B

C

D

Groups in Components

Broadcast at binding,

on client interface

At composition,

on composite inner server interface

A parallel component!

Denis Caromel 37

Migration Capabilityof composites

Migrate sets of components, including composites

Denis Caromel 38

Migration Capabilityof composites

Migrate sets of components, including composites

Denis Caromel 39

Co-allocation, Re-distribution

e.g. upon communication intensive phase

Denis Caromel 40

Co-allocation, Re-distribution

e.g. upon communication intensive phase

Denis Caromel 41

Co-allocation, Re-distribution

e.g. upon communication intensive phase

Denis Caromel 42

Deploying

Denis Caromel 43

How to deploy on the Various Kind of Grids ?

Internet

EJBServletsApache Databases

Internet

ClustersParallelMachine

LargeEquipment

Internet

Job management forembarrassingly parallel application (e.g. SETI)

Denis Caromel 44

Abstract Deployment Model

Problem:• Difficulties and lack of flexibility in deployment

• Avoid scripting for: configuration, getting nodes, connecting, etc.

A key principle: Virtual Node (VN) + XML deployment file• Abstract Away from source code:

• Machines

• Creation Protocols

• Lookup and Registry Protocols

Protocols and infrastructures:

• Globus, ssh, rsh, LSF, PBS, … Web Services, WSRF, ...

Denis Caromel 45

Descriptors: based on Virtual NodesVirtual Node (VN):

• Identified as a string name

• Used in program source

• Configured (mapped) in an XML descriptor file --> Nodes

Operations specified in descriptors:

• Mapping of VN to JVMs (leads to Node in a JVM on Host)

• Register or Lookup VNs

• Create or Acquire JVMs

Program Source Descriptor (RunTime)|----------------------------------| |-------------------------------------------|Activities (AO) --> VN VN --> JVMs --> Hosts

Runtime structured entities: 1 VN --> n Nodes in n JVMs

Denis Caromel 46

Descriptors: Mapping Virtual NodesComponent Dependencies:

Provides: … Uses: ...

VirtualNodes:

Dispatcher <RegisterIn RMIregistry, Globus, Grid Service, … >

RendererSet

Mapping:

Dispatcher --> DispatcherJVM

RendererSet --> JVMset

JVMs:

DispatcherJVM = Current // (the current JVM)

JVMset=//ClusterSophia.inria.fr/ <Protocol GlobusGram … 10 >

...

Example of

an XML file

descriptor:

Denis Caromel 47

Mapping Virtual Nodes: example (1)<processDefinition id="linuxJVM">

<jvmProcess class="org.objectweb.proactive.core.process.JVMNodeProcess"/>

</processDefinition>

<processDefinition id=”sshProcess">

<sshProcess class="org.objectweb.proactive.core.process.ssh.SSHJVMProcess"

hostname="sea.inria.fr">

<processReference refid="linuxJVM"/>

</sshProcess>

</processDefinition>

Infrastructure

informations

JVM on the current Host

JVM started using SSH

Denis Caromel 48

<processDefinition id=" clusterProcess ">

<bsubProcess class="org.objectweb.proactive.core.process.lsf.LSFBSubProcess"

hostname=”cluster.inria.fr"><processReference refid=”singleJVM"/>

<bsubOption>

<processor>12</processor> </bsubOption>

</bsubProcess>

</processDefinition>

Mapping Virtual Nodes: example (2)

,QIUDVWUXFWXUHLQIRUPDWLRQV

Definition of LSF deployment, … Globus

Denis Caromel 49

C A B

VNa VNb

C A B

VNc = VN(a,b)

XML Deployment (Not in source)

Separate or Co-allocation

Denis Caromel 50

IC2D: Interactive Control and Debugging of Distribution

With any ProActive applicationFeatures:

Graphical and Textual visualization Monitoring and Control

Denis Caromel 51

Monitoring of RMI, Globus, Jini, LSF clusterNice -- Baltimore

ProActive IC2D:

Width of links

proportional

to the number

of com-

munications

Denis Caromel 52

JobMonitoring

Denis Caromel 53

Denis Caromel 54

C3D: distributed-//-collaborative

Collaborative 3D,Rendering in //,

Applicationmobility

Denis Caromel 55

Jem3D

Denis Caromel 56

JEM 3D : Java 3D Electromagnetismtogether with Said El Kasmi, Stéphane Lanteri (caiman)

Maxwell 3D equation solver, Finite Volume Method (FVM)

Pre-existing Fortran MPI version: EM3D (CAIMAN team @ INRIA)

Up to 294 machines at the same time (Intranet and cluster)

Large data sets: 150x150x150 (100 million facets)temps d'exécution de la boucle principale (sur cluster)

0

100

200

300

400

500

600

700

800

900

0 10 20 30 40 50 60 70nombre de processeurs

tem

ps

(sec

on

des

)

21*21*21

31*31*31

43*43*43

55*55*55

81*81*81

97*97*97

113*113*113

121*121*121

taille du maillage

Denis Caromel 57

Recent BenchmarksSeq. Java/Fortran: 2

Comparison:

Jem3D over

- ProActive/RMI Sun

- ProActive/RMI Ibis

Em3D in

- Fortran/MPI

On 16 machines:

Fortran: 13.8

ProActive/Ibis: 12

ProActive/RMI: 8.8

Grid experiment on 5 clusters (DAS 2): Speed up of 100 on 150 machines

Denis Caromel 58

Monte Carlo Simulations,Non-Linear Physics, INLN

Denis Caromel 59

Electric Network Planning,E. Zimeo et al., Benevento (Naples), Italy

On-line Power Systems Security Analysis (OPSSA)

Denis Caromel 60

Electric Network Planning,E. Zimeo et al., Benevento (Naples), Italy

On-line Power Systems Security Analysis (OPSSA)

Denis Caromel 61

Electric Network Planning,E. Zimeo et al., Benevento (Naples), Italy

On-line Power Systems Security Analysis (OPSSA)

Denis Caromel 62

Electric Network Planning,E. Zimeo et al., Benevento (Naples), Italy

On-line Power Systems Security Analysis (OPSSA)

Denis Caromel 63

Electric Network Planning,E. Zimeo et al., Benevento (Naples), Italy

On-line Power Systems Security Analysis (OPSSA)

Denis Caromel 64

P2P N Queens

Denis Caromel 65

Real

Denis Caromel 66

Architectures: Server to Peer-To-Peer (P2P)

Internet

EJBServletsApache Databases

SOA: Service Oriented Architectures

Denis Caromel 67

Pure P2P: Definition

Only PEERs, no above everything, top level, server(s)

Every peer is, somehow, also a server

No master … No slave !

System get organized dynamically, without static configuration

Coherent, desired behavior, dynamically emerges

Denis Caromel 68

P2P Examples (1)

Denis Caromel 69

P2P can be difficult:need to be fault-tolerant, self healing

Denis Caromel 70

Not a P2P system

Denis Caromel 71

Neither a P2P system

Denis Caromel 72

P2P Examples (2)

Denis Caromel 73

P2P Examples (2bis)

Denis Caromel 74

A P2P system at work

Credit: from the movie Atlantis, Luc Besson

Denis Caromel 75

Conclusion• GRIDs: - Scientific - Enterprise - Internet

Strong convergence in process (infrastructure): WS, WSRF

• Challenge: adequate and precise programming+composing model• Asynchronous distributed objects, Mobility, Components

• High-level of abstraction, still Open and flexible

• Modern languages: Java, or others

not Fortran, MPI, C++, … not the answer

Perspectives:• Real P2P

• Interactive, Graphical,Deployment and Control:

Content

http://ProActive.ObjectWeb.org

Denis Caromel 76

Interactive Composition in IC2D

Content

Composition ViewInstead of

XML ADL

<processDefinition id="

<jvmProcessclass="org.objectweb

</processDefinition>

<processDefinition id=”

<sshProcessclass="org.objectweb

hostname="sea.

<processReference refid

</sshProcess>

</processDefinition>

Denis Caromel 77

Merging Component + Activity / JVM Views:Component Monitoring

Content

Dynamic View

Denis Caromel 78

Content

Dynamic View

Merging Component + Activity / JVM Views:Component Monitoring

Denis Caromel 79

Conclusion (2)Infrastructure and Deployment

• Virtual Nodes and XML• Protocols: ssh, Globus, LSF, PBS, …

• Transport: RMI, Ibis (Amsterdam)

• Web Services: XML, WSDL, SOAP (ongoing)• OSGi (future work)

Available in LGPL with ProActivehttp://ProActive.ObjectWeb.org in

The freedom your applications deserve!

Currently: a single application on 300 machines at onceGoal: towards a few 1000s !

Denis Caromel 80

Next ProActive events

EuroPar 2004, Pisa, Italy, Monday 30th August, Full Day Tutorial• ProActive Tutorial, and

• Hands-on session

User Group & Grid Interoperability, Nice, ETSI, Oct. 18-20• Detailed presentation of the platform

• User presentations and feedbacks

• Contest & PLUGTESTS : N queen challenge on GRID’5000, …

Denis Caromel 81

Denis Caromel 82

Denis Caromel 83

Denis Caromel 84

Exemple

50 Machines, 1,5 Année de Calcul

5000 Machines, Efficacité de 50 %

==> 10 Jours

Applications:

• Rechercher un vaccin

• Prévoir la progression d’un incendie

• Prévoir en temps réel les dangers d’une inondation ...

• etc.

Enjeux: Passer à l’ échelle

Denis Caromel 85

Ubiquitaire: Quelques chiffres

PCs à l ’ INRIA Sophia : ~ 1500 PACA : 1,3 Millions

France : 25 Millions Europe : 108 Millions USA : 400 Millions

Monde : 1 Milliard en 2002 (25 ans) Prévision: 2 Milliards en 2008

France :

• 36 Millions de téléphones portables

• 2.2 Millions dordinateurs portables

• 630 Mille PDA

(sources: ITU, Gartner Dataquest, IDC, 02-03, )

Denis Caromel 86

Some code !// CREATE THE COMPONENTSComponentIdentity speakers = ProActive.newActiveComponent(speakers_parameters);// OR USE THE COMPONENTS LOADER// ComponentIdentity speakers = ComponentsLoader.getComponent(« speakers »);

// BIND THE COMPONENTS((BindingController)cd_player.getFcInterface(BindingController.BINDING_CONTROLLER)).bindFc(« output », speakers.getFcInterface(« input »);

// START THE LIFE CYCLE OF THE COMPONENTS (ENABLE THE COMPONENTS)((LifeCycleController)speakers.getFcInterface(LifeCycleController.LIFECYCLE_CONTROLLER)).startFc();

// INVOKE SOME ACTIONS ON FUNCTIONAL INTERFACES((Input)speakers.getFcInterface(«input»)).newMusic (music.mp3);

((PlayerFacade)cd_player.getFcInterface(« control »)).play();

Denis Caromel 87

4. Composition, Deployment andRuntime

Denis Caromel 88

VirtualNodes// names of the virtual nodes

VirtualNode name= « Node-facade »VirtualNode name =« Node-speaker » - cyclic

Deployment// what is behind the names of the nodes

mapping // correspondance between the names of the VNs and the JVMsNode-facade --> JVM1Node-speaker --> {JVM2, JVM3, JVM4} // 1 VN can be mapped onto a set of JVMs

JVMsJVM1 created by process « linuxJVM »JVM2 created by process « rsh-computer1 »JVM3 created by process « rsh-computer2 »JVM4 created by process « rsh-computer3 »

Infrastructure// how and where the JVMs specified above are created

process-definition « linuxJVM »// this process creates a JVM on the current host

JVMProcess class= JVMNodeProcessprocess-definition « rsh-computer1 »// this process establishes an rsh connection and starts a JVM on the remote host

rshProcess class = RSHProcess host = « computer1 »processReference = « linuxJVM »

process-definition « rsh-computer2 »rshProcess class = RSHProcess host = « computer2 »processReference = « linuxJVM

process-definition « rsh-computer2 »rshProcess class = RSHProcess host = « computer3 »processReference = « linuxJVM »

Denis Caromel 89

Component Orientedness

• Level 1: Instantiate - Deploy - Configure• Simple Pattern

• Meta-information (file, XML, etc.) JavaBeans, EJB

• Level 2: Assembly (flat)• Server and client interfaces CCM

• Level 3: Hierarchic• Composite Fractal, ProActive, ...

• Level 4: Distributed + Reconfiguration• Binding, Inclusion, Location ProActive + On going work

Interactions / Communications:Functional Calls: service, event, streamNon-Functional: instantiate, deploy, start/stop, inner/outer, re-bind

This talk

Denis Caromel 90

Distributed Components

Typed Group Java or Active Object

ComponentIdentity Cpt = newActiveComponent (params);A a = Cpt … .getFcInterface ("interfaceName");V v = a.foo(param);

V

A

Example of

component

instance

JVM

Denis Caromel 91

Migration Capabilityof composites

Migrate sets of components, including composites

Denis Caromel 92

Collective Operations : Exampleclass A {…

V foo(P p){...}

}

class B extends A{ ...}

A a1=PA.newAct(A,);

A a2=PA.newAct(A,);

B b1=PA.newAct(B,);

// Build a group of « A »

A ag = (A)ProActiveGroup.newGroup(« A »,{a1,a2,b1})

V v = ag.foo(param); // foo(param) invoked // on each member

// A group v of result of type V is created

v.bar();

// starts bar() oneach member ofthe result groupupon arrival

ProActiveGroup.waitForAll(v); //bloking -> all

v.bar();//Group call

V vi =ProActiveGroup.getOne(v);

//bloking -> onvi.bar(); //a single call

A a3=PA.newAct(A,);

// => modif. ofgroup ag :

Group ga =ProActiveGroup.getGroup(ag);

ga.add(a3);

//ag is updated

Denis Caromel 93

Two Representation Scheme

Group of objectsgA

Typed groupgroupA

getGroupByTypestatic method of class ProActive

getGroupmethod of class Group

Management

of the group

Fonctional use

of the group

Denis Caromel 94

Two Representations (2)

• Management operations add, remove, size, …

• 2 possibility : static methods, second representation

• 2 representations of a same group : Typed Group / Group of objects

• ability to switch between those 2 representations

Group gA = ProActiveGroup.getGroup(groupA);

gA.add(new A());

gA.add(new B()); //B herits from A

A groupA = (A) gA.getGroupeByType();

Denis Caromel 95

Denis Caromel 96

ProActive : Migration of active objects

Migration is initiated by the active object itself through a primitive: migrateTo

Can be initiated from outside through any public method

The active object migrates with:• all pending requests• all its passive objects • all its future objects

Automatic and transparent forwarding of:• requests (remote references remain valid)• replies (its previous queries will be fullfilled)

Denis Caromel 97

<virtualNodesDefinition>

<virtualNode name="Dispatcher"/>

</virtualNodesDefinition>

<map virtualNode="Dispatcher">

<jvmSet>

<vmName value="Jvm1"/>

</jvmSet>

</map>

<jvm name="Jvm1">

<acquisition method="rmi"/>

<creation>

<processReference refid="linuxJVM"/>

</creation>

</jvm>

Definitions

and mapping

Definition ofVirtual Nodes

Mapping ofVirtual Nodes

Mapping Virtual Nodes: example (1)

Denis Caromel 98

<virtualNodesDefinition>

<virtualNode name="Jem3DNode"/>

</virtualNodesDefinition>

<map virtualNode=" Jem3DNode">

<jvmSet>

<vmName value=”clusterJvm"/>

</jvmSet>

</map>

<jvm name="clusterJvm">

<acquisition method="rmi"/>

<creation>

<processReference refid=”clusterProcess"/>

</creation>

</jvm>

Definitions

and mapping

Definition ofVirtual Nodes

Mapping ofVirtual Nodes

Mapping Virtual Nodes: example (2)

Denis Caromel 99

Mapping Virtual Nodes: example (3)<processDefinition id="linuxJVM">

<jvmProcess class="org.objectweb.proactive.core.process.JVMNodeProcess"/>

</processDefinition>

<processDefinition id="rshProcess">

<rshProcess class="org.objectweb.proactive.core.process.rsh.RSHJVMProcess"

hostname="sea.inria.fr">

<processReference refid="linuxJVM"/>

</rshProcess>

</processDefinition>

Infrastructure

informations

JVM on the current Host

JVM started using RSH

Denis Caromel 100

<processDefinition id=” singleJVM"> <jvmProcess class="org.objectweb.proactive.core.process.JVMNodeProcess"/>

</processDefinition>

<processDefinition id=" clusterProcess ">

<bsubProcess class="org.objectweb.proactive.core.process.lsf.LSFBSubProcess" hostname=” cluster.inria.fr">

<processReference refid=” singleJVM"/>

<bsubOption><processor>12</processor>

</bsubOption>

</bsubProcess></processDefinition>

Mapping Virtual Nodes: example (4)

,QIUDVWUXFWXUHLQIRUPDWLRQV

Definition of bsubprocess

Denis Caromel 101

Virtual Nodes in Programs (1)

Load the descriptor file

Descriptor pad = ProActive.getDescriptor ("file://ProActiveDescriptor.xml");

Activate the mapping

VirtualNode vn = pad.activateMapping ("Dispatcher");

// Triggers the JVMs

Use nodes

Node node = vn.getNode(); ... C3D c3d = ProActive.newActive("C3D", param, node);

Denis Caromel 102

Descriptors: Virtual Nodes in Programs (2)

Descriptor pad = ProActive.getDescriptor ("file:.ProActiveDescriptor.xml");

VirtualNode vn = pad.activateMapping ("Dispatcher"); // Triggers the JVMs

Node node = vn.getNode(); ... C3D c3d = ProActive.newActive("C3D", param, node);

log ( ... "created at: " + node.name() + node.JVM() + node.host() );

Denis Caromel 103

Descriptors: Virtual Nodes in Programs (3)

Descriptor pad = ProActive.getDescriptor ("file:.ProActiveDescriptor.xml");

VirtualNode vn = pad.activateMapping ("Dispatcher"); // Triggers the JVMs

Node node = vn.getNode(); ... C3D c3d = ProActive.newActive("C3D", param, node);

log ( ... "created at: " + node.name() + node.JVM() + node.host() );

// Cyclic mapping: set of nodes VirtualNode vn = pad.activateMapping ("RendererSet");

while ( … vn.getNbNodes … ) {

Node node = vn.getNode();

Renderer re = ProActive.newActive(” Renderer", param, node);

Denis Caromel 104

Component Definition: XML ADLPrimitive-component "cd-player”

implementation = "CdPlayer” // Java class with functional code

Provides interface "input” …

Requires … VirtualNode = VNa // Virtual Node name

Composite-component ” stereo”

VirtualNode = VNc, vn ... // Virtual Node

Provides … Requires …Primitive-component ” cd-player”

Primitive-component ” speaker”

Bindings bind "cd-player.output" to "speaker.input"

Merging VNa, VNb, ---> VNc // Co-allocation in that case

Example of

an XML

component

file:

Denis Caromel 105

Descriptors: Mapping Virtual NodesComponent Definitions:

Provides: … Uses: ...

VirtualNodes:

Dispatcher <RegisterIn RMIregistry, Globus, Grid Service, … >

RendererSet

Mapping:

Dispatcher --> DispatcherJVM

RendererSet --> JVMset

JVMs:

DispatcherJVM = Current // (the current JVM)

JVMset=//ClusterSophia.inria.fr/ <Protocol Globus … 10 >

rsh, … ssh, …

Example of

an XML file

descriptor:

Denis Caromel 106

Components vs. Activity and JVMs

Activity JVM Component

A B1

C

B2

B3

Cp. are rather orthogonal to activities and JVMs:

contain activities, span across several JVMs

Components are a way to globally manipulatedistributed, and running activities

Denis Caromel 107

An object created with A a = new A (obj, 7);

can be turned into an active and remote object:

• Instantiation-based:A a = (A)ProActive.newActive(«A», params, node);

The most general case.

To get Class-based: a static method as a factoryTo get a non-FIFO behavior (Class-based):

class pA extends A implements RunActive { … }

• Object-based:A a = new A (obj, 7);

... ...

a = (A)ProActive.turnActive (a, node);

ProActive : Creating active objects

Denis Caromel 108

ProActive : Intra-object synchronizationExplicit control:Library of service routines:

• Non-blocking services,...• serveOldest ();• serveOldest (f);

• Blocking services, timed, etc.• serveOldestBl ();• serveOldestTm (ms);

• Waiting primitives• waitARequest();• etc.

class BoundedBuffer extends FixedBufferimplements Active

{

live (ExplicitBody myBody)

{

while (...)

{

if (this.isFull())

myBody.serveOldest("get");

else if (this.isEmpty())

myBody.serveOldest ("put");

else myBody.serveOldest ();

// Non-active wait

myBody.waitARequest ();

}}}

Implicit (declarative) control: library classese.g. : myBody.forbid ("put", "isFull");

Denis Caromel 109

An object created with A a = new A (obj, 7);

can be turned into an active and remote object:

• Instantiation-based:A a = (A)ProActive.newActive(«A», params, node);

The most general case.

To get Class-based: a static method as a factoryTo get a non-FIFO behavior (Class-based):

class pA extends A implements RunActive { … }

• Object-based:A a = new A (obj, 7);

... ...

a = (A)ProActive.turnActive (a, node);

ProActive : Creating active objects

Denis Caromel 110

ProActive : Reuse and seamlessTwo key features:• Polymorphism between standard and active objects

• Type compatibility for classes (and not only interfaces)• Needed and done for the future objects also• Dynamic mechanism (dynamically achieved if needed)

• Wait-by-necessity: inter-object synchronization• Systematic, implicit and transparent futures

Ease the programming of synchronizations, and the reuse of routines

"A"

"pA"

ap_a

foo (A a){ a.g (...); v = a.f (...); ... v.bar (...);}

Denis Caromel 111

ProActive : Reuse and seamlessTwo key features:• Polymorphism between standard and active objects

• Type compatibility for classes (and not only interfaces)• Needed and done for the future objects also• Dynamic mechanism (dynamically achieved if needed)

• Wait-by-necessity: inter-object synchronization• Systematic, implicit and transparent futures (“value to come” )

Ease the programming of synchronizations, and the reuse of routines

"A"

"pA"

ap_a

foo (A a){ a.g (...); v = a.f (...); ... v.bar (...);}

O.foo(a) : a.g()and a.f() are« local »

O.foo(p_a): a.g()and a.f()are«remote + Async.»

O

Denis Caromel 112

ProActive : Intra-object synchronizationExplicit control:Library of service routines:

• Non-blocking services,...• serveOldest ();• serveOldest (f);

• Blocking services, timed, etc.• serveOldestBl ();• serveOldestTm (ms);

• Waiting primitives• waitARequest();• etc.

class BoundedBuffer extends FixedBufferimplements Active

{

live (ExplicitBody myBody)

{

while (...)

{

if (this.isFull())

myBody.serveOldest("get");

else if (this.isEmpty())

myBody.serveOldest ("put");

else myBody.serveOldest ();

// Non-active wait

myBody.waitARequest ();

}}}

Implicit (declarative) control: library classese.g. : myBody.forbid ("put", "isFull");

Denis Caromel 113

SharedOnReadCall between Objects

b.foo(x)ba

x

Copy

Denis Caromel 114

Generalized Futures… to done ...

b.foo(x)ba

x

Copy

Recommended