Interface FlowTracer with Accelerator
There are two ways to interface FlowTracer to Accelerator.
- With a binary interface capable of supporting multiple users. The jobs are injected directly into the memory of the Accelerator server, thus preserving safely the credentials (user, osgroup) of each job. This method bypasses the policy layers implemented as part of the nc run command, which may be a disadvantage in some cases.
- With a scripted interface limited to just one user, namely the owner of the FlowTracer project. This mode is similar to the one used to interface to LSF or SGE. The advantage of this approach is that the same nc run interface is used to submit the jobs, so all jobs are processed by all policy layer implemented as part of nc run.
Using the Binary Interface
FlowTracer provides an optimized implementation in C++ for the interface to Accelerator.
As discussed in Connect to a Third Party Batch Processing System, a Batch Processing System agent (BPS agent) is a vovtasker that connects to your FlowTracer vovserver and dispatches jobs to a backend Batch Processing System. You can start a BPS agent vovtasker from the command line by using the -V option of the vovtasker command, or you can define a BPS agent to Accelerator in taskers.tcl so that the BPS agent will be started when you start the FlowTracer project.
Start a BPS Agent from Command Line
% vovproject list -all -l | grep vnc
% vovtasker -V qname@host[:port]
where port
is optional and can be omitted if the port number of the Accelerator
server is the default one for the queue name.
vnc
, and is running on host alpaca
with the
default port 6271
. You can connect a BPS agent to the FlowTracer project and send jobs to this Accelerator server by:
% vovtasker -V vnc@alpaca # or
% vovtasker -V vnc@alpaca:6271
You can use other options of vovtasker to specify other attributes of your BPS agent. Among all the attributes, the default value of "capacity" for BPS agent is 100 while default for normal tasker is equal to the number of tasker machine's CPUs. You can override this default using the -T option. Usually you want to have a large capacity, because you want to give the BPS the ability to schedule jobs in the most effective manner. Capacities of 200 or 300 are typical.
Define a BPS Agent in taskers.tcl
In the taskers.tcl configuration file, you use vtk_tasker_nc to define a BPS agent to Accelerator. The syntax for it can be found in vtk_tasker_define.
% vovtaskermgr start name-of-BPS-agent
Unless you give it a different name, the name of the BPS agent will be
NC
. See instructions for The taskers.tcl File
for details.
Examples
test1@alpaca
, we now start a BPS agent which interfaces to
FlowTracer
vnc@alpaca
:
% vovtasker -V vnc@alpaca -a NC -r "se_license spice_license"
The above example is a FlowTracer project named
test1@alpaca
. There are two normal "direct" taskers
cheetah
and bison
already connected to it. The
Accelerator server vnc@alpaca
has 3 taskers, alpaca
, pluto
and
comet
. A BPS agent named NC
is started in the
context of test1@alpaca
, which connects it to Accelerator
vnc@alpaca
. The taskers of
vnc@alpaca
are represented as BPS taskers
prefixed with the name of the BPS
agent
in test1@alpaca
for easy monitoring and
management.
Handling Resources
The server managing the FlowTracer project uses its resource maps to determine which vovtasker should receive each job. When a job requests a floating resource, for example a license, that request needs to be passed through the BPS agent to Accelerator, so the job will not be started when the license is unavailable.
- If the number of resources is small, you can declare them using the -resources option of vtk_tasker_nc, or the -r option with the -V option of vovtasker on its command line.
- When the jobs in your FlowTracer project need many
different resources from Accelerator, you can use the
ncconfig.tcl file with the -F
option of vovtasker for the BPS agent.
You can start the BPS agent vovtasker
- with the vovtaskermgr command
- automatically with a liveness script
- manually from the command line
# Interface control file for NC dispatcher (-V) vovtasker for an FT project
#parray NCTASKER; # uncomment for troubleshooting
# Integer, controls debug messages
set NCTASKER(flag,debug) 0
# int, whether to show the farm tasker LEDs in the FT GUI
set NCTASKER(flag,show,taskers) 0
# BPS agent offers resources of this type from NC, e.g License:PrimeTime-SI
set NCTASKER(tasker,resources,resmap,types,export) {License}
# set NCTASKER(tasker,resources,resmap,types,export) {Priority}
# These are offered by the BPS agent in addition to the exported res from NC
set NCTASKER(tasker,resources) "NC linux sun7"
# set NCTASKER(job,resources,start) ""
# Resources to delete from jobs dispatched to NC
# set NCTASKER(job,resources,del) ""
# Resources to add to jobs dispatched to NC
# set NCTASKER(job,resources,add) ""
# set NCTASKER(job,group) ""
You can place this file in any convenient directory, but it is recommended to place it in the .swd of the FlowTracer project. This directory must be accessible to the FlowTracer project anyway, and the live_start_nctasker.tcl script expects it to be there.
When using the interface file with BPS taskers defined in taskers.tcl there is a shortcut that causes the file to be searched for first in the .swd of the FT project, and then in $VOVDIR/local.
vtk_tasker_nc -name NCbps -nccfg path-to-ncconfig.tcl
% vovtasker -V qname@host[:port] -F path-to-ncconfig.tcl
To setup your FlowTracer project so that an Accelerator BPS agent will start automatically whenever jobs need to be run in your FlowTracer project, set up the ncconfig.tcl file in your FlowTracer project's .swd directory. This is the only place where the standard liveness script looks for the interface file.
tasks
subdirectory of
your FlowTracer project's .swd
configuration directory. You may need to make the tasks
directory
there.% cp $VOVDIR/etc/liveness/live_start_nctasker.tcl `vovserverdir -p tasks`
To test whether it is working, retrace some jobs from your FlowTracer project. You may need to modify the jobs so that they request the resource 'NC' that is offered by the BPS dispatcher. They should become SCHEDULED (light blue color). A new vovtasker should appear, then the job will become dispatched (cream color) and then RUNNING (yellow), and finally VALID or FAILED.
% vovtaskermgr show -resources
The log file for the BPS dispatcher is in the usual place for tasker logs, in the directory .swd/logs/taskers/the-tasker-name.
Using the Scripted Interface
These taskers can be declared in the same way as the binary interface, except that you have to use the option -singleUser 1 in vtk_tasker_nc. The script $VOVDIR/etc/tasker_scripts/taskersVNC.tcl provides an interface to Accelerator.