The Roundtrip example allows the measurement of roundtrip duration when sending and receiving back a single message.
It consists of 2 units :
A message is sent by the ping executable on the "PING" partition, which the pong executable is waiting for. The pong executable sends the same message back on the "PONG" partition, which the ping executable is waiting for. This sequence is repeated a configurable number of times.
The ping executable measures:
Configurable:
Let's call OpenSplice_install_dir the OpenSplice installation directory.
The OpenSplice environment variables must be set in order for the examples to build/run correctly. To do this, open a terminal and source the "OpenSplice_install_dir/release.com" script supplied with the distribution.
Building the examples is described on the Summary page
Two executables are generated in the example directory when the example is built:
For ISO C++ 2
For C99
For C
Building the examples is described on the Summary page
Two jars are generated in the example directory when the example is built:
Ensure that the environment for OpenSplice is set up correctly as described above for each new terminal used.
It is recommended that you run the subscriber and publisher in separate terminals to avoid mixing the output
Running in single process (heap memory) configuration : the application starts OpenSplice middleware
Running in multiple process shared memory configuration
To enable deployment in this mode, an OpenSplice configuration file must be selected that has shared memory support e.g. one of the ospl_shmem xml configuration files found in the OpenSplice_install_dir/etc/config directory.
Starting ping and pong
Example of ping usage (parameters must be supplied in order):
c_RoundTrip_ping [payloadSize (bytes, 0 - 655536)] [numSamples (0 = infinite)] [timeOut (seconds, 0 = infinite)]
./c_RoundTrip_ping quit - ping sends a quit signal to pong.
defaults:
./c_RoundTrip_ping 0 0 0
To achieve optimal performance it is recommended to set the CPU affinity so that ping and pong run on separate CPU cores. You must have su privileges to run the following commands.
pong usage: taskset -c 0 chrt -f 80 ./pong ping usage: taskset -c 1 chrt -f 80 ./ping [payloadSize (bytes, 0 - 655536)] [numSamples (0 = infinite)] [timeOut (seconds, 0 = infinite)]
Let's call OpenSplice_install_dir the OpenSplice installation directory.
The OpenSplice environment variables must be set in order for the examples to run correctly. To do this open an OpenSplice Command Prompt which will set up the environment variables for OpenSplice automatically. The OpenSplice Command Prompt can be selected from the start menu. Alternatively, open a windows Command Prompt and execute the "OpenSplice_install_dir\release.bat" batch script supplied with the distribution.
Building the examples is described on the Summary page
Two executables are generated in the example build/bin directory when the example is built:
For C, C99 and ISO C++ 2
Building the examples is described on the Summary page
Two jars are generated in the example directory when the example is built:
Ensure that the environment for OpenSplice is set up correctly as described above for each new command prompt used.
The following steps describe how to run the examples:
Running in single process (heap memory) configuration : the application starts OpenSplice middleware
Running in multiple process shared memory configuration
To enable deployment in this mode, an OpenSplice configuration file must be selected that has shared memory support e.g. one of the ospl_shmem xml configuration files found in the OpenSplice_install_dir\etc\config directory.
Example ping usage (parameters must be supplied in order): c_RoundTrip_ping.exe [payloadSize (bytes, 0 - 655536)] [numSamples (0 = infinite)] [timeOut (seconds, 0 = infinite)] c_RoundTrip_ping.exe quit - ping sends a quit signal to pong. defaults: c_RoundTrip_ping.exe 0 0 0
To achieve optimal performance it is recommended to set the CPU affinity so that ping and pong run on separate CPU cores
Example pong usage: START /affinity 0 /high cmd /k "c_RoundTrip_pong.exe" Example ping usage: START /affinity 2 /high cmd /k "c_RoundTrip_ping.exe" [payloadSize (bytes, 0 - 655536)] [numSamples (0 = infinite)] [timeOut (seconds, 0 = infinite)]
There is a binary executable in examples/dcps/PerfomanceScripts which aims to run the selected ping and pong executables without prior configuration or command line arguments.
The executable by default will -
The executable requires -
Its also recommended that for best results the benchmark is run on a shared memory multiple process configuration.
The Roundtrip executable provides several command line options to manipulate the ping and pong processes, a short description of each is provided in the executable options -
# Roundtrip --help
Some common examples -
# Roundtrip
# Roundtrip -I
# Roundtrip -S -I
# Roundtrip -o somefile.csv
# Roundtrip --pingaffinity=0 --pongaffinity=4