Go to the first, previous, next, last section, table of contents.

### `ox_launch`, `ox_launch_nox`, `ox_shutdown`

`ox_launch([host[,dir],command])`
`ox_launch_nox([host[,dir],command])`
  :: Initialize OpenXM servers.
`ox_shutdown(id)`
  :: Terminates OpenXM servers.

return
  integer
host
  string or 0
dir, command
  string
id
  integer

- Function `ox_launch()` invokes a process to execute command on a host host and enables Asir to communicate with that process. If the number of arguments is 3, ``ox_launch'` in dir is invoked on host. Then ``ox_launch'` invokes command. If host is equal to 0, all the commands are invoked on the same machine as the Asir is running. If no arguments are specified, host, dir and command are regarded as 0, the value of `get_rootdir()` and ``ox_asir'` in the same directory respectively.
- If host is equal to 0, then dir can be omitted. In such a case dir is regarded as the value of `get_rootdir()`.
- If command begins with ``/'`, it is regarded as an absolute pathname. Otherwise it is regarded as a relative pathname from dir.
- On UNIX, `ox_launch()` invokes ``xterm'` to display standard outputs from command. If `X11` is not available or one wants to invoke servers without ``xterm'`, use `ox_launch_nox()`, where the outputs of command are redirected to ``/dev/null'`. If the environment variable `DISPLAY` is not set, `ox_launch()` and `ox_launch_nox()` behave identically.
- The returned value is used as the identifier for communication.
- The peers communicating with Asir are not necessarily processes running on the same machine. The communication will be successful even if the byte order is different from those of the peer processes, because the byte order for the communication is determined by a negotiation between a client and a server.
- The following preparations are necessary. Here, Let `A` be the host on which Asir is running, and `B` the host on which the peer process will run.
  1. Register the hostname of the host `A` to the ``~/.rhosts'` of the host `B`. That is, you should be allowed to access the host `B` from `A` without supplying a password.
  2. For cases where connection to `X` is also used, let `Xserver` authorize the relevant hosts. Adding the hosts can be done by command `xhost`.
  3. If an environment variable `ASIR_RSH` is set, the content of this variable is used as a promgram to invoke remote servers instead of rsh. For example,

         % setenv ASIR_RSH "ssh -f -X -A "

     implies that remote servers are invoked by ``ssh'` and that X11 forwarding is enabled. See the manual of ``ssh'` for the detail.
  4. Some command's consume much stack space. You are recommended to set the stack size to about 16MB large in ``.cshrc'` for safe. To specify the size, put `limit stacksize 16m` for an example.
- When command opens a window on `X`, it uses the string specified for display; if the specification is omitted, it uses the value set for the environment variable `DISPLAY`.
- `ox_shutdown()` terminates OpenXM servers whose identifier is id.
- When Asir is terminated successfully, all I/O streams are automatically closed, and all the processes invoked are also terminated. However, some remote processes may not terminated when Asir is terminated abnormally. If ever Asir is terminated abnormally, you have to kill all the unterminated process invoked by Asir on every remote host. Check by `ps` command on the remote hosts to see if such processed are alive.
- ``xterm'` for displaying the outputs from command is invoked with ``-name ox_term'` option. Thus, by specifying resources for the resource name ``ox_term'`, only the behaviour of the ``xterm'` can be customized.

      /* iconify on start */
      ox_xterm*iconic:on
      /* activate the scroll bar */
      ox_xterm*scrollBar:on
      /* 1000 lines can be shown by the scrollbar */
      ox_xterm*saveLines:1000

    [219] ox_launch();
    0
    [220] ox_rpc(0,"fctr",x^10-y^10);
    0
    [221] ox_pop_local(0);
    [[1,1],[x^4+y*x^3+y^2*x^2+y^3*x+y^4,1],
    [x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],[x+y,1]]
    [222] ox_shutdown(0);
    0

`References`
  section `ox_rpc`, `ox_cmo_rpc`, `ox_execute_string`, section `ox_pop_cmo`, `ox_pop_local`, section `ifplot`, `conplot`, `plot`, `polarplot`, `plotover`

Go to the first, previous, next, last section, table of contents.