User Tools

Site Tools


connect_inet_to_mpi

Connect INET to MPI

OMNeT++ is a public-source discrete event simulation environment. INET is a framework for OMNeT++ to simulate the IP stack. We enhanced INET and added support for SCTP and an interface to connect the simulation to real networks. Those two features are included in the public INET version. Another interface that connects the upper layer to real applications has been integrated but has not been published yet. These interfaces have been used to send data coming from several real upper layer processes, like MPI, to the simulation and back to the application.

To set up INET with the possibility to use real applications proceed as follows:

Download and unzip sctpapp.zip

Copy the files to inet/src/applications/sctpapp. Download and unzip ipctest.zip

Copy the directory to inet/examples/sctp.

  • Build INET
    • make makefiles
    • make
  • Build the programs in inet/src/applications/sctpapp/SCTPlikeAPI by typing 'make'.

In this version two algorithms that have influence on the time synchronization between the simulation and the real applications have been implemented. Their type has to be set in inet/examples/sctp/ipctest/omnetpp.ini for use in the simulation. Set tfType to 1 for STATIC_ALG and 2 for NO_TF_REAL_ALG. For the real applications the algorithm has to be set in inet/src/applications/sctpapp/sctplikeapi.h via the definition MYALGORITHM.

The STATIC_ALG needs a time factor. To be recognized in the simulation, it can be set in inet/examples/sctp/ipctest/omnetpp.ini to a value greater or equal to 1. For the real application it has to be set as environment variable (see the following example).

The NO_TF_REAL_ALG algorithm does not need a time factor.

For more information about the two algorithms, have a look at the following paper:

Irene Ruengeler, Michael Tuexen, Brad Penoff, and Alan Wagner. A New Fast Algorithm for Connecting the INET Simulation Framework to Applications in Real-time. In the fourth International ICST Conference on Simulation Tools and Techniques (SIMUTools 2011), March 2011

Before connecting to real MPI applications the setup can be tested with programs needing several hosts. To start an example with four hosts proceed as follows:

  • Change to inet/examples/sctp/ipctest
  • Type ./run -u Cmdenv
  • Open four other terminals.
  • Change in all four terminals to inet/src/applications/sctpapp/SCTPlikeAPI
  • In the first terminal type
    env SCTPLIKE_SLEEP_FACTOR=4 ./exampleappN 0 4 n 10240
  • In the next terminals change the 0 to 1, 2, and 3, respectively.

The SCTPLIKE_SLEEP_FACTOR is necessary to adjust the fast real applications to the slower simulation. In real MPI applications a small time factor might result in a change in the sequence of the messages. The time factor used when starting the applications must be equal to the one in inet/examples/sctp/ipctest/omnetpp.ini. If you want to change it, you have to do it in both places. You can play with the message size or set the parameter 'e' instead of 'n' to echo the message.

To change the algorithm to NO_TF_REAL_ALG you have to set tfType=2 in omnetpp.ini and sctplikeapi.h.

A custom version of MPICH2 is necessary to connect real MPI programs to execute on the simulated network. Download and tar zxf mpich2-mpinetsim.tgz (or from here may be faster).

  • You need to install autoconf 2.63 from http://ftp.gnu.org/gnu/autoconf/
  • Within the unzipped directory, do the following to build/install the custom MPICH2 for MPI-NetSim:
  • maint/updatefiles
  • mkdir build
  • cd build
  • ../configure –with-device=ch3:sctp –with-sctp=<path_to_SCTPlikeAPI_dir> –prefix=<path_to_install_dir> –disable-mpe
  • make
  • make install
  • put <path_to_install_dir>/bin in your PATH
  • Run “mpd -d”. This will probably fail the first time but the output on the screen tells you what you need to do to setup your .mpd.conf file. Once those steps are done after a failed attempt, repeat “mpd -d”.
  • Build the MPI example by doing the following:
    • cd INET6/src/applications/sctpapp/SCTPlikeAPI
    • make mpi
  • Run the mpi program with “mpiexec -np 2 ./exampleapp2mpi”
connect_inet_to_mpi.txt · Last modified: by admin