Environment Control

Setting the environment is critical for correct job execution. Accelerator provides two methods to control the execution environment.

  1. Use a snapshot of the environment used at submission time.
    This method is the simplest and is automatically selected if the environment variable VOV_ENV is not defined. The disadvantage of this method is that the snapshot may not be portable across platforms.
    Note: This method is not available for Windows.
  2. Use a named environment, which allows the tasker to create the environment on the fly using the VOV Environment Utilities.
    This method offers several advantages: strict control on the environment, greater efficiency, less disk space utilization, easier execution across multiple platforms. This method is used if the environment variable VOV_ENV is defined; the value of the variable indicates the name of the environment to use.
    Note: This method is required for Windows.

Use Environment Snapshots

An environment snapshot will be created and used under the following conditions:
  • The environment variable VOV_ENV is not set.
  • The environment variable VOV_ENV is set to the value "" (the empty string) or the value DEFAULT.
  • The environment variable VOV_ENV contains the substring SNAPSHOT.
The snapshot is represented by a file, the location of which is controlled by the environment variable NC_SNAPSHOTDIR. This variable can take one of the following symbolic values:
Possible values of nc_snapshotdir
homedir Use directory ~/.ncsnapshots/$VOVARCH
serverdir Use directory PROJECTNAME.swd/snapshots/$USER/$VOVARCH
any other value Use the directory $LOGDIR/snapshots/$USER/$VOVARCH, where LOGDIR is controlled by the variable NC_LOGDIR and has default value ./vnc_logs

The environment snapshot is a file in Bourne-Shell syntax, which contains most of the variables in the current environment. The variables that are excluded from the snapshot include the following: HOST OSREV OSTYPE TERMCAP SHELL PWD. These variables are defined in the file $VOVDIR/tcl/vtcl/vovenvutils.tcl

An environment snapshot may be shared by many jobs.

When using a snapshot, the job is submitted with environment SNAPSHOT(name_of_snapshot_file).
Note: This is a named environment.
To force the creation of an environment snapshot:
  • Ensure sure the environment variable VOV_ENV is not defined.
  • Do not use the option -e.
% unsetenv VOV_ENV
% wx run sleep 10
Resources= linux
Env      = SNAPSHOT(vnc_logs/snapshots/joe/linux/env4590.env)
Command  = vw sleep 10
Logfile  = vnc_logs/20020704/180936.7793
JobId    = 00350601
vnc: message: Scheduled jobs: 1       Total estimated time: 0s

Named Environments

The Accelerator Environment Utilities consist of two commands: vel, lists the available environments; ves switches between environments. For more information, refer to Environment Management.

The following example lists the available environments and switch to the environment called BASE.
% vel
vel: message: Environment directories:
1 /release/VOV/latest/sun5/local/environments
1 . tcl BASE            UNIX utilities, X windows, and VOV
1 . tcl D               Define vars: Usage: ves "+D(VAR1=value1,...)"
1 . tcl DEFAULT         Just a name for whatever you already have.
% ves BASE

Select a Named Environment

  1. When submitting a job, to select the environment in which to run the job, use the option -e. Examples are shown below:
    % wx run -e BASE sleep 10
    ...output omitted...
    % wx run -e BASE+SPICE sleep 10
    ...output omitted...
    % wx run -e "BASE+D(MYVAR=somevalue)" sleep 10
    ...output omitted...

Use Snapshot with Named Environment

  1. A combination of an environment snapshot and a name environment can be set up. Try the following example shows using the -e option to set up a combined environment with a SNAPSHOT plus a name environment CALIBRE:
    % wx run -e SNAPSHOT+CALIBRE sleep 10
    ...output omitted...
    % wx run -e SNAPSHOT+MODULE1+CALIBRE sleep 10
    ...output omitted...