Configure Taskers

The file taskers.tcl describes the vovtaskers for Accelerator.

vovtasker Configuration

You can find the file taskers.tcl in server configuration directory, default at $VOVDIR/../../vnc/vnc.swd/taskers.tcl, and in our test case at ~/ncadmin/vncdexin.swd/taskers.tcl.

This file is based on two commands (Tcl procedures), vtk_tasker_define and vtk_tasker_set_default:
# Set default behavior of vovtaskers 
vtk_tasker_set_default [options]

# Define a vovtasker 
vtk_tasker_define hostname [options]

If you set some options with vtk_tasker_set_default command, all the following vtk_tasker_define commands will use those options implicitly, and options set explicitly in vtk_tasker_define overwrite those set in vtk_tasker_set_default.

For example, to declare 3 vovtaskers on the hosts apple, orange, and pear, use:
# In taskers.tcl 
vtk_tasker_define apple 
vtk_tasker_define orange 
vtk_tasker_define pear
or some equivalent code:
# In taskers.tcl
foreach host {apple orange pear} { 
   vtk_tasker_define $host
}
To understand the use of vtk_tasker_set_default, define 3 vovtaskers as follows:
vtk_tasker_define apple -resources "@STD@ big_memory" -CPUS 2 
vtk_tasker_define orange -resources "@STD@ big_memory" -CPUS 2 
vtk_tasker_define pear -resources "@STD@ big_memory" -CPUS 4
vtk_tasker_set_default does the following:
vtk_tasker_set_defaults -resources "@STD@ big_memory" -CPUS 2 
vtk_tasker_define apple
vtk_tasker_define orange 
vtk_tasker_define pear	-CPUS 4

Tasker Configuration Examples

The default taskers.tcl provides pretty good examples of configuring vovtaskers. Most of the time, you just need to plug in some host names in brackets to define vovtaskers. For example, here is one piece of code in taskers.tcl.
# ADD THE NAMES OF THE COMPUTE SERVERS TO THE FOLLOWING LIST
set mainComputeServers {}

foreach host $mainComputeServers {
   vtk_tasker_define $host -resources "VovResources::Standard @RAMTOTAL@ @SWAPFREE@"
}
Note: -resources "VovResources::Standard" is equivalent to -resources"@STD@"
To add some "Server" class vovtaskers, you just need to add the names of those hosts into the list mainComputerServers, like the following:
set mainComputeServers { apple orange pear }
You can certainly add or modify the vovtasker definition as you want (subject to license restriction). For example, you have many dual CPU machines, and you would like to make the maxload of these vovtasker machines bigger, say, equal to 1.5 times of the CPUs, for example 3.0. Then you can do this:
set myDualCpuServers {}

foreach host $myDualCpuServers { 
    vtk_tasker_define $host -maxload   3.0    -resources "VovResources::Standard @RAMTOTAL@ @SWAPFREE@"
}

Add Workstation/Offhours vovtaskers

# Add a Workstation vovtasker that will only start to accept
# job after 10 minutes of ilde and will only accept jobs
# with expected duration no longer than 5 minutes
vtk_tasker_define ftcsun44 -resources "VovResources::Workstation -minIdle 10m -maxtime 5m @RAMTOTAL@"

# Add a Offhours vovtasker that's only available from 7pm to 6am
# every weekday and on weekends
vtk_tasker_define ftcsun66 -resources "VovResources::Offhours"

Start Newly Defined vovtaskers

Like other configurations, Accelerator will pick up the changes in taskers.tcl when the server is stopped and restarted. This is often too disruptive and not favorable, especially when there are jobs running in Accelerator. Here are some other ways to apply your changes:

  1. To start the vovtaskers that you just defined, use command:
    % ncmgr reset -taskers
  2. To start vovtaskers that you just modified, you must stop and start them.

Start/Stop vovtaskers (Advanced)

You can start/stop vovtaskers from the GUI and the browser.

The following is an advanced command of FlowTracer vovtaskermgr and how to run any command in the context of Accelerator using nc cmd.
# List all vovtaskers defined in taskers.tcl
# Also checks the taskers.tcl file for syntax errors
% nc cmd vovtaskermgr list

# Start all vovtaskers defined in taskers.tcl
% nc cmd vovtaskermgr start

# Start some vovtasker(s)
% nc cmd vovtaskermgr start tasker1 tasker2

# Stop all vovtaskers
% nc cmd vovtaskermgr stop

# Stop some vovtasker(s)
% nc cmd vovtaskermgr stop tasker1 tasker2

# Show detail information of all vovtaskers
% nc cmd vovtaskermgr show

# Get usage of all vovtaskermgr commands
% nc cmd vovtaskermgr

Start a vovtasker from Command Line (Advanced)

You can also start a vovtasker on the fly from the command line using the vovtasker binary. This can sometimes be handy, for example, for debugging. This is the command that Accelerator uses to start the vovtaskers after it reads the taskers.tcl configuration file.

  1. To start a vovtasker on a particular host, you need to go to that host and use command nc cmd vovtasker with appropriate options, which are similar to the options of vtk_tasker_define.
  2. Try the following examples and monitor the vovtaskers using the Monitor GUI or browser Tasker page.
    • Get usage of this command:
      usage: vovtasker [-A startupLogFile] [-a name] [-b capabilities] [-B]
                          [-c coefficient] [-C cpus] [-d] [-D integer]
                          [-e reserveExpr] [-E] [-f tclfile] [-F <file>]
                          [-g taskergroup] [-G group] [-h host]
                          [-H HEALTHCHECKFLAGS] [-i 0|1] [-I tclfile] [-j]
                          [-k d|n|v] [-K] [-l rootOfDailyLogFile] [-L <loadSensor>]
                          [-m <integer>] [-M max_load] [-n <integer>] [-N] [-o local
                          resources] [-p project] [-P <double>] [-q <hardbound>]
                          [-Q <softbound>] [-r resources] [-R resources] [-s]
                          [-S resources] [-t timeout] [-T capacity[/max_capacity]]
                          [-U <CSV list of timeSpecs>] [-v number]
                          [-V ncName@ncHost[:port]] [-w WX properties] [-W Tasker is
                          a member of a union.] [-x Experimental; do not use.] 
                          [-z <timeSpec>] [-Z <timeSpec>]
         -A:         The name of startup log file
         -a:         Name this tasker. The name may contain only letters, numbers,
                     dash(-) and underscore(_),  or the expressions @HOST@ and @PID@
                     that get expanded on the fly
         -b:         Comma-separated list of capabilities, case insensitive:
                        symbolic: FULL NC LM
                        normal  : PROCINFO NETINFO EXEC RT
                        short   : P N X R
                     
         -B:         Show BPS tasker objects. Default to not show.
         -c:         Tasker coefficient (positive, default 1.0)
         -C:         Number of CPU's in this machine (automatic on win64). Use 0 to
                     specify default value.
         -d:         Activate debugging
         -D:         Min disk space in MB in /tmp and /usr/tmp (default 5)
         -e:         Reserve tasker from the beginning: format of reserveExpr is
                     either the old 'GroupName/UserName/Duration' or the new list of
                     'keyword value' pairs where the keywords are USER GROUP
                     JOBCLASS JOBPROJ BUCKET ID DUR TRANSIENT. -e "JOBCLASS c1 DUR
                     1d TRANSIENT 1" will reserve the tasker for JOBCLASS c1 for 1
                     day. When the tasker disconnects,the reservation will be
                     removed as well
         -E:         Use vovfire to execute jobs: valid for direct taskers only.
                     Disables caching of environments
         -f:         Source the given Tcl file
         -F:         ncTasker config file.
         -g:         Set the taskergroup for this tasker
         -G:         Specify Fairshare Group used by an indirect tasker. Use with -V.
         -h:         Host    (default is env. var. VOV_HOST_NAME)
         -H:         Select health checks you want:
                       P / p     Enable/Disable portmap check
                       D / d     Enable/Disable disk space check
                       W / w     Enable/Disable writability for /tmp and /usr/tmp
                       U / u     Enable/Disable user script check
                        ($VOVDIR/local/tasker/health_user_script.sh)
                      Example:  -H pDWu  
         -i:         Make the tasker transient (-i 1) or persistent (-i 0). If a
                     tasker is transient (the default), it is destroyed when the
                     client disconnects. Persistent taskers must be 'indirect'
                     taskers (see -I flag).
         -I:         Indirect execution mode. The argument indicates the file that
                     describes the procedures to start and stop jobs indirectly. See
                     the Reference Manual for more info. If the argument is just a
                     dash '-' the option is ignored.
         -j:         Disable job statistics (useful on machines with lots of CPUS)
         -k:         Specify autokill mode (d=direct, n=ncstop, v=vovstop). Default
                     'd'
         -K:         Use Quick Connect
         -l:         Specify root of daily log file. The actual logs will be of the
                     form FFFF_YYYY.MM.DD.log. Also closes stdin.
         -L:         Specify a SGE-like Load Sensor
         -m:         Maximum number of jobs allowed to run on tasker.
         -M:         Maximum allowed load on the tasker host. The default value for
                     max_load is CAPACITY+0.5. Use 0 or less than 0 to specify
                     default value. Use N or CAPACITY[-+*/]N to make adjustments
                     from the default. Examples: -M 12.0, -M CAPACITY+2, -M
                     CAPACITY*2
         -n:         Run in nice mode with lower CPU priority
         -N:         Normal tasker. Same as -r @STD@
         -o:         Local resources (vovwxd internal)
         -p:         Project (default is env. var. VOV_PROJECT_NAME)
         -P:         Specify raw power of tasker, instead of computing it
                     automatically.
         -q:         Dispatch only autokill job to hardbound tasker tasker.
         -Q:         Dispatch autokill and xdur job to softbound tasker tasker.
         -r:         Resources for this tasker. This can be either a list of
                     resources or a Tcl expression that calls a procedure in the
                     VovResources:: namespace. To simplify scripting, it is also
                     possible to encode the resource string with base64 and pass the
                     encoded string XXXX with -r base64:XXXX (i.e. no need to quote
                     spaces in argument to -r option)
         -R:         Resources appended to the jobs by the agent. Use only with -V
         -s:         (OBSOLETE) Silent mode. Also closes stdin.
         -S:         Resource filter on what NC taskers to attach to the agent. Use
                     only with -V
         -t:         Try multiple times to connect to server. Give up only after
                     'timeout' seconds.
         -T:         Specify capacity and optionally the max-capacity of the tasker.
                     The capacity is the maximum number of jobs that can be run by
                     tasker. The max_capacity is the maximum slots a tasker can be
                     expanded to have when jobs are suspended. The default value for
                     capacity is equal to the number of CORES present. The default
                     value for max_capacity is 2*CAPACITY. Use -1 or 'auto' to
                     specify the default. Use N, N/N, CORES[-+*/]N, CORES[-+*/]N/N,
                     N/CORES[-+*/]N, CORES[-+*/]N/CORES[-+*/]N to make adjustments
                     from the default. Examples: -T 4, -T 4/8, -T AUTO/1000, -T
                     CORES-2, -T CORES*0.8, -T CORES+0/20, -T CORES+2/CORES*2
         -U:         Update intervals for resources, tasker statistics, and job
                     statistics. The resources update interval is also known as the
                     tasker heartbeat. One (resources), two (resources,taskerStats),
                     or three (resources,taskerStats,jobStats) values may be
                     specified. Defaults: 60s,120s,30s
         -v:         Set verbose level (0-4): default 1.
         -V:         NetworkComputer indirect tasker
         -w:         Reserved for system use
         -W:         Reserved for system use
         -x:         Experimental; do not use.
         -z:         After being idle for given time, tasker exits.
         -Z:         After specified lifetime, tasker does not accept new jobs and
                     exits after completing active jobs.
    • Start a normal vovtasker (with all default settings):
      % nc cmd vovtasker -N
      vovtasker Jan 10 13:44:42
      Copyright © 1995-2025, Altair Engineering Linux/7.1 Jan 10 2025 10:00:59
      vnc@alpaca
      vovtasker Jan	10	13:44:42	Test	1: INTEGER OPS	W= 1.00 Reps=	500 T=	5.00ms
      vovtasker Jan	10	13:44:42	Test	1: DOUBLE OPS	 W= 1.00 Reps=	25 T=	10.00ms
      vovtasker Jan	10	13:44:42	Test	1: CHAR	OPS    W= 0.10 Reps=	10 T=	10.00ms
      vovtasker Jan	10	13:44:42	----	Weighted time:	16.00ms		
      vovtasker Jan	10	13:44:42	Test	2: INTEGER OPS	W= 1.00 Reps=	500 T=	5.00ms
      vovtasker Jan	10	13:44:42	Test	2: DOUBLE OPS	 W= 1.00 Reps=	25 T=	10.00ms
      vovtasker Jan	10	13:44:42	Test	2: CHAR	OPS    W= 0.10 Reps=	10 T=	20.00ms
      vovtasker Jan	10	13:44:42	----	Weighted time:	17.00ms		
      vovtasker Jan	10	13:44:42	Test	3: INTEGER OPS	W= 1.00 Reps=	500 T=	5.00ms
      vovtasker Jan	10	13:44:42	Test	3: DOUBLE OPS	 W= 1.00 Reps=	25 T=	10.00ms
      vovtasker Jan	10	13:44:42	Test	3: CHAR	OPS    W= 0.10 Reps=	10 T=	20.00ms
      vovtasker Jan	10	13:44:42	----	Weighted time:	17.00ms		
      vovtasker Jan	10	13:44:42	Best	weighted time:	16.00ms		
    • Start a vovtasker with name "myvovtasker", max load 4.0, and offers standard resources "@STD@" and resource "special_license":
      % nc cmd vovtasker -a myvovtasker -M 4.0 -r "@STD@ special_license"
      vovtasker Jan 10 13:51:00
      Copyright © 1995-2025, Altair Engineering Linux/7.1 Jan 10 2025 10:00:59
      vnc@alpaca
      vovtasker Jan	10	13:51:00	Test	1: INTEGER OPS	W= 1.00 Reps= 500  T=	5.00ms
      vovtasker Jan	10	13:51:00	Test	1: DOUBLE OPS 	W= 1.00 Reps= 25   T=	5.00ms
      vovtasker Jan	10	13:51:00	Test	1: CHAR	OPS    W= 0.10 Reps= 10   T=      20.00ms
      vovtasker Jan	10	13:51:00	----	Weighted time:	12.00ms	
      vovtasker Jan	10	13:51:00	Test	2: INTEGER OPS	W= 1.00 Reps= 500  T=	5.00ms
      vovtasker Jan	10	13:51:00	Test	2: DOUBLE OPS	 W= 1.00 Reps= 25   T=	5.00ms
      vovtasker Jan	10	13:51:00	Test	2: CHAR	OPS    W= 0.10 Reps= 10   T=      20.00ms
      vovtasker Jan	10	13:51:00	----	Weighted time:	12.00ms	
      vovtasker Jan	10	13:51:00	Test	3: INTEGER OPS	W= 1.00 Reps= 500  T=	5.00ms
      vovtasker Jan	10	13:51:00	Test	3: DOUBLE OPS	 W= 1.00 Reps= 25   T=	5.00ms
      vovtasker Jan	10	13:51:00	Test	3: CHAR	OPS    W= 0.10 Reps= 10   T=      20.00ms
      vovtasker Jan	10	13:51:00	----	Weighted time:	12.00ms