Distributed and Parallel Simulation Toolbox

for use with Matlab(R) - MatlabDS


Christian Stenzel

June 2009


The Distributed and Parallel Simulation Toolbox for use with Matlab (MatlabDS) allows the spatially distributed and concurrent execution of discrete-event simulations within Matlab. Therefore, MatlabDS contains a discrete-event simulation executive which can be extended by different interchangeable synchronization algorithms. A major reason for the development of this toolbox was the ability to study complex synchonization algorithms within an engineering tool, here namely Matlab.
Contents Introduction
If interoperability between different simulation components is achieved usually a costly reimplementation of existing software can be avoided. The methodology of parallel and distributed simulation is capable to achieve runtime interoperability between heterogeneous simulation components.
Further on, especially large-scale discrete event-simulations can consume a huge amount of computation time and memory resources. In some cases, the usage of distributed and parallel simulation methods can help to reduce the overall computation time and can help to increase the scalability.

In particular the term distributed and parallel simulation refers to a spatially and concurrent execution of one simulation run. Generally, the spatial separation is achieved by the partitioning of a simulation model in different sub-models. Ideally, each sub-model contains a disjoint subset of the original state space whereas the set of sub-models is executed concurrently. The coordinated or rather synchronized execution has to ensure the causality constraints. Beside the causality issue it is often a requirement that the parallel simulation run produces the same results like a sequential one. Events, or more closer to an implementation messages are used to exchange information between the sub-models.

The parallel or distributed execution of the spatially distributed simulation components is synchronized implicitly via events and explicitly via further synchronization mechanisms. Therefore different synchronization algortihms exists which can be separated in three classes:

As stated above the interprocess communication between the different sub-models or Logical Processes (LPs), a term which is used throughout the literature, is based on an exchange of events or messages respectively. Therefore, Message Passing (MP) programming as a parallel programming model is well suited to implement distributed simulation executives. Indeed, as underlying communication infrastructure for MatlabDS serves the Distributed and Parallel Application (DP) Toolbox for use with Matlab, which provides a high-level programming interface towards PVM (Parallel Virtual Machine) and MPI-2 (Message Passing Interface). In future, a second communication platform will be supported based on the High Level Architecture. A free toolbox implementation for Matlab exists (MatlabHLA).
Sequential Simulation Executive
For verification purposes this toolbox contains a sequential simulation executive. The scheduler is implemented as so-called 3-phase scheduler. A detailed description can be found in [WAT93]. A sample model file is also included representing an example obtained from [FUJ00] which is now briefly introduced:
A simple airport with one runway is modeled. Every (I) time units an aircraft arrives. Only if the runway is free, an aircraft have the ability to land which happens after (R) time units. If the runway is already seized by an aircraft, the arriving one have to fly another holding. After the landing, (G) time units are needed to travel to the gate and unload and load new passangers. Finally the aircraft departs and travels to another airport. The figure below shows an Event Graph Model (EGM, see [SCH83]) of the airport model.

Parallel Simulation Executive
Just in development.
This toolbox is for study purposes only. Currently, some conservative synchronization strategies are implemented. At time PVM is supported by usage of MatlabDP. Future extensions will support HLA on basis of the MatlabHLA toolbox.
Getting MatlabDS-Toolbox
You can download a first version here. A slightly adapted MatlabDP is included.
Installing MatlabDS-Toolbox
For sequential experiments please add the directory MatlabDS/distEventPrimitives to your Matlab path. Afterwards, you should be able to execute the models below MatlabDS/models/seq. For parallel simulation experiments fist install MatlabDP and verify your installation.
Sending Patches
At time, patches are not very useful because this toolbox is still in development. But feel free to contribute, I would be pleased.
Bug Report
Also bug reporting is at time not a very good idea. The toolbox is in a very early development state, major changes can happen every day!
Belonging Publications
Parallel processing within engineering tools Discrete event simulation Parallel and distributed simulation Synchronization algorithms
June 2009, C. Stenzel