The Distributed-SDF Domain Sleep Demo

The Sleep Demo illustrates the usage and advantages of the Distributed-SDF domain.

The model is an standard SDF Model with a Distributed-SDF Director. Any non hierarchical SDF model can be simulated in a distributed manner unless the actors have external dependencies.

(Note that models that use actors that have GUI dependencies might generate errors!)

So try your own SDF models, you just change the standard SDF director by the Distributed-SDF Director.

By configuring the Distributed-SDF Director, we can choose to run the model either sequential or parallel (default). Make sure that the distributed platform is running before you start a distributed simulation. To do this we provide a script under:

Windows:
$PTII/ptolemy/distributed/demo/Sleep/startplatform.bat
Cygwin,Unix,Linux:
$PTII/ptolemy/distributed/demo/Sleep/startplatform
This script starts the following services: If you run the DOS batch file you will get 6 command windows, the first for the first 2 services and the remaining 5 one for each server. This allows you to follow each server individually.

We provide 3 more scripts under $PTII/ptolemy/distributed/jini:

startjinilocal and startjinilocal.bat
launches a local http server (daemon) and the reggie service (registration and lookup service).
startserver and startserver.bat
launches a starts a DistributedServerRMIGeneric server.
starttservers and starservers.bat
launches a given number of DistributedServerRMIGeneric servers depending on the parameter. (e.g. startservers 5 launches 5 servers).
In order to illustrate the distributed simulation advantages to users that have only access to a single machine this demo uses Sleep actors. For every fire of the Sleep actors, they will stall for 5 seconds. In a sequential simulation this means that a 10 seconds stall is performed since the Sleep actors are executed one after the other. In the case of parallel simulation, those two actors can stall at the same time, reducing this time to 5 seconds for both.

On the standard output for the model, you can check the execution time for the simulation. Try to run both a sequential an a parallel simulation and compare the times.

(Note that the more iterations and the bigger the sleep times, the more advantage you will get from using the distributed platform.)

For a more realistic demo, please run the individual servers on different machines.

(Note that if your network blocks broadcast packets you might need to configure unicast locators.)

Look at the documentation of the Distributed-SDF Director in particular and the classes and configuration files under ptolemy.distributed for further information.

You can also contact the author for further questions on kapokasa@kom.aau.dk.

Problems

If, under Eclipse, you have security problems,then in Eclipse, go to Run -> Open Run Dialog -> In the "Arguments" tab, enter the following line including the double quotes.
"-Djava.security.policy=${workspace_loc:ptII/bin/policy.all}"

Last updated: $Id: Sleep.htm 70468 2014-11-02 17:58:07Z cxh $