14.6. Using CEIStart

As can be seen from the previous examples, starting all the EnShells by hand can be tedious if more than a few are needed. A far more desirable approach is to use CEIStart (ceistart if using EnSight 2024 R2). It provides the user with a graphical interface for launching the EnShell network and then starting EnSight upon successful launch of the network.

To use CEIStart a site must do a few things. It must write a script, or equivalent, to launch the EnShell network; and, it must write the configuration file for CEIStart that indicates how to interface to the launch script. Typically, an individual does this for a site whereas users of EnSight simply use CEIStart.

CEIStart supports multiple launch scripts -- each with its own CEIStart configuration; and, the site can use these in anyway desired. For example, if a site has two clusters, it may have two launch scripts and two configurations -- one for each cluster. Each configuration can have an optional GUI control panel where users can select a variety of options as needed by the launch script. Alternatively, a site could decide to have just one launch script and configuration for both clusters where the choice of which cluster to use is just an option. Either approach works equally well.

Default CEIStart Configurations

EnSight 2024 R2 ships with two default configurations for ceistart: 'Remote Server' and 'Remote SOS'. These serve two purposes. First, they should work for many sites as-is; and, second, they serve as simple examples to show how to write a ceistart configuration and supporting EnShell launch scripts.

The 'Remote Server' configuration is used to launch EnSight in Client / Server mode with the EnSight Server running on a different computer than the Client (although the same computer or 'localhost' may be specified). This configuration prompts for the following: the remote computer name, the SSH command name, whether or not to use SSH tunneling, the user name on the remote computer, any additional options for EnSight, and a port number to use for communication. The configuration assumes using SSH syntax for launching the remote EnShell on the specified computer (ie. 'ssh [-l username] remote_computer "remote command"'). The actual command used is specified in the SSH cmd text box. On Linux or Macintosh computers this command is typically 'ssh' whereas on Windows computers a command such as 'plink.exe' must be specified. Note that ssh (or plink.exe) must be properly installed and configured for password-less authentication to the remote computer before using CEIStart. The Local EnShell port number is an auto generated, random TCP/IP port number used by EnShell and EnSight. Typically, the user need not specify nor change this number. This is used to prevent multiple users on the same computer from using the same TCP/IP port number.

The Remote SOS configuration operates very similarly to the Remote Server configuration except that it launches EnSight with the Client communicating to the EnSight SOS running on the Remote computer. This configuration prompts for the number of EnSight Servers to use -- all of which run on the same computer as the SOS. Even though all of the Servers will run on the same computer as the EnSight SOS, this may be advantageous if the 'Remote computer' is a multiprocessor computer. Optionally, EnSight Enterprise (formerly HPC+) may be toggled on. If used, EnSight runs in parallel compositing mode. The number of distributed Clients is specified along with whether or not software rendering should be used (known to EnSight as GLSW, or GL Software mode). Note that EnSight Enterprise (formerly EnSight SOS and EnSight HPC+) is a separately licensed product.

The Remote Server as well as the Remote SOS configurations are specified via the CEIStart configuration file. And if you wish to pass a server argument to EnSight, then simply put it on its command line. Any options not explicitly known to ceistart are passed to the EnSight application for normal parsing.

$CEI/ensight242/site_preferences/cei_server_configs.py


Note:  This file is overwritten each time EnSight is installed or updated. Modifications to this file will not be preserved. If a site wishes to delete these two CEIStart configurations, simply remove this file each time EnSight is installed or updated. Should a site wish to modify these two configurations, the site should provide new implementations via the following file.


$CEI/ensight242/site_preferences/site_server_configs.py

And remember to use the same configuration name(s).

Writing a Launch Script

The details of writing a launch script along with the choice of scripting language are entirely up to the site. However, Ansys tends to prefer Python since it is used extensively by Ansys software. More importantly, Python tends to ease cross-platform issues between Windows, Linux, and Mac OSX; with proper coding, Python launch scripts can be written to run on all platforms.

A launch script can be as simple or complex as needed. Frequently, launch scripts take optional parameters to customize their operation. Because CEIStart invokes the script, optional parameters should be of the following types: integer, float, string. Boolean values are represented by the integers 0 and 1.

A simple script that automates Example 2 from above would look like the following, if written in CSH syntax (CSH is used here instead of Python for brevity).


Note:  Note the use of the verbosity flag (-v 3), which can aid in debugging.


#!/bin/csh -f

enshell -v 3 -app -child &

ssh kepler "enshell -parent connect://ale -role SERVER" &

exit 0

The script as written has several limitations. First, it assumes that the EnSight Client (and first EnShell) will always run on computer ale. Second, it assumes that the EnSight Server (and second EnShell) will run on computer kepler. If this is all that is ever needed, then the script is adequate. However, with a bit of parameterization, the script becomes more flexible:

#!/bin/csh -f

if ($#argv != 1) then

echo "usage: ${0} <remotehost>"

exit 1

endif

set remotehost = $argv[1]

set clienthost = `hostname`

enshell -app -child &

set remotecmd = "enshell -parent connect://$clienthost -role SERVER"

ssh $remotehost $remotecmd &

exit 0

The above script is better. It takes as a sole command line argument the name of the remote computer. It also uses the system hostname command to determine the name of the computer the script is running on and uses this as the hostname that the second EnShell should connect back to. However, this approach is problematic if the computer the script is running on is not directly addressable by the remote computer (as is typically the case if the first computer is running on an external network behind a router). The following example improves this by reversing the connection; it instructs the local computer to connect to the remote computer.

#!/bin/csh

if ($#argv != 1) then

echo "usage: ${0} <remotehost>"

exit 1

endif

set remotehost = $argv[1]

enshell -app -child connect://$remotehost &

set remotecmd = "enshell -parent listen:// -role SERVER"

ssh $remotehost $remotecmd &

exit 0

Finally, one more modification should be made. If two users execute the above script at the same time and use the same remote host, then there is a chance that their connections can get crossed. Using different TCP/IP port numbers instead of the default will prevent this. The examples that ship with EnSight and EnShell show much more robust and comprehensive examples, written in Python, which illustrate how to take this into account along with other issues. It is recommended that a site either use "as-is" or start with the included examples.

Interfacing Launch Scripts with CEIStart

Once a launch script has been written and tested, CEIStart needs to be configured to use it. CEIStart reads configurations from two files:

$CEI/ensight242/site_preferences/site_server_configs.py

and

~/.ensight/user_server_configs.py (on Linux)

%HOME%\.ensight\user_server_configs.py (on Windows)

~/Library/Application Support/EnSight/user_server_configs.py (on Mac OS X)

If a configuration is identically named in both the site preference file and user preference file, the one in the user preference file takes precedence. EnSight ships and installs without either of these files to prevent overwriting site customizations. However, example files can be found here:

$CEI/ensight242/ceistart_configs/

The files contain several working examples along with documentation on how to create a configuration. See the files contained in that directory for details.

After the launch script has been written and tested, and after the CEIStart configuration has been written, then it is time to run CEIStart (ceistart) and test everything together before deployment to end-users.