Running the Defibrillator study application with SimX/SCIRun

Simon Yau, 11th Feb., 2007

This document is intended for users of SCIRun who have added SimX components (see Building SimX components with SCIRun), and wishes to perform a design space exploration of the defibrillator application described in this paper: IPDPS 07 Workshop paper.

Getting nets:

The SCIRun nets for the defibrillator study can be found here: Defibrillator Application Nets.

Before the nets can be run, the files pointed to by the each of the FileReader modules must be fixed for the system. Follow the notes attached to each FileReader module to find the correct file to point them to.

Starting the SISOL layer

The SimX components use the Spatially Indexed Shared Object Layer (SISOL), which, in the current implementation, is implemented in seperate processes that has to be customised for each application. So the SISOL servers have to be built.

To build the SISOL servers for the defibrillator application, cd into the ${SCIRUN_DIR}/src/Packages/SimX/Standalone directory, and run gmake.

This should build a directory server (scirunSisolDirServMock) and a data server (scirunSisolServMock).

To run the spatially indexed shared object layer (SISOL) servers, issue:

${SCIRUN_DIR}/src/Packages/SimX/Standalone/scirunSisolDirServMock 20000 20001

This starts the shared object directory server. It listens to client connections on port 20000, and data server connections on port 20001,

and

${SCIRUN_DIR}/src/Packages/SimX/Standalone/scirunSisolServMock 40001 localhost 20001

This starts the shared object data server. It listens to client connections on port 40001.

The SISOL directory server's configuration can be put into a configuration file, which will then be read by the SimX modules that uses SISOL services. Name this file sisolConfig.txt. It should consist of only three lines:

localhost
20000
0

It tells the SCIRun SimX modules that the SISOL directory server is located on localhost, and is listening to client connections on port 20000, and that they should use object set ID 0. We set the environment variable SCIRUN_SISOLCONFIG to point to this file:

export SCIRUN_SISOLCONFIG=sisolConfig.txt

Running the simulator net

To run the defibrillator simulator SCIRun net, we also need to tell the SimX modules where the SimX communication ports are located, which we do with an environment variable SCIRUN_SIMXSIMPORT:

export SCIRUN_SIMXSIMPORT=30000

Then we can run the defibrillator simulators

../scirun -e ../defib-sim.srn

When this net starts running, it waits for connections from the viewer SCIRun net.

Running the viewer net

The viewer net requires additional information regarding the design space - how many dimensions are there, and what are their ranges. That information is contained in the viewer configuration file, defibViewerConfig.txt. Also continaed in the viewer configuration file are the number, location and port of simulator nets.

The defibViewerConfig.txt file consists of 6 lines:

3
100 200 300
-100 -200 0
1
localhost
30000

First three lines are information regarding the design space - how many dimensions, the upper limits of each dimension, and the lower limits of each dimension. The next three lines are information regrading the simulator nets - how many are there and their hosts and ports.

To run the viewer net, we set the SCIRUN_SIMXMANAGERCONFIG environment variable to point to the defibViewerConfig.txt file, and the SCIRUN_SISOLCONFIG variable to point to the sisolConfig.txt file:

export SCIRUN_SIMXMANAGERCONFIG=defibViewerConfig.txt; export SCIRUN_SISOLCONFIG=sisolConfig.txt; ../scirun -e ../defib-view.srn

The viewer net should start up and connect to the simulator net and explore the design space specified in defibViewerConfig.txt.

Visualising experiment results

The defibViewerConfig.txt linked above is configured for a 3-dimensional design space: the X and Z coordinates of the front electrode, and the strength of the voltage. So, the second and third lines defibViewerConfig.txt:

100 200 300
-100 -200 0

tells the SimX module to explore the design space defined by displacing the front electrode by 100 cm max, -100 cm min in the x direction, 200 cm max, -200 cm min in the z direction, and set the voltage from 0 to 300 Volts.

In the info box of the SelectExperimentUpstreamText module, all the experiments performed are listed. For each experiment, the value of the three design space points, and the performance metrics are listed. When the user wishes to view the result one specific experiment, he will use the UI of the SelectExperimentDownStream module and enter the experiment number. The viewer net will look up the experiment's result and display it.

Configuring for the Defibrillator study:

The range of the design space to explore is controlled through the above-mentioned configuration file.

The choice of sampler (Active Sampler Vs Grid Sampler) is controlled in a macro defined in ${SCIRUN_DIR}/src/Packages/SimX/Dataflow/Modules/DataIO/SimXManager.h. When the macro SIMX_SWEEPSAMPLER is defined, the SimX module uses the Grid Sampler, otherwise it uses the Active Sampler.

The levels of detail is controlled by a macro in the SimX sampler library. The macro is defined in ${SIMX_DIR}/samplers/ActiveSamplerExperiment.h and is named TARGET_LEVEL. The number corresponds to the number of refinements the sampler does before the study is complete.

The simulator nets produces audit trail showing the timestamps of experiments they receive. To disable the audit, undefine the macro SIMX_AUDIT in ${SCIRUN_DIR}/src/Packages/SimX/Dataflow/Modules/DataIO/ScirunBoundarySatellite.h

Two additional sets of viewer/simulator nets are provided for exploration in 2 and 5 dimensional design space, The 2D nets (defib-sim2D.srn, defib-view2D.srn) explores only 2 dimensions (the Z displacement of front electrode and the voltage strength). The 5D nets (defib-sim5D.srn, defib-view5D.srn) explores all 5 dimensions (the X and Z displacements of the front electrode, the voltage strength, and the X and Z displacements of the back electrode). When using these nets, the defibViewerConfig.txt file has to be changed to reflect the different dimensionality of the design space.

For example, if using the 2D nets, the first three lines of defibViewerConfig.txt could be:

2
200 300
-200 0

And when using the 5D net, the first three lines could be:

5
100 200 300 100 200
-100 -200 0 -100 -200

Outputs of a study

When a study is completed, the SimX modules writes out serveral files. If an active sampler is used, the viewer produces a set of Pareto frontier files, Pareto_l[1-num of refinement].txt, showing the partial Pareto Frontier approximation after each refinement. If a grid sampler is used, the viewer produces a file Pareto.txt, showing the pareto optimal points found.