2.1.2 Running the GUI Remotely (GUI host and Ccaffeine host are Distinct)

There are two different mechanisms to run the GUI remotely:

Using X11 on GUI host :
If you have an X11 server on GUI host , you can use the  run-gui.sh command on Ccaffeine host and let X11 take care of the graphics. However many users find the performance unacceptable using this approach, especially over slower network connections. In that case, try the method below.

Using a socket connection:
In this case, you run the GUI locally on GUI host (it is a Java application, and works on Linux/unix, Mac, and Windows platforms) and connect to the remote framework on Ccaffeine host over a TCP/IP socket.

Image tipTip

Connections between the GUI and the framework can be tunneled through an ssh connection. This may help in cases where firewalls or other network setups that prevent direct point to point connections (i.e. cluster compute nodes accessible only through the head node). See Appendix D and in particular Section D.3.

Image noteNote

This procedure requires that you have GUI on your GUI host . This includes the simple-gui.sh (on Windows, simple-gui.bat) script and the ccafe-gui.jar file. In a normal build of the CCA tools, you can find these files in the $CCA_TOOLS_ROOT/lib directory. If you're participating ain an organized tutorial, they also have been made available on a web site or other more convenient location. No special installation procedure is required, but the script and the jar file do need to be in the same directory.

On Ccaffeine host :
First, launch the framework, using the Bocca -generated utility script for your project, telling it what port to listen on for the connection from the GUI:  utils/bocca-gui-backend.sh --port port_num. The script automatically initializes the framework with a palette consisting of all of the components in the Bocca project.

The port number must be in the range 1025-65535, and cannot be in use by another application on the host (if it is, you will get an error message; simply try another port). You must use the same port number for the framework and the GUI. In organized tutorials, you may be assigned a port to help reduce the chances of collisions. If so, please use it!

Image tipTip

Always make sure you're using the bocca-gui-backend.sh script generated for the particular project you're working on because they'll be initialized with different sets of components. In this chapter, the command is  $TUTORIAL_SRC/utils/bocca-gui-backend.sh, but in later exercises it will be different!

On GUI host :
Start the GUI locally by executing the simple-gui.sh (on Windows, simple-gui.bat) script, specify both the host and port the framework is listening on:  simple-gui.sh --port port_num --host Ccaffeine _host.

Image tipTip

If you invoke the simple-gui.sh (simple-gui.bat) script without arguments, the GUI will pop up a dialog box asking you to specify the hostname and port number to connect to. Filling in these dialogs quickly gets tedious, so you're better off using the command line. (In Windows, launch a Command Prompt window, and change directories to wherever you put simple-gui.bat and the GUI jar file.) In both Windows and most Linux/unix shells, you can simply use the $ \uparrow$ (up-arrow) key to recall the previous command to be executed again.

Image tipTip

We have on occasion observed problems with the Ccaffeine GUI interface hanging (most often while populating the palette as the GUI starts up). We think this is due to a subtle race condition in the GUI, which we haven't yet been able to isolate. The best advice seems to be to kill both the framework and GUI and try launching them again.

David E. Bernholdt [bek] 574-3147 2009-08-21