14
Transforming DEVS to Non-Modular Transforming DEVS to Non-Modular Form For Faster Cellular Space Form For Faster Cellular Space Simulation Simulation Arizona Center for Integrative Modeling Arizona Center for Integrative Modeling and Simulation and Simulation Electrical and Computer Engineering Electrical and Computer Engineering Department Department University of Arizona University of Arizona Fahad A. Shiginah, Bernard P. Zeigler Fahad A. Shiginah, Bernard P. Zeigler {shiginah, zeigler}@ece.arizona.edu {shiginah, zeigler}@ece.arizona.edu

Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Embed Size (px)

DESCRIPTION

Introduction DEVS has been attracting researchers as a basis of Cellular modeling in complex physical systems. DEVS has been attracting researchers as a basis of Cellular modeling in complex physical systems. Parallel DEVS made it possible to implement cellular models in DEVS. Parallel DEVS made it possible to implement cellular models in DEVS. DEVS models are modular units that can access the states of other models through message passing. DEVS models are modular units that can access the states of other models through message passing. Representing cellular spaces in modular DEVS resulted in having cells communicating with each other to know neighboring states. Representing cellular spaces in modular DEVS resulted in having cells communicating with each other to know neighboring states. In large scale cellular space, huge number of inter-cell messages will be employed which result in performance reduction. In large scale cellular space, huge number of inter-cell messages will be employed which result in performance reduction. To overcome this problem, the non-modular form of DEVS should be consider as an alternative for faster large cellular space simulations. To overcome this problem, the non-modular form of DEVS should be consider as an alternative for faster large cellular space simulations.

Citation preview

Page 1: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Transforming DEVS to Non-Modular Form Transforming DEVS to Non-Modular Form For Faster Cellular Space SimulationFor Faster Cellular Space Simulation

Arizona Center for Integrative Modeling and SimulationArizona Center for Integrative Modeling and SimulationElectrical and Computer Engineering DepartmentElectrical and Computer Engineering Department

University of ArizonaUniversity of Arizona

Fahad A. Shiginah, Bernard P. ZeiglerFahad A. Shiginah, Bernard P. Zeigler

{shiginah, zeigler}@ece.arizona.edu{shiginah, zeigler}@ece.arizona.edu

Page 2: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

ContentContent IntroductionIntroduction Cellular Space ModelingCellular Space Modeling Cellular Models in DEVSCellular Models in DEVS The New Approach for Message ReductionThe New Approach for Message Reduction Transforming to Non-Modular DEVSTransforming to Non-Modular DEVS Experimental ResultsExperimental Results ConclusionsConclusions

Page 3: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

IntroductionIntroduction DEVS has been attracting researchers as a basis of Cellular DEVS has been attracting researchers as a basis of Cellular

modeling in complex physical systems. modeling in complex physical systems. Parallel DEVS made it possible to implement cellular models in Parallel DEVS made it possible to implement cellular models in

DEVS.DEVS. DEVS models are modular units that can access the states of DEVS models are modular units that can access the states of

other models through message passing.other models through message passing. Representing cellular spaces in modular DEVS resulted in having Representing cellular spaces in modular DEVS resulted in having

cells communicating with each other to know neighboring states.cells communicating with each other to know neighboring states. In large scale cellular space, huge number of inter-cell messages In large scale cellular space, huge number of inter-cell messages

will be employed which result in performance reduction.will be employed which result in performance reduction. To overcome this problem, the non-modular form of DEVS To overcome this problem, the non-modular form of DEVS

should be consider as an alternative for faster large cellular space should be consider as an alternative for faster large cellular space simulations.simulations.

Page 4: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Cellular Space ModelingCellular Space Modeling

• 2-D Physical space is discretized spatially in x-y axis

• Depending on the resolution required, it will be divided into N × N cells.

• Each cell covers a small space in which it carry out computations to find its next states based on its current state as well as neighbors states.

N

N

Page 5: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Cellular Models in DEVSCellular Models in DEVSN

N

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

• A cell is implemented as DEVS atomic model.

• The whole cellular space will be a coupled/hierarchical model containing all cells (atomic models).

• Modularity in DEVS allow cell to communicate through ports only.

• Each cell calculates its next state based on its current state and external inputs from neighbors (if exists at ports).

• All cells run in parallel (Parallel DEVS)

• Simulation continues until all cells are in passive mode or reaches a predefined stopping point.

Page 6: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Encapsulation SchemeEncapsulation Scheme

N/S

N/S

N

N

• Our goal is to reduce number of inter-cell communication.

• The new encapsulation will divide the cellular space into smaller subspace.

• Each subspace will encapsulate a group of cells.

• In each subspace, cells will be arranged in arrays to preserve their states and variables where they can access their neighbors states directly.

• This eliminates the ports and messages between all cells in one subspace where ports will be needed at the boundaries of the subspace only.

• Now, subspace is implemented as DEVS atomic model having ports to carry out the communication between cells at the boundaries.

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

Coupled DEVS <X, Y, D, {Mi}, {Ii}, {Zi,j}>

Page 7: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Messages in conventional ApproachMessages in conventional Approach

In a cellular space of N × N dimension, each cell can send messages to its 4

neighboring cells (Neumann neighbors). Assuming that in a single iteration a cell

will send V messages in each of the 4 directions as the worst case scenario. The

conventional approach will result in 4VN2-4VN messages per iteration given

that the cells at the boundaries will not send to at least one of its neighbors.

N

N

Page 8: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Message Reduction in Our ApproachMessage Reduction in Our Approach

S

S

N/S

N/S

That cellular space of N × N dimension can be divided into S × S subspaces

(Atomic DEVS) with N2/S2 internal cells each. A subspace will just send VN/S in

each direction and the total number of messages per iteration will be 4VNS-4VN given that the subspaces at the boundaries

will not send to at least one of its neighbors. The percentage reduction of

messages will be (N-S)/(N-1)% which will result in 100% reduction if S=1 or 0% if

S=N.

Page 9: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

M = < X,Y,S, δint, δext, δcon, λ, ta> X is a set of input values.

S is a set of states.Y is a set of output values.

δint : S S is the internal transition function.

δext : Q × Xb S is the external transition function, where

Q = {(s,e) | s S, 0 ≤ e ≤ ta(s)} is the total state sete is the time elapsed since last transitionXb denotes the collection of bags over X

δcon : Q × Xb S is the confluent transition function,λ: S Yb is the output function

ta: S R 0 ∞ is the time advance function. CM=<X,Y,D,{Mi},{Ii},{Zi,j}>X is the set of input values.Y is the set of output values.D is the set of components.for each i in D: Mi is a component which is an atomic model Mi = < Xi, Yi ,Si , δint i , δext i , δcon i , λi, tai>for each i in D {self}: Ii is the influencees of i, i is not in Ii.self is the coupled model itself CM which allow external inputs and outputs.for each j in Ii : Zi,j is the i to j output translation function (coupling).Zself,j : Xself Xj

Zi,self : Yi Yself

Zi,j : Xi Yj

Review: Parallel DEVS [1]Review: Parallel DEVS [1]Atomic DEVS Model (M)

M1

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

M2

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

Coupled DEVS Model (CM)

Page 10: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Review: Parallel DEVS (cont) Review: Parallel DEVS (cont)

M

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

M1

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

M2

Atomic DEVS<X, Y, S, δint, δext, δcon, λ, ta>

CM = <X,Y,D,{Mi},{Ii},{Zi,j}>

M* = CM

M* = < X,Y,S, δint, δext, δcon, λ, ta>

Every coupled DEVS model has a DEVS atomic equivalent.

Closure Under Coupling

Page 11: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Transforming to Non-Modular FormTransforming to Non-Modular Form

ZZw

Zn

Zs

Ze

ArrayCell(i,j)

ZZn

Zs

Ze

Zw

Nei

ghbo

rs

Atomic Model (M): Cellular Space

(0,2) (2,2)

(1,0)(0,0) (2,0)

(1,2)

(1,1) (2,1)(0,1)

Activity ScannerEvents Scheduler

j

i

Xb YbOuter

boundary values

Inner boundary

values

Array Z

intext con taS

Cell(0,2)

Cell(2,2)

Cell(1,0)

Cell(0,0)

Cell(2,0)

Cell(1,2)

Cell(1,1)

Coupled Model (CM): Cellular Space

Cell(2,1)

Cell(0,1)

j

i Couplings Atomic Model (M)

Xb Yb • The encapsulation technique will require to convert a subspace (coupled

model has group of cells) into its equivalent atomic model.

• This is the inverse process of transforming DEVS into modular form

illustrated in [2].• Cell ports are removed and all state

variables arranged in arrays.• Events handler will now take care of

all activities inside these arrays.• Activity scanner is employed so that

active cells are scanned only.• Equivalence to the original model

insured.

Page 12: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

Experimental ResultsExperimental Results

Message Message Reduction Reduction

(%)(%)

IterationsIterations Execution Time Execution Time (Min)(Min)

DJSimDJSim ADJSimADJSim

N=32N=32 00 171478171478 63.1763.17 16.5616.56

S=32S=32 00 171478171478 66.3566.35 19.2919.29

S=16S=16 51.6051.60 150149150149 21.7321.73 13.4313.43

S=8S=8 77.4077.40 126171126171 13.8913.89 12.6112.61

S=4S=4 90.3090.30 124755124755 21.2221.22 21.0621.06

S=2S=2 96.7096.70 124755124755 39.5339.53 40.0440.04

S=1S=1 100100 4990949909 1.361.36 1.361.36

Performance Comparison

0

10

20

30

40

50

60

70

N=32 S=32 S=16 S=8 S=4 S=2 S=1E

xecu

tion

Tim

e (M

in)

DJSimADJSim

• A slope criticality landslide model (32 ×32) was implemented using our approach and run

over DEVSJAVA Simulator (DJSim).• Different runs were made to compare

performance with variable size (S) of encapsulation.

• The runs were then repeated using new Activity-based DEVSJAVA Simulator

(ADJSim), presented in [3], aiming to compare our modeling enhancement versus simulator

enhancement. • Results shows that in addition to the messages

reduction, we saved a significant number of simulator iterations (at S=1, 121569 it. saved).

• In addition, a speed up of around 50 was achieved when using our approach alone

(DJSim at S=1 ) where using simulator enhancement alone (ADJSim at N=32) gives 4

speedups compared to the conventional implementation (DJSim at N=32).

Page 13: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

CONCLUSIONCONCLUSION The new approach significantly enhances the performance of cellular space The new approach significantly enhances the performance of cellular space

simulation in DEVS because of the following:simulation in DEVS because of the following:• Reducing inter-cell communicationsReducing inter-cell communications• Reducing number of simulator iterations that deals with messages only.Reducing number of simulator iterations that deals with messages only.• Efficiently scan active cells in the system only.Efficiently scan active cells in the system only.

Simulation restructuring does not deal with inter-cell messaging overhead. Simulation restructuring does not deal with inter-cell messaging overhead. Therefore, both model and simulator enhancements must by employed together to Therefore, both model and simulator enhancements must by employed together to simulate large scale cellular modeling environments. simulate large scale cellular modeling environments.

Best performance was achieved when all cells are in one atomic model. This may Best performance was achieved when all cells are in one atomic model. This may give a great enhancement in distributed cellular simulation by transforming the sub-give a great enhancement in distributed cellular simulation by transforming the sub-cellular space in a single machine entirely into non-modular form. cellular space in a single machine entirely into non-modular form.

Further investigation is required to test our approach on large distributed cellular Further investigation is required to test our approach on large distributed cellular space simulation to justify this claim. space simulation to justify this claim.

The new approach can be applied to any other non-hierarchal cellular model. The new approach can be applied to any other non-hierarchal cellular model. However, applying it manually is complex and error prone. However, applying it manually is complex and error prone.

An automated way of conversion needs to be implemented for fast, accurate An automated way of conversion needs to be implemented for fast, accurate conversion process.conversion process.

Page 14: Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer

REFERENCESREFERENCES1.1. Chow, A.C., and Zeigler, B. P. 1994. “Parallel DEVS: a parallel, hierarchical, Chow, A.C., and Zeigler, B. P. 1994. “Parallel DEVS: a parallel, hierarchical,

modular modeling formalism and its distributed simulator”. In Winter modular modeling formalism and its distributed simulator”. In Winter Simulation Conference Proceedings, Orlando, FL.Simulation Conference Proceedings, Orlando, FL.

2.2. Zeigler, B. P., Kim T., and Praehofer, H. 2000. Zeigler, B. P., Kim T., and Praehofer, H. 2000. Theory of Modeling and Theory of Modeling and Simulation: Integrating Discrete Event and Continuous Complex Dynamic Simulation: Integrating Discrete Event and Continuous Complex Dynamic SystemsSystems. Academic Press.. Academic Press.

3.3. Hu, X., and Zeigler, B.P. 2004. “A High Performance Simulation Engine for Hu, X., and Zeigler, B.P. 2004. “A High Performance Simulation Engine for Large-Scale Cellular DEVS Models”. High Performance Computing Large-Scale Cellular DEVS Models”. High Performance Computing Symposium (HPC'04), Advanced Simulation Technologies Conference.Symposium (HPC'04), Advanced Simulation Technologies Conference.