A Distributed Simulation of P-Systems

Post on 02-Aug-2015

36 views 3 download

Tags:

Transcript of A Distributed Simulation of P-Systems

A Distributed Simulation of P-Systems

A Syropoulos, EG Mamatas, PC Allilomes and KT Sotiriades

Research Division

Araneous Internet Services

Xanthi, Greece

E-mail: research@araneous.com

– p. 1/14

The core of our work

A simulation of P-systems.

– p. 2/14

The core of our work

A simulation of P-systems.

Simulation: Representation of the operation or featuresof one process or system through the use of another.

– p. 2/14

The core of our work

A simulation of P-systems.

Simulation: Representation of the operation or featuresof one process or system through the use of another.

We represent only P-systems that are members of thefamily NOP2(coo, tar).

– p. 2/14

The core of our work

A simulation of P-systems.

Simulation: Representation of the operation or featuresof one process or system through the use of another.

We represent only P-systems that are members of thefamily NOP2(coo, tar).

And we used Java’s Remote Method Invocation for therepresentation.

– p. 2/14

What are P-Systems?

An abstract model of computation that is inherentlyparallel.

– p. 3/14

What are P-Systems?

An abstract model of computation that is inherentlyparallel.

A foundation for distributed computing.

– p. 3/14

Tools for Distributed Programming

Two basic ways to implement a distributed algorithms:

A purely distributed platform or

Some network protocol to connect a number ofnodes that interchange data.

– p. 4/14

Tools for Distributed Programming

Two basic ways to implement a distributed algorithms:

A purely distributed platform or

Some network protocol to connect a number ofnodes that interchange data.

But. . . distributed operating systems (e.g., Plan-9) arenot widely available, in general.

– p. 4/14

Tools for Distributed Programming

Two basic ways to implement a distributed algorithms:

A purely distributed platform or

Some network protocol to connect a number ofnodes that interchange data.

But. . . distributed operating systems (e.g., Plan-9) arenot widely available, in general.

Fortunately, all modern general purpose operatingsystems provide the necessary network capabilitiesthat can be utilized to create distributed applications.

– p. 4/14

Tools for Distributed Programming

Two basic ways to implement a distributed algorithms:

A purely distributed platform or

Some network protocol to connect a number ofnodes that interchange data.

But. . . distributed operating systems (e.g., Plan-9) arenot widely available, in general.

Fortunately, all modern general purpose operatingsystems provide the necessary network capabilitiesthat can be utilized to create distributed applications.

– p. 4/14

Tools for Distributed Programming

Two basic ways to implement a distributed algorithms:

A purely distributed platform or

Some network protocol to connect a number ofnodes that interchange data.

But. . . distributed operating systems (e.g., Plan-9) arenot widely available, in general.

Fortunately, all modern general purpose operatingsystems provide the necessary network capabilitiesthat can be utilized to create distributed applications.

– p. 4/14

Network Protocols

Distributed algorithms are implemented:

As a peer-to-peer or

A client-server architecture.

– p. 5/14

Network Protocols

Distributed algorithms are implemented:

As a peer-to-peer or

A client-server architecture.

Sockets: pros and cons

The fundamental tool for the implementation ofTCP/IP networking applications.

Peer-to-peer applications require a (new) networkprotocol for data exchange.

– p. 5/14

Network Protocols

Distributed algorithms are implemented:

As a peer-to-peer or

A client-server architecture.

Sockets: pros and cons

The fundamental tool for the implementation ofTCP/IP networking applications.

Peer-to-peer applications require a (new) networkprotocol for data exchange.

Java’s Remote Method Invocation: A solution to ourproblem!

– p. 5/14

Network Protocols

Distributed algorithms are implemented:

As a peer-to-peer or

A client-server architecture.

Sockets: pros and cons

The fundamental tool for the implementation ofTCP/IP networking applications.

Peer-to-peer applications require a (new) networkprotocol for data exchange.

Java’s Remote Method Invocation: A solution to ourproblem!

– p. 5/14

Network Protocols

Distributed algorithms are implemented:

As a peer-to-peer or

A client-server architecture.

Sockets: pros and cons

The fundamental tool for the implementation ofTCP/IP networking applications.

Peer-to-peer applications require a (new) networkprotocol for data exchange.

Java’s Remote Method Invocation: A solution to ourproblem!

– p. 5/14

Network Protocols

Distributed algorithms are implemented:

As a peer-to-peer or

A client-server architecture.

Sockets: pros and cons

The fundamental tool for the implementation ofTCP/IP networking applications.

Peer-to-peer applications require a (new) networkprotocol for data exchange.

Java’s Remote Method Invocation: A solution to ourproblem!

– p. 5/14

Network Protocols

Distributed algorithms are implemented:

As a peer-to-peer or

A client-server architecture.

Sockets: pros and cons

The fundamental tool for the implementation ofTCP/IP networking applications.

Peer-to-peer applications require a (new) networkprotocol for data exchange.

Java’s Remote Method Invocation: A solution to ourproblem!

– p. 5/14

Java’s RMI in. . . detail

An object on one JVM can invoke methods on anobject in another JVM.

– p. 6/14

Java’s RMI in. . . detail

An object on one JVM can invoke methods on anobject in another JVM.

The arguments of the remote method are “marshalled”and sent from the local JVM to the remote one, wherethey are are “unmarshalled.”

– p. 6/14

Java’s RMI in. . . detail

An object on one JVM can invoke methods on anobject in another JVM.

The arguments of the remote method are “marshalled”and sent from the local JVM to the remote one, wherethey are are “unmarshalled.”

When the method terminates, the results aremarshalled from the remote machine and sent to thecaller’s JVM.

– p. 6/14

Java’s RMI in. . . detail

An object on one JVM can invoke methods on anobject in another JVM.

The arguments of the remote method are “marshalled”and sent from the local JVM to the remote one, wherethey are are “unmarshalled.”

When the method terminates, the results aremarshalled from the remote machine and sent to thecaller’s JVM.

If for some reasons an exception is raised, theexception is indicated to the caller.

– p. 6/14

The simulation

It is implemented in Java and makes heavy use of theJava’s RMI.

– p. 7/14

The simulation

It is implemented in Java and makes heavy use of theJava’s RMI.

The system accepts an input file that describes aP-system.

– p. 7/14

The simulation

It is implemented in Java and makes heavy use of theJava’s RMI.

The system accepts an input file that describes aP-system.

The simulation is distributed in the sense that anumber of objects execute code on different machineswhile they communicate.

– p. 7/14

The simulation

It is implemented in Java and makes heavy use of theJava’s RMI.

The system accepts an input file that describes aP-system.

The simulation is distributed in the sense that anumber of objects execute code on different machineswhile they communicate.

One object pretends to be the basic compartment,while the others play the rôle of the internalcompartments.

– p. 7/14

The syntax of the language

system = “system” “is”

alphabet “and”

structure “and”

rules “and”

data “and”

output “and”

maximum “and”

“end”

alphabet = “[” letter { “,” letter } “]”

structure = “[” { “[” “]” } “]”

rules = “{” setOfRules { “,” setOfRules } “}”

– p. 8/14

The syntax of the language, cont.

setOfRules = “[” singleRule { “,” singleRule } “]”

singleRule = left “->” right

left = letter { letter }

right = replacement { replacement }

replacement = “(” letter [ “,” destination ] “)”

destination = “here” | “out” | in

in = “in” possitive-integer

data = “{” Mset { “,” Mset } “}”

– p. 9/14

The syntax of the language, cont.

Mset = “(” { occurance } “)”

occurance = “[” letter “,” possitive-integer “]”

output = “output” possitive-integer

maximum = “maximum” possitive-integer

– p. 10/14

Upon startup, all objects start sending multicast UDPpackets to a well-known multicast address.

– p. 11/14

Details of the simulation

Upon startup, all objects start sending multicast UDPpackets to a well-known multicast address.

Each packet contains the IP address of each sender.

– p. 11/14

Details of the simulation

Upon startup, all objects start sending multicast UDPpackets to a well-known multicast address.

Each packet contains the IP address of each sender.

Multicast packets are received by every objectparticipating in the “network.”

– p. 11/14

Details of the simulation

Upon startup, all objects start sending multicast UDPpackets to a well-known multicast address.

Each packet contains the IP address of each sender.

Multicast packets are received by every objectparticipating in the “network.”

The main object knows which objects are alive, so itcan decide whether the computation can start.

– p. 11/14

Details of the simulation, cont.

A universal clock is owned by the object that has therôle of the basic compartment.

– p. 12/14

Details of the simulation, cont.

A universal clock is owned by the object that has therôle of the basic compartment.

Communication breakdowns are considered asexceptional situations and are treated accordingly.

– p. 12/14

Details of the simulation, cont.

A universal clock is owned by the object that has therôle of the basic compartment.

Communication breakdowns are considered asexceptional situations and are treated accordingly.

Objects operate in parallel implementing the maximalparallelism requirement for this “simple” case.

– p. 12/14

Gaining maximal parallelism

Initially, the simulator checks which rules are applicableand selects them.

– p. 13/14

Gaining maximal parallelism

Initially, the simulator checks which rules are applicableand selects them.

Applicable rules with common elements on theirleft-hand side, are checked for the changes they causeto the system.

The “weight” of each side of a rule isequal to the number of elements, or 1 ifthere are no elements. The total “weight”of a rule is equal to the product of its two“weights.”

Only one rule is selected!

– p. 13/14

Gaining maximal parallelism

Initially, the simulator checks which rules are applicableand selects them.

Applicable rules with common elements on theirleft-hand side, are checked for the changes they causeto the system.

The “weight” of each side of a rule isequal to the number of elements, or 1 ifthere are no elements. The total “weight”of a rule is equal to the product of its two“weights.”

Only one rule is selected!

The remaining rules are used in the actualcomputation.

– p. 13/14

Future work

Reimplement the system using the SOAP protocol.

– p. 14/14

Future work

Reimplement the system using the SOAP protocol.

Explore the foundational part of P-system.

– p. 14/14

Future work

Reimplement the system using the SOAP protocol.

Explore the foundational part of P-system.

Design and implementation of a distributedprogramming language. . .

– p. 14/14