Track Job Commands

Each job has a field called tool, which is stored in the database and is used for reporting. This field is automatically computed to be the tail of the first command line argument that is not a known wrapper.

For example, if the command line is vw /bin/cp aa bb, the tool field has the value cp because vw is a wrapper and /bin/cp is the first argument that is not a wrapper.

Problem: The Number of Tools Explodes

Scripts may be generated automatically with unique names assigned to each script, containing elements such as timestamps or random seeds. This method affects the meaning of tool. It appears that each tool is used only once and there is a very large number of tools, which leads to excessively slow reporting times. In this scenario, the value of the field tool needs to be controlled.

Realizing a problem with tool often emerges late in the deployment of Accelerator. A solution for this problem has two components:
  • A post-processing script to modify the tool field in the SQL database. This script is called vovsql_normalize_field.
  • A facility to control the value of tool at job creation time using FDL. This only requires setting the variable make(tool) before the job is created.

The vovsql_normalize_field Utility

The utility vovsql_normalize_field changes the value of the toolid field in the jobs table in SQL. The recommendation is to use the utility is to create a configuration file called db_rename.tcl in the directory vnc.swd/db and then call the utility as follows:
% vovsql_normalize_field -file vnc.swd/db/normalize.tcl

This can also be done automatically with a liveness script (XXXXX TO BE DONE).

The file db_rename.tcl contains calls to a procedure called SQL_NC_FIX_TOOL which takes 2 parameters:
  • A regular expression to select the bad tool names. This expression is in SQL syntax; is must include the character '%' to match any substring.
  • The new value of the tool name. Using a simple name is recommended.
Example of *.swd/db/normalize.tcl file.
SQL_NORMALIZE_TOOL vrun%             VRUN
SQL_NORMALIZE_TOOL gen_script%seed%  SIM

Control the Tool Field at Job Creation Time

In Accelerator, control the tool field with the option -tool in nc run. In a job class definition, the value of the variable VOV_JOB_DESC(tool) can be set.
% nc run -tool SIM ./sim/sim_seed_123487897_ts_12122212_aa_to_bb
The tool field is also important from a scheduling point of view because the tool field can be associated with a resource map. In the following example, if there is a resource map called Tool:SIM, it will be honored for all jobs that have a tool value equal to SIM.
# In a jobclass definition file
...
set VOV_JOB_DESC(tool) "SIM"
...