Recent Changes - Search:

PmWiki

pmwiki.org

edit SideBar

Testing CERTI

Some problems and errors messages are explained here.

Testing CERTI in one computer (localhost) using HLA 1516E

CERTI provides a C++ billard demo for testing a HLA federation in $HOME/pthla/hla1516e/certi4-0.0/test/Billard/ folder. In some Linux

  • Open 3 terminals. If you did not sourced myCERTI_env.sh in your ~/bash_profile (~/.bashrc on Linux), run in each terminal the command above
  • Notice that after running myCERTI_env.sh, $CERTI_HOST=localhost
  • Go to the first terminal and execute the middeware RTIG:
  • Go to second terminal and call a billard federate named "1" (-n name) and HIT ENTER only once. A small white graphical interface representing a billard table pops out.

Remark: If the graphical interface does not appear, replace billard by billard-nogui in the commands below:

modern_billard -nTest1 -fTest
  • Do not HIT ENTER yet when the following message appears:
CERTI Billard 4.0.0 (...) Press ENTER to start execution...
  • Go to the third terminal and call a billard federate named "2" (-n name) and HIT ENTER.
modern_billard -nTest2 -fTest
  • The following message appears:
CERTI Billard 4.0.0 (...) Synchronization...
  • Go back to second terminal (where federate "1" was launched) and now press "ENTER".

If the demo works, the "billard table" shows the movement of two billard balls; In Terminal 3 you have several new messages including this one showing that an object instance of class Bille named "1" was discovered:

Discovered object handle = 2, name = 1

And in Terminal 2, this message showing that an object instance of class Bille named "2" was discovered:

Discovered object handle = 1, name = 2

There is also a Ptolemy billiard demo in $PTII/org/hlacerti/demo/Billard.

Remark: The rtig can run for different lauchings of a same simulation. But if a federation is not ended properly (destroyed) then a new run can provoke an error. In this case, you need to kill the rtig process, looking for his process number:

cardoso$ ps -ax | grep rtig
84699 ttys000 0:00.00 grep rtig
84695 ttys001 0:00.01 rtig
cardoso$ kill -9 84695
cardoso$ ps -ax | grep rtig
84727 ttys000 0:00.00 grep rtig

Testing CERTI in two computers with HLA 1516E

HLA standard targets distributed simulation, and so do CERTI, a HLA compliant tool.

  • In each computer, run in a terminal the command line ifconfig for having the name of the computer and/or its IP address.
  • Check if the two computers C1 and C2 are connected to a same LAN. Let us call their IP address IP1 and IP2, respectively. Notice that you can also use a ssh -X host-name.

Scenario 1: Launch the rtig in IP1, and all C++ billard federates in IP2.

  • Check if there is a firewall on port 60400 (PORT_TCP_RTIG) on each computer. The first command below is a succesfull test:
telnet host-name 60400
Trying ip-host-name...
Connected to host-name. Escape character is '^]'.
  • This message indicates there is a firewall that must be removed:
telnet host-name 60400
Trying ip-host-name...
telnet: connect to address ip-host-name: Connection timed out
  • If both computers succed to the test above, go to C2 and set CERTI_HOST as C1 (where the rtig run):
export CERTI_HOST=IP1
  • On C1: launch the rtig
  • On C2: Open two terminal, and launch the two C++ billard federates following the procedure above, except the first one (Launch RTIG in first terminal) since you already launched the rtig on C1.

If the simulation does not work, check the issue discussed here.

Scenario 2: Launching the rtig and a federate in IP1, and the other C++ billard federates in IP2.

  • On C1: Open 2 terminals. If you did not sourced myCERTI_env.sh in your ~/bash_profile (~/.bashrc on Linux), run in each terminal the command above
  • Notice that after running myCERTI_env.sh, $CERTI_HOST=localhost
  • Go to the first terminal and execute the middeware RTIG:
  • Go to second terminal on C1 and call a billard federate named "1" (-n name) and HIT ENTER only once. A small white graphical interface representing a billard table pops out.

Remark: If the interface does not appear, replace billard by billard-nogui in the commands below:

modern_billard -nTest1 -fTest
  • Do not HIT ENTER yet when the following message appears:
CERTI Billard 4.0.0 (...) Press ENTER to start execution...
  • On C2: open a terminal, set CERTI_HOST and call a billard federate named "2" (-n name) and HIT ENTER.
export CERTI_HOST=IP1
modern_billard -nTest2 -fTest
  • The following message appears:
CERTI Billard 4.0.0 (...) Synchronization...
  • Go back to the second terminal on C1 (where federate "1" was launched) and now press "ENTER".

If the demo works, the "billard table" shows the movement of two billard balls; In C2 you have several new messages including this one showing that an object instance of class Bille named "1" was discovered:

Discovered object handle = 2, name = 1

And in C1, Terminal 2, this message showing that an object instance of class Bille named "2" was discovered:

Discovered object handle = 1, name = 2

If the simulation does not work, check the issue discussed here.

Testing CERTI using HLA 1.3

CERTI still can be used with federates compliant with HLA l.3. Instead of a XML file, the FOM is represented in a FED file.

In the test above, just replace "modern_billard -nTest1 -fTest" by "billard -n1 -fTest -FTest.fed -t10"

and

"modern_billard -nTest2 -fTest" by "billard -n2 -fTest -FTest.fed -t10".

Notice that if you have a problem with X11, you must replace "billard" by "billard-nogui".

Problem: Gethostbyname gave NULL answer

In the message below, RTIA cannot resolve the name of the host computer. You should check if your hostname is correct and if the environment variable CERTI_HOST is correctly set to this computer:

RTIA:: RTIA has thrown NetworkError exception.
RTIA:: Reason: gethostbyname gave NULL answer for hostname <blablabla> with error <Undefined error: 0>
RTIA:: End execution.

This problem has been seen under Mac OS connected to the internet via a cable modem where the Mac has an address like 192.168.2.6 and hostname returns something like ealmac23.local.

One possibility is to run sudo hostname localhost, though this will cause problems with sharing, see macOS Sierra: Change your computer’s local hostname

Edit - History - Print - Recent Changes - Search
Page last modified on September 24, 2020, at 06:47 AM