180 High Performance Visualization
analysis begins at runtime. The separation of Libsim into two pieces prevents
inflation of executable size, even after linking with Libsim, while still retaining
the ability to access the full VisIt feature set when it is needed.
The control interface is capable of advertising itself to authorized VisIt
clients, listening for incoming connections, initiating the connection back to
the VisIt client, handling VisIt requests like plot creation and data queries,
and letting the client know when the simulation has advanced and that new
data is available.
Several aspects of Libsim result in benefits for both interacting and inter-
facing with simulations. The separation between the front-end library and the
runtime library is one such aspect. In particular, modifications to simulation
codes to support Libsim can be minimal, as the front-end library contains
only approximately twenty simple control functions (most of which take no
arguments), and only as many data functions as the simulation code wishes
to expose. This separation also enables the front-end library to be written in
pure C. As such, despite VisIt being written in C++, no C++ dependencies
are introduced into the simulation by linking to the front-end library, which
is critical since many simulations are written in C and Fortran. Additionally,
by providing a C interface, the process of automatically generating bindings
to other programming languages, like Python, is greatly simplified. The sep-
aration into front-end and runtime library components also means that the
runtime library implementation is free to change as VisIt is upgraded, letting
the simulation benefit from these changes automatically, without relinking to
create a new executable. In addition, by deferring the heavyweight library
loading to runtime, there is effectively zero overhead and performance impact
on a simulation code linked with Libsim when the library is not in use.
Another beneficial aspect is the manner in which data are retrieved from
the simulations. First, as soon as an in situ connection is established, the sim-
ulation is queried for metadata containing a list of meshes and fields that the
simulation wishes to expose for analysis. The metadata comes from a function
in the adaptor layer. Just as in a normal VisIt operation, this list is trans-
mitted to the client, where users can generate plots and queries. Once the
user creates a plot and VisIt starts executing the plot’s data flow network, the
other functions in the simulation’s data adaptor layer are invoked to retrieve
only the data needed for the calculation. VisIt’s use of contracts (see 2.5.1)
ensures that the minimal set of variables will be exposed by the adaptor layer,
reducing any unnecessary data copying from converting variables that are not
involved in a calculation. Whenever possible, simulation array duplication is
avoided by including simulation arrays directly into the VTK objects, mini-
mizing the impact on the performance and scaling capabilities of simulation
codes.