nc run Command

The nc run command has built-in default features that include checking the validity of the run directory, enabling job profiling, etc. This section describes how the Accelerator administrator can use the file $VOVDIR/local/vncrun.config.tcl to modify some defaults.

This file does not exist by default; it must be created when needed.

The defaults for job characteristics are controlled by entries in the VOV_JOB_DESC array variable. The vncrun.config.tcl file is loaded after the defaults are set; these defaults can be overridden.

For additional information, refer to Define Jobclasses for details about VOV_JOB_DESC.

Examples

When submitting a job, the default is to check for a logical name (equivalence) for the filesystem where the run directory is located. This is controlled by the check,directory slot.

To change the default to not check the directory, add the following to the vncrun.config.tcl file:
set VOV_JOB_DESC(check,directory) 0
When submitting a job, the default is not collecting profile information, because the data can be large, unless the -profile option is used. To make profile collection the default setting, add following to the config file.
set VOV_JOB_DESC(profile) 1
An example file is included below that shows some other commonly-used settings:
# Example content of vncrun.config.tcl
set VOV_JOB_DESC(check,directory) 0

# Other settings that may be useful.
# set VOV_JOB_DESC(priority,default) [VncPolicyUserPriority $username]
# set VOV_JOB_DESC(priority,sched)   $VOV_JOB_DESC(priority,default)
# set VOV_JOB_DESC(priority,exec)    $VOV_JOB_DESC(priority,default)

# set VOV_JOB_DESC(autokill)      0
# set VOV_JOB_DESC(autoforget)    1
# set VOV_JOB_DESC(legalExit)     "0"
# set VOV_JOB_DESC(mailuser)      ""
# set VOV_JOB_DESC(wrapper)       "vw"
# set VOV_JOB_DESC(preemptable)   1
# set VOV_JOB_DESC(profile)       0
# set VOV_JOB_DESC(schedule,date) 0
# set VOV_JOB_DESC(xdur)          -1

Configure Callbacks with vnccallbackaction

In some jobclasses, it may make sense to call custom procedures:
  • Right after a job has been created, i.e. as soon as we know its VovId
  • Right after a job or set has been scheduled
This behavior is controlled by VncCallbackAction. The behavior of this procedure is documented by the following example:
# Example of a jobclass with custom callback to be invoked after the
# job has been created.

set VOV_JOB_DESC(resources) "unix RAM/100"
# ... other jobclass stuff


### Callback section.
proc MySpecialProcedure { jobId } {
   vtk_transition_get $jobId jobInfo
   if { $jobInfo(env) eq "SNAPSHOT" } {
      set jobInfo(env) "MYENV"
      vtk_transition_set $jobId jobInfo
   }
}

proc MySpecialCleanup { args } {
  VncCallbackAction del run post_create MySpecialProcedure
  VncCallbackAction del run finish      MySpecialCleanup
}


# VncCallbackAction verbose
# VncCallbackAction quiet
  VncCallbackAction add run post_create   MySpecialProcedure
# VncCallbackAction add run post_schedule MySomeOtherProc
  VncCallbackAction add run finish        MySpecialCleanup

Speed up nc run

The overhead in the nc run commands consists mostly in the on-demand compilation of Tcl code and secondarily on the number of round-trips to vovserver.

(Experimental feature) To amortize the Tcl compilation across multiple job submission, you can use the nc - option and then pipe a large number of run ... commands, as in the following example:
% mkfifo /tmp/vovfifo$USER.$$
% nc - < /tmp/vovfifo$USER.$$
% echo run hostname >> /tmp/vovfifo$USER.$$
To limit the number of round trips, you can define a number of environment variables that define semi-constant values, namely:
  • NC_URL: This is the main URL for the vovserver and is used to compute the full URL for each submitted job. If not defined, the code in nc run needs to query the server about the HTTP server name and the WEB port.
  • NC_DEFAULT_JOBCLASS: This is the name of the jobclass to be invoked by default. It can be set to the empty value. This is supposed to have the same value as
    `vovprop GET 1   NC_DEFAULT_JOBCLASS`
  • NC_VALID_DIRECTORIES: The value is a list of directories from which it is acceptable to submit jobs, all in addition to directories that contain the .vnc file. It can be set to the empty value. This is supposed to have the same value as
    `vovprop GET 1   NC_VALID_DIRECTORIES`
These variable can be set, for example, in the setup.tcl file:
# Fragment of the setup.tcl file
# Used to speedup nc run 
setenv NC_URL              https://nchost:6271
setenv NC_DEFAULT_JOBCLASS normal
setenv NC_VALID_DIRECTORIES ""