14.4. EnShell

EnShell is a simple application in that it only performs a few tasks: it knows how to launch another application on the same computer; and, it knows how to communicate with other EnShells and applications linked with the EnShell library such as EnSight. Due to the complexities of remote computer access, security controls, queuing system integration, network restrictions, and other similar issues, EnShell does not know how to launch an application on a different computer. While a EnShell can ask a remotely connected EnShell to launch an application, it cannot launch a remote application by itself. Therefore, since EnShell cannot launch a remote EnShell by itself, it cannot start up a EnShell network by itself; this is the responsibility of the customer's site. This is actually a significant advantage since a site is free to launch a EnShell network however is appropriate for their environment.

Typically, one person at a site sets up the appropriate mechanisms for launching a EnShell network on a set of computers intended to run EnSight. Normally, this is done with a scripting language such as Python or CSH while taking into account a site's methods for remote job launch, authentication, resource allocation, etc.


Note:  While it is the site's responsibility for determining how to launch a EnShell network, Ansys Inc. and its distributors can advise on this task. Also, examples are provided that show typical setups.


EnShell Roles

EnShell has the concept of roles which are arbitrary names - strings - that are used to identify a EnShell. All EnShells have multiple roles including localhost, the computer's network name, the computer's short network name, and an auto-generated unique name. For example a EnShell running on a computer ale.bigcompany.com would have the roles: localhost, ale.bigcompany.com, ale, and enshell_000000. In addition to these, a EnShell may be assigned other roles by the user via command line options.

While roles don't signify anything special to the EnShell other than to give it specific names, they are used when determining where to launch a particular program such as an EnSight component. Some roles have special meaning to EnSight; specifically, names SOS, SERVER, SOS_SERVERS, COLLABHUB, and DRCLIENTS are significant. These roles are typically used to indicate where to run the various EnSight components. When EnSight needs to launch another EnSight component, such as the EnSight Server, it queries the EnShell network for a EnShell that has the appropriate role. The EnShell that has the appropriate role is then asked to launch the EnSight component.

All EnShells have the role localhost. This acts as a fallback for when no other roles match what has been requested by an application. The auto-generated unique role, such as enshell_200002, is unique within a particular instance of a EnShell network. It is used to reference a particular EnShell. It is also noteworthy when debugging EnShell networks; the first digit indicates the EnShell's level below the root EnShell. The rest of the digits indicate the EnShell instance at that level.

Connecting EnShells Together

EnShells are connected together in a rooted tree without cycles meaning that EnShells have at most one parent and they can have zero or more children. The EnShell without a parent is the root EnShell and EnShells without children are leaf EnShells. Command line options parent and child can be used to indicate that a EnShell has a parent and/or one or more children, respectively. These two options take a URL that indicates how to make the connection to the associated parent and/or children.

URLs mimic syntax used by web URLs but with EnShell they describe the network connection parameters. They're used by the parent and child options as well as the -app and -cmdurl options (described later). URLs have many default values thus minimizing what must be specified. Their syntax is:

method://host?option1=value1&option2&option3=value

where method is either connect or listen, host is a hostname, and options/values are options recognized by the connection method.

For example, the URL connect://kepler?port=8999&timeout=-1 indicates that a TCP/IP connection should be made to host kepler on port 8999 and an infinite timeout should be used; whereaslisten:// indicates that a TCP/IP listen() should be used on the default port (port 1106 for parent and child connections or port 1109 for app and cmdurl connections) with a default timeout of 90 seconds.


Note:  The '?' and '&' may need to be escaped using the '\' character and/or quoted depending on the command interpreter shell (for example, csh, sh, cmd.exe, Python).


Connecting EnShell and EnSight

A EnShell that has the app option specified listens for connections from EnSight (or any other application linked with the EnShell library). While not a requirement, this option is typically only specified to the EnShell running on the computer intended to run the EnSight Client. The -app option takes an optional URL as previously described. Specifying the EnSight command line option -enshell, which also takes an optional URL, instructs EnSight to connect to a EnShell that has the corresponding -app option (see Command Line Start-up Options). It also tells EnSight to use EnShell for all other component launching. Furthermore, EnSight components will connect to each other using the same network connection parameters specified to the associated EnShells via their -child and -parent options. These are in lieu of EnSight legacy connection parameters. This allows the same TCP/IP tunneling (for example, ssh tunnels) to be used for both EnShell and EnSight. Furthermore, EnSight has been enhanced to allow TCP/IP connections in either direction when using EnShell; the EnSight Client can now connect to the EnSight Server as well as in the opposite direction, which is the historical method.

Additionally, EnSight components can communicate with each other through tunneled communication via the connected EnShells. This happens automatically when needed. An example of this would be running the EnSight Client on a desktop that needs to connect via a login computer before connecting to a remote cluster on an internal LAN where it is desired to run the EnSight Server. By running EnShells on these three computers, communication can automatically be tunneled for the EnSight Client and Server through EnShell connections.

EnShell Command Line

Running enshell without options shows EnShell command line syntax along with default values. The following output is displayed:

usage: /usr/local/CEI/apex242/machines/linux_2.6_64/enshell [options]
-app [<url>]         #       connect to application
-child [<url>]       #       add child enshell
-cmd <cmd>           #       quoted command to send to another enshell
-cmdurl [<url>]      #       connect to enshell's app url
-debug <logfile>     #       write debug output to logfile
-display <name>      #       display name to use with DRCLIENTS
-end_after_ensight   #       exit when ensight exits
-i                   #       interactive mode
-parent <url>        #       connect to parent enshell
-role <tag>          #       add new role tag
-security <n>        #       specify a security number
-v #                 #       verbose output (1=low, 2=medium, 3=high)
-V                   #       Version
url:
connect://host?option1&option2&option3 
listen://?option1&option2&option3 
options:
nconnections=N       #        default 1
port=N               #        default 1109 for app otherwise 1106 sockbufsize=N   # default system dependent
timeout=N            #        default 90 seconds for connect;
                     #        unlimited for listen

The set of commands that EnShell supports for the -cmd command-line option follows.


Note:  This set may change in future releases of EnShell.


add_child
add_parent
add_role
add_role_to_child
cd
change_role
delete_role
dump
dump_urls
exit
get_net
is_app_running
is_enshell_running
ls
ping
play
pwd
quit
run_cmd
run_cmd_xml
show_jobs
show_net
show_roles
test_net
test_root_cmd
terminate_all
terminate_app
terminate_enshell
terminate_job
trace_route