Next: 5.3 Distributed Simulation on
Up: 5. DISTRIBUTED SIMULATION WITH
Previous: 5.1 PVM Requirement
  Contents
5.2 SVMDNS Daemon
Figure 5.1:
Multiple layers for distributed simulation in SVM
|
SVMDNS (SVM Dynamic Naming Service) is another daemon built on top of
the PVM library. It provides a higher level of interface to SVM
processes. For example, in Figure 5.1 there are 4
SVM processes, each of which has a DCharts component running on
it. Those DCharts components communicate with each other via
ports. The SVM processes register themselves to a single SVMDNS
daemon. The SVMDNS daemon invokes functions in the PVM library to
create 4 PVM processes, each of them correspond to an SVM process. The
location of those PVM processes depends on the configuration of the
PVM daemon. In this case, PVM processes 1, 2 and 3 are located on
machine 1, while PVM process 4 is located on machine 2. The PVM
library hides details of this configuration, but provides a uniform
API to SVMDNS.
SVMDNS provides the following functionality to an SVM process:
- Registration. Each SVM process that interacts with remote
components must register itself to the SVMDNS. By default, the SVM
simulator attempts to register itself to SVMDNS if and only if a
model with at least one port is running in it.
- Life-time. Each SVM process registered to SVMDNS must
periodically sends a keep-alive message to the SVM daemon. If the
daemon does not receive such a message from an SVM process within a
certain period of time (known as life-time), information about
the SVM process is removed from SVMDNS' registry. The life-time can
be customized in PVMUtil.py. By default it is 30 seconds. Each
SVM simulator, after it registers itself, sends the keep-alive
message to the SVMDNS every half life-time period.
- Component lookup. SVM processes send the name patterns or types
of required components to the SVMDNS. SVMDNS is able to locate the
registered components with those name patterns and types. It
establishes connections between components.
- SVMDNS also maintains the connections between different
components. The SVM processes are ignorant of this information. They
simply use ports to identify groups of connected components in
SVMDNS. SVMDNS acts as a router in inter-component communication.
To use SVMDNS, make sure the PVM requirement is satisfied, and compile
the PYPVM (http://pypvm.sourceforge.net/) support with command
``make pypvm'' in the SVM directory. PYPVM enables access to the
native PVM library from Python code.
Table 5.1:
SVMDNS console
|
The script svmdns in the SVM directory starts the SVMDNS
console. The SVMDNS command prompt appears, and commands can be
entered. The help command displays all the available commands
and their concise descriptions (Table
5.1). Initially the SVMDNS daemon is not
started. To start it, execute the ``start'' command. To close
the SVMDNS console, execute ``exit''. This command does not stop
the SVMDNS daemon, which keeps running in the background. Other
commands are explained below:
- The ``check'' command checks the current status of the
daemon (whether it is started).
- The ``exec "cmd"'' command executes an arbitrary Python
statement on the daemon. It can only be executed after the daemon is
started with the ``start'' command. The ``exec'' command
is useful for debugging. For example, ``exec
"check_master_started()"'' checks the status of the daemon, and
command ``exec "print SVMs"'' displays all the components
registered in the daemon.
- The ``send "msg"'' command sends a message to the
daemon. It can only be executed after the daemon is started with the
``start'' command. Messages received by the daemon, whether
they are sent from SVM simulators or from the SVMDNS console, are
displayed on the console where SVMDNS is started.
- The ``stop'' command stops the running daemon. It has no
effect if the daemon is not running on the local machine.
The user may directly execute a command from the shell by running svmdns with the command as a command-line parameter. For example, to
check the status, run ``svmdns check'' in the command-line; to
execute an arbitrary Python statement, run ``svmdns exec
"cmd"''.
File DNS in the SVM directory records the PVM ID of the SVMDNS
daemon. Once the SVMDNS daemon is started, it modifies this file with
its PVM ID (the return value of C function pvm_mytid()). SVM
simulators use this file to locate the SVMDNS daemon. When the daemon
is on another machine, the user must ensure that the content of the
DNS file in its SVM directory is the same as the one on the
machine where the SVM daemon is running. For a distributed simulation,
there should be exactly one SVMDNS daemon running in the
background. Each SVM simulator locates the same daemon with the DNS file on their own machines.
Next: 5.3 Distributed Simulation on
Up: 5. DISTRIBUTED SIMULATION WITH
Previous: 5.1 PVM Requirement
  Contents
Thomas Huining Feng
2004-04-05