distributing Agent- based simulations Gennaro Cordasco, Rosario De - - PowerPoint PPT Presentation
distributing Agent- based simulations Gennaro Cordasco, Rosario De - - PowerPoint PPT Presentation
A Framework for distributing Agent- based simulations Gennaro Cordasco, Rosario De Chiara, Ada Mancuso, Dario Mazzeo, Vittorio Scarano and Carmine Spagnuolo Outline Agent Based Simulations (ABMs) MASON Distributed ABMs DMASON
Outline
- Agent Based Simulations (ABMs)
- MASON
- Distributed ABMs
- DMASON
– issues – architecture
- MASON vs DMASON
- Tests
8/29/2011 HeteroPar'2011 2
- Simulate the actions and
interactions of autonomous individual agents with a view to assessing their effects on the system as a whole
– Investigated since the 1980s – Early works take inspiration from particles [R83]
- Applications
– Biology, economics, sociology …
- Why parallel?
– Huge number of agents – Complex behaviours
Agent-based simulation
8/29/2011 HeteroPar'2011 3
Motivation
4
Social Science Economy Science Fisics Biology Artificial Intelligence
Alignment Cohesion Separation
An Example: Reynolds’ Model
- Alignment: steer towards the average heading of
local flock-mates
- Cohesion: steer to move toward the average
position of local flock-mates
- Separation: steer to avoid crowding local flock-
mates
Alignment Cohesion Separation
Features of AB Simulation platforms
- Flexibility
– customization of agents and their behaviors
- Speed and efficiency
– scalable beyond millions, hundred of millions, billions – batch processing – interactive simulation rate (in the order of seconds)
- Testing and validation suites
- Research facilities (logging, graphing, etc.)
- Open-source
– communities of public/private entities, users, developers, researchers are crucial to ensure long-term sustainability and deep impact on current research practices
8/29/2011 HeteroPar'2011 6
Massive Agent-Based Simulations
- Massive: when the simulated agents are
– extremely numerous, – complex to simulate – with non-linear, dynamic behavior
- A Short Answer: "smart" parallelization
7 8/29/2011 HeteroPar'2011
- Mason is recognized to be
expressive and efficient
- Mason structure: clear
separation between Simulation and Visualization
- Back compatibility with
simulations already present in the framework
Why MASON ?
8/29/2011 HeteroPar'2011 8
DMASON
Master Workers Communication Server Field Agents Regions
8/29/2011 HeteroPar'2011 9
DMASON Issues
Work Partitioning Reproducibility Synchronization Communication
Agents vs Space Partitioning
- Agents Partitioning assigns a fixed number of
agents to each available worker
– Self balanced – Requires an all to all communication
- Space Partitioning partitions the simulation space
into regions. Each region is assigned to a worker which is in charge of simulating all the agents belonging to the region
– A small amount of communication is required – Agents can migrate – Load balancing is not guaranteed
8/29/2011 HeteroPar'2011 11
DMASON: Field Partitioning
8/29/2011 HeteroPar'2011 12
1 2 3 4
DMASON: Field Partitioning
8/29/2011 HeteroPar'2011 13
DMASON: Field Partitioning
- DMASON allows to partition the field into regions
- Neighboring regions communicate before each
simulation step
14
MASON DMASON 2D DMASON 1D
HeteroPar'2011
DMASON: Field Partitioning
- A portion of each
region is exchanged between neighbor workers before each simulation step
- The size of this
portion depends on agents area of interest (AOI)
15 8/29/2011 HeteroPar'2011
Right Region Left Region
DMASON: Synchronization
- Local synchronization:
– The step i of region r is computed by using the states i − 1 of r’s neighborhood – The step i of a region cannot be executed until the states i − 1 of its neighborhood have been computed and delivered.
- No central coordinator
- Simulation speed slowest region
speed
i i-1 i-1 i i i-1 i i i
8/29/2011 HeteroPar'2011 16
DMASON: Communication
- DMASON uses the publish–subscribe design
pattern to propagate agents state information
– Current version of DMASON uses Java Message Service (JMS) for communication between workers
DMASON: Reproducibility
- Agents evolve
simultaneously
– each simulation step can be executed in parallel overall the agents – the order in which agents are scheduled does not affect the reproducibility of results – neighbors’ updates are always processed in the same order
Step i tmp buffer Step i+1
8/29/2011 HeteroPar'2011 18
DMASON Architecture
- DMASON is a new layer
which extends the MASON simulation layer.
- The new layer does not
alter in any way existing layers
8/29/2011 HeteroPar'2011 19
DMASON Architecture
DMASON
dmason.Engine Distributed State Distributed Schedule Remote Agent<E> dmason.Field Distributed Field DContinuous2D DSparseGrig2D DDoubleGrid2D DIntGrid2D DObjectGrid2D dmason.Util Connection Management Exception Resources
The same structure as MASON
8/29/2011 HeteroPar'2011 20
MASON vs DMASON
DFlockers
DMASON: System Management
Master Console Worker
8/29/2011 HeteroPar'2011 22
Testing DMASON
- We want to assess that DMASON…
– …is able to run simulations that are impractical or impossible to execute with MASON – …is scalable – …allows to develop reproducible simulations (independently from the number of workers) – …allows to exploit multicore CPU – …allows to exploit heterogeneous hardware
8/29/2011 HeteroPar'2011 23
DMASON: homogeneous hosts
7 HOST : Intel i7-2600 4x3,4GHz con HT 8GB RAM JVM 32 bit
2 4 6 8 10 12 14 2000000 4000000 6000000 8000000 10000000 12000000 14000000
Avg simulation step timing (s) Agents
Mason DMASON 2x2, (1,1,1,1) DMASON 3x3, (2,2,2,2,1) DMASON 4x4, (3,3,3,3,2,2) DMASON 5x5, (4,4,4,4,3,3,3)
MASON DMASON 4 Hosts DMASON 5 Hosts DMASON 6 Hosts DMASON 7 Hosts
8/29/2011 HeteroPar'2011 24
DMASON: heterogeneous hosts
25 8/29/2011 HeteroPar'2011
DMASON: heterogeneous hosts
7,43 6,25 5,61 5,65 5,52 7,24 11,48 12,70 10,75 9,88 9,15 9,16 11,87 19,65
5 10 15 20 (0,0,0,0,25) (1,1,1,1,21) (1,2,2,2,18) (1,2,2,3,17) (1,2,2,4,16) (1,3,3,6,12) (5,5,5,5,5)
Avg simulation step timing (s)
Configurations (P4, Xeon, Opt, I5,I7)
3,000,000 Agents 5,000,000 Agents
Conclusion
- ABMs are CPU intensive applications and requires large
amount of memory
- The need for complex simulations involving a large number of
agents is always felt by researchers and practitioners
- DMASON allows to achieve those requirements by harvesting
the unused CPU power and Memory
8/29/2011 HeteroPar'2011 27
Current work
- Simulation logging and replay
Master Workers Communication Server Field Agents Regions Logger Visualizers Logging Server
Current work
- Visualization
Master Workers Communication Server Field Agents Regions Logger Visualizers Logging Server
Future Development
- Development of other distributed fields
- Dynamic Load Balancing
- Distributed communication
8/29/2011 HeteroPar'2011 30