Automatic Setting of LM_LICENSE_FILE

The capability described in this section is useful when the same license is provided by more than license server.

Problem Description

In this example, there is a license called "spice" that is provided by two daemons:
  • The daemon 1234@lan.company.com has 3 licenses for LAN use
  • The daemon 9999@wan.company.com has 10 licenses for WAN use
In a typical setup, the scheduler is told to use first the LAN licenses and then the WAN licenses, and this is easily accomplished by setting the environment variable LM_LICENSE_FILE to the following value:
setenv LM_LICENSE_FILE 1234@lan:9999@wan 

For this example, the scheduler has decided that a given job should use a WAN license. When the job is launched, however a LAN license has just become available, and the tool actually checks out a LAN license instead of a WAN license.

This causes a problem: the double counting of the licenses in use:
  • One WAN license is considered in use by the scheduler (requested but not yet used).
  • One LAN license is actually in use (not requested but currently used).

In this situation, it would be desirable for the scheduler to decide that a job should use a WAN licenses and the value of LM_LICENSE_FILE should be only 9999@wan. However, if the scheduler chooses the LAN license, then the value of LM_LICENSE_FILE should be only 1234@lan. This arrangement works best if the license checkouts need to be queued by FlexNet Publisher.

The farm would work more efficiently if the value of LM_LICENSE_FILE were controlled at execution time on the basis of the resources grabbed for each individual job. A solution is described in the following section.

Solution: set VOV_LM_VARNAMES

If the environment variable VOV_LM_VARNAMES is set to a comma-separated list of names of environment variables, the "vw" wrapper will automatically set or prepend to each variable in the list with the list of license daemons that are associated with the resources that have been grabbed for the job.
Important: The functionality activated by setting the VOV_LM_VARNAMES environment variable is implemented by the VOV wrapper program vw2 and its aliases. Interactive jobs that have a PTY do not use this wrapper, so the VOV_LM_VARNAMES capability is only available for batch jobs.

A typical value of VOV_LM_VARNAMES is LM_LICENSE_FILE, but sometimes it is necessary to control other variables such as CDS_LICENSE_FILE (for Cadence tools). At times, it may be desirable to set VOV_LM_VARNAMES to another variable name which is then processed by one of the wrapper scripts.

There may be cases where it is desired to exclusively set license variables instead of prepending to existing values. To accomplish this, set the VOV_UNSET_VARNAMES environment to a comma-separated list of environment variables to unset and they will be unset before the vw wrapper populates them.

Following is an example of using this variable:
setenv VOV_LM_VARNAMES LM_LICENSE_FILE
More examples are shown below:
# Examples of uses of VOV_LM_VARNAMES
setenv VOV_LM_VARNAMES CDS_LICENSE_FILE
setenv VOV_LM_VARNAMES CDS_LICENSE_FILE,LM_LICENSE_FILE
setenv VOV_LM_VARNAMES MY_VAR

Job submission with VOV_LM_VARNAMES

In the example below, a feature called "abc" is provided by two FlexNet Publisher daemons, 1234@lan and 9999@wan. Both daemons are being monitored by Monitor, which uses tags "LAN" and "WAN" respectively. In turn, Accelerator, which is connected to Monitor, is aware of those two resources and has a resource map called "License:abc" which is the sum of "License:LAN_abc" and "License:WAN_abc". In Accelerator, License:abc maps to "License:LAN_abc OR License:WAN_abc". You want to push the utilization of the abc resource to the edge of saturation, so instead of defining LM_LICENSE_FILE to the value "1234@lan:9999@wan," let Accelerator control the value of LM_LICENSE_FILE by having an environment for the tool execution where the variable VOV_LM_VARNAMES is set to LM_LICENSE_FILE. Call the environment "MYENV". In the file MYENV.start.csh, you will have a line that says:
setenv VOV_LM_VARNAMES LM_LICENSE_FILE
To submit a job that uses "abc", enter:
% ves MYENV
% nc run -r License:abc -- abcTool ... 
In cases in which you absolutely want to use one of the daemons, specify the appropriate resource:
% nc run -e MYENV -r License:WAN_abc -- abcTool ... 

LM_VAR_NAME - deprecated

Note: Using LM_VAR_NAME is not recommended; it has been deprecated.

For backwards compatibility, the variable LM_VAR_NAME could be used to set the name of a single environment variable.

vovgetflexlmdaemons

In some situations, using other methods to set the LM_VAR_NAME variable on the fly may be preferred. The utility vovgetflexlmdaemons can be used to locate the daemons that need to be used based on the resources grabbed by Accelerator at dispatch time.


vovgetflexlmdaemons: Usage Message
  
  DESCRIPTION:
      Processes VOV_UNSET_VARNAMES, VOV_LM_VARNAMES, and/or LM_FILE_VAR
      environment variables and generates script for the specified shell that
      will unset the variables listed in VOV_UNSET_VARNAMES and then set
      LM_LICENSE_FILE to match the resources used by the job whose ID is in
      VOV_JOBID or those provided on the command line.
  
  USAGE:
      % vovgetflexlmdaemons [OPTIONS] [RESOURCES]
      
  OPTIONS:
     -v              -- Increase verbosity
     -h              -- This help
     -sh             -- Specify the shell for the output script, default is csh
     -bash 
     -ksh
     -csh
     -tcsh
  
  EXAMPLES:
      % vovgetflexlmdaemons -h
      % vovgetflexlmdaemons 
      % vovgetflexlmdaemons -bash
      % vovgetflexlmdaemons -bash License:lic_drc
  
  EXAMPLE OUTPUT:
     ### With -bash option.
     LM_LICENSE_FILE=6306@mac05;
     export LM_LICENSE_FILE;
  
     ### With -csh option.
     setenv LM_LICENSE_FILE 6306@mac05
  
  USAGE IN SCRIPTS:
      eval `vovgetflexlmdaemons`;