Subsections


I. Getting Started

1. FlowVR Documentation

Several source of documentation are available:

2. FlowVR Installation

2.1 Downloading FlowVR

FlowVR is packaged in a software suite, called FlowVR Suite, containing FlowVR and several extensions like FlowVR-render.

Download the FlowVR Suite archive file (FlowVR-Suite-1.5.tar.gz or a more recent version) from:
http://flowvr.sf.net/FlowVRDownload.html.

Uncompress the archive file with the following command:



tar -xzf FlowVR-Suite-1.5.tar.gz


2.2 System Supported


2.3 Dependencies

FlowVR is a large software project which requires external dependencies to be resolved on your system. Hereby, we try to oblige to software that is commonly available for most popular Linux platforms or can be build from Open Source components.

2.3.1 Required Software

To compile and run FlowVR, the following tools are required:

These tools are generally available for the standard Linux distributions (Red Hat, Mandrake, Debian, etc.).


2.3.2 Strongly Advised Software

It is strongly advised to install:


2.3.3 Optional Software

The following tools are useful but do not prevent FlowVR and all its associated tools to be compiled, installed and used:

2.4 Compilation

We rely on CMake to configure and compile all components of the FlowVR Suite. In a first step, Cmake probes your machine and define the components that can be safely compiled, then it generates makefiles.

First create a build directory and call ccmake from this directory :



mkdir BUILD
cd BUILD
ccmake /path/to/SOURCE/dir  -DCMAKE_INSTALL_PREFIX:PATH=/path/to/INSTALLATION/dir


CMake launches a editor. From this editor, press 'c' to configure. Cmake displays a list of options that can be customized. The main options directly related to FlowVR all start with the BUILD prefix. For instance the BUILD_FLOWVR_RENDER enables to control if FlowVR Render should be compiled or not. . Press 't' to access the full list of all available options. Once done, press 'c' again and next press 'g' to generate the makefiles.

To compile:



make


Notice that you can customize a cmake variable directly from the command line. For instance to build FlowVR Render:



ccmake /path/to/SOURCE/dir  -DCMAKE_INSTALL_PREFIX:PATH=/path/to/INSTALLATION/dir  -DBUILD_FLOWVR_RENDER=1


Notice that beside makefiles, CMake can also generate KDevelop 3 project files or XCode project files (see the -G option)


2.5 Test

Once FlowVR compiled, test it launching a simple demo:



bin/flowvr-demo-tictac.sh


A common error at this point (the application refuses to launch) is due to the configuration of the OS that does not allow the allocation of a shared memory segment big enough, see SharedMemorySegmentSharedMemorySegment for hints on how to solve this problem.

This example lauches two modules, put and get. Put sends "tic", "tac" messages to get. The following messages should appear on the standard ouput:



...
Sent tic (it=0)
Received tic(it=0) from /put:text
Sent tac (it=1)
Received tac(it=1) from /put:text
Sent tic (it=2)
Received tic(it=2) from /put:text
Sent tac (it=3)
....


If GLUT has been installed, a second test application can be launched using:



bin/flowvr-demo-fluid.sh


It is an interactive fluid simulation with an OpenGL visualization, cp. figure [*]. Move the mouse to interact with the fluid. Click to add more density. Press the 'v' key to switch between density and velocity field views.
Figure: Screenshot of the interactive fluid simulation
Image capturefluid

2.5.1 Quitting the test applications

In order to quit the application, press enter, which will in term send kill signals to the processes launched. In case you push CTRL+C, some processes might still live and you have to tidy up yourself. You can use the script /bin/flowvr-kill for that. This script will inspect the directory $HOME/.flowvr where the deamon will store the PIDs of the currently running tasks on the machines. If you press 'q' in the FLUID window, the visualization will close, but still you have to press enter in order to kill all processes of the FlowVR application.

2.6 Installation

2.6.1 Make Install

To install:



make install



2.6.2 Environment Variables

All required environment variables (PATH, LD_LIBRARY_PATH, etc.) are set in the /path/to/INSTALLATION/dir/bin/*-config.sh and /path/to/INSTALLATION/dir/bin/*-config.csh files.

Before using FlowVR, execute one of the following command (depending on your shell) for a temporary working session, or include the adequate command in your environment configuration for a permanent installation directly:

2.6.3 Check the Installation

If FlowVR is properly installed the following command should find the flowvrd executable:



which flowvrd


and the two demos should run seamlessly.


3. A Simple FlowVR Application: Insights

This section presents a simple FlowVR application, its main components and all the steps needed to build and run it.

To design your own application we advise to start from the primes example and not this one.

3.1 Overview

We will start off with a closer description of the tic-tac example. This application has two modules. The first module (put) sends "tic" and "tac" messages on its output port, while the other module (get) receives these messages and prints them, cp. figure [*]. Data exchange between these modules follows the FIFO model.

Figure: tic-tac example application, both modules running on the same computer node
Image tictac-net

We present how to set up, compile and run this application in the following.


3.2 Directory Structure

All files related to this example (and we advise all FlowVR applications to follow the same organization) are stored in share/flowvr/examples/tictac/.

This directory contains:

Notice that once installed, the examples are stored in PATH/TO/INSTALLATION/DIR/share/flowvr/examples. In the current case this will resolve to http://www-id.imag.fr/FLOWVR/manual/flowvr-suite-src/flowvr/share/flowvr/examples.


3.3 Components

An application is a main component that recursively instantiates sub components. The TicTac application defines a TicTac component by inheriting from the Composite class (share/flowvr/examples/tictac/include/tictac/components/tictac.comp.h).

It instanciates three different components in the virtual method execute (share/flowvr/examples/tictac/src/tictac.comp.cpp).

These three components are instanciated and their ports linked to define the application:

The output port, id "text", of "put" is linked to the input port, id "in", of the connection "connect". The output port, id "out", of "connect" is linked to the input port, id "text", of "get".

Metamodules are specific components that associate a launching command to a set of modules. Both metamodules instanciated by TicTac inherits from the metamodule MetaModuleFlowvrRunSSH class (include/flowvr/app/components/metamoduleflowvr-run-ssh.comp.h). It uses the flowvr-run-ssh launcher, a simple ssh launcher specialized for FlowVR modules.

The MetaModulePut class defines the metamodule for launching the module ModulePut. In particular it sets the executable (CmdLine("put")) to call for starting this module (share/flowvr/examples/tictac/include/tictac/components/metamoduleput.comp.h).

The same is done for MetaModuleGet (share/flowvr/examples/tictac/include/tictac/components/metamoduleget.comp.h).

The last components to define are the put and get modules. They both inherit from the Module class (include/flowvr/app/components/module.comp.h) and define their output and input ports "text" (share/flowvr/examples/tictac/include/tictac/components/moduleput.comp.h and share/flowvr/examples/tictac/include/tictac/components/moduleget.comp.h).

More details about application design are given in the following.


3.4 Modules

The components ModulePut and ModuleGet are only the interface of the modules that are actually executed. The code of the put and get modules is defined in :

More details about module programming are given in the following.


3.5 Compilation

To compile the modules and the application we rely on Cmake. The TicTac examples comes with a simple utility script that set some variables when calling cmake, executing make and make install. Execute it from the TicTac directory:



./make-app.sh


This command produces:

3.6 Execution

We first execute the TicTac application on the machine the application is compiled, i.e. all application components run on the same local host.

3.6.1 Daemon Launching

FlowVR is daemon based. Therefore a daemon must be running on each node involved in FlowVR application, including the node where the application is launched from.

In case of a local execution, only one deamon need to run on the local machine. Execute:



flowvrd -top


The -top option enables to display top like data related to the application.


3.6.2 Shared Memory Segment

When launched, the daemon requests the OS to allocate a shared memory segment. The size of this segment has a default value.

It is common that the maximum shared memory segment the OS allowed is too small to run even the more basic FlowVR examples. See the documentation related to your OS to change this maximum size. For instance on a Linux machine, this max size is set in the /etc/sysctl.conf file with:



# Big SHM for FlowVR
kernel.shmmax = 838860800


If the size of the memory segment allocated by the daemon is too small for you application (especially if you have modules requesting large buffer allocations for messages), use the option -s to adjust this size. You should not have to change this default size for the TicTac example. Note that you might have to reboot your machine after adding this line to /etc/sysctl.conf.

See the section dedicated to the daemon for more informations about the daemon.

3.6.3 Application Launching

To launch the TicTac application (we assume you are in the tic-tac example directory) on the local machine, you first have to set the required environment variables executing for a sh/bash shell:



. bin/tictac-config.sh


or for a csh shell:


. bin/tictac-config.csh


The application starts executing:



flowvr  -localhost  -launch TicTac


To stop the application (not the daemon), enter:



stop


A common error, especially when several instances of FlowVR are installed, is to execute the application using the wrong module binary codes or loading the wrong library file. This happens if the environment variables are not correctly set.

The demo script bin/flowvr-demo-tictac.sh cleans environment variables before to set the correct ones. If TicTac runs with this script and not the instructions given in this section, you probably have a path issue.

If the application does not start or stop correcly, it can results in zombie processes polluting the machine. We provide a script to kill all these processes. To execute it run:



flowvr-kill


See flowvr-kill documentation for more informations about this script.

3.6.4 Application Graph

If you have installed the required software, you can generate an image of the application graph either through flowvr-graph or flowvr-glgraph.

flowvr-glgraph is an interactive network visualizer. To launch it loading the TicTac application:



flowvr-glgraph tictac.net.xml


The file tictac.net.xml is temporary file generated when launching the application.

flowvr-graph can be user to compute a static image. Simply write:



flowvr-graph -Tjpeg -o tictac.jpeg < tictac.net.xml


and open the file tictac.jpeg with your favorite image viewer.

3.7 Running the Application on 2 Machines

The two modules of TicTac can easily be executed each one on a different machine.

3.7.1 The cluster

Two machines are required. Let us call node1 and node2 these two machines (replace with the actual names of your machines). These machines should have:

The goal is to have an instance of the put module running on the remote host node2, and the get module running on the local host node1.

3.7.2 The application

The application does not have to be modified. Only the mapping of the modules on the hosts need to be specified correctly. This mapping is specified in the share/flowvr/examples/tictac/tictac.csv file. This file uses the cvs standard and so can be opened and modified with a spreadsheet editor, or a simple text editor. Each line corespond to a module to be mapped (identified with its fill id), while rows define the hosts where to start these modules. You should only replace the names pc1 and pc2 by your own host names.

3.7.3 Launching

Start a FlowVR daemon on both computers using:



flowvrd  -t -net


The -net argument tells the daemon to listen to network connections.

Start the application:



flowvr  -launch TicTac


2009-04-06