vtk_set

vtk_set_cache

Usage:         
vtk_set_cache setId [OPTIONS]

Description:   
Cache a set given its id. 

Example: 
vtk_set_cache 13221 
vtk_set_cache 13221 -neighbors

vtk_set_cohort

Usage:         
vtk_set_cohort setId  boolean

Description:   
If the boolean is true, all jobs in the set will be considered a "cohort", meaning that the scheduler will favor those jobs over the others. 

Example: 
vtk_set_cohort 12345 1 
vtk_set_cohort 12345 0

Returns:       
Nothing

vtk_set_create

Usage:         
vtk_set_create [OPTIONS] setName, rule

Description:

Options:

* -transient ,to define the set as transient (no attach/detach events)
* -client ,to define the set as client-set (will be forgotten when client is closed)
* -universe SETID ,to define the universe set of the new set (default System:nodes)
* -smart ,to have The set updated automatically based on selection rule.
* -smartc ,to have a type of smart set computed only when a node is created.
* -expire timespec ,For smart sets, this is the time after which the sets are discarded.
* -noop ,Ignored option.
* -hier ,to create all intermediate sets required for the true set hierarchy, based on the name of the set. The intermediate sets preserve the -transient and -client flags if present.
   
If the set name begins with the string "@@@" or with the string "tmp:", the set is considered transient. 

Examples:
vtk_set_create All:linux "isjob resources~linux"
293383
vtk_set_create -transient tmp:upcone ""
293390
vtk_set_create -hier aa:bb:cc:dd  ""
221324
vtk_set_create -client myset:upcone ""
293397
vtk_set_create -smart -expire 2m "Smart:nclist" "isjob user==abc dir~/mytest/"
293399

Side Effect:
If an old set by the same name exists, it is destroyed.


Returns:       
The setId of the new set or an error message.

vtk_set_find

Usage:         
vtk_set_find setName

Description:   
Find a set by name. Returns the setId or 0 if the set does not exist. 

Examples: 
vtk_set_find "System:nodes" 
00000002 
vtk_set_find "bad_set_name" 
00000000


vtk_set_forget

Usage:         
vtk_set_forget [-elements] [-hier] [-geo] [-max MAX_NODE_FORGOTTEN]  setId

Description:   
Forget the set. If option -elements is specified, the elements of the set will be forgotten instead. If option -hier is used, forget subsets also. If option -hier and -elements are used together, forget all elements in the set and subsets. If the option -max is used, then up to MAX elements are forgotten. The option only has effect in conjunciton with the -elements option. 

Examples: 
vtk_set_forget -hier 29303 
vtk_set_forget -hier -elements 29303 
vtk_set_forget -elements 29303 
vtk_set_forget -elements -max 1000 29303 
vtk_set_forget -geo 29303 
vtk_set_forget 29303

Returns:       
'ok' if the set or its elements have been deleted, or 'error' if the set cannot be deleted because it is protected.

vtk_set_get

Usage:         
vtk_set_get [-usecache] setId [resultArray]

Description:   
Get information about a set of nodes. The procedure fails if it is passed an illegal setId. With just the setId this procedure returns a list consisting of the following elements: 

1. setName 
2. setSize 
3. selectionRule 
4. creationDateInt 
5. creationDateChars 

If the resultArray is provided, it is filled with similar information. 

Examples:
vtk_set_get 24242
All:linux 3617 {isjob resources~linux} {Tue Mar 11 20:53:37 2003}
vtk_set_get 3 setInfo
parray setInfo
setInfo(creationdate)           = 1049429350
setInfo(flag:automatic)         = 0
setInfo(flag:client)            = 0
setInfo(flag:intable)           = 0
setInfo(flag:protected)         = 1
setInfo(flag:protectedelements) = 0
setInfo(flag:transient)         = 0
setInfo(isempty)                = 0
setInfo(name)                   = System:jobs
setInfo(owner)                  = john
setInfo(rule)                   =
setInfo(size)                   = 19777


vtk_set_get_elements

Usage:         
vtk_set_get_elements setId  formatString [OPTIONS]

Description:   
Get a list of elements of the given set formatted according to the format string. The optional 'first' and 'last' arguments are in the range from 0, for the first element, to N-1 for the last elements in the set. Minus value will count from the end. 

Options: 
* -normal, not to show sub jobs or system jobs. 
* -subjobs, to include sub jobs. 
* -systemjobs, to include system jobs . 
* -alljobs, to include both system jobs and sub jobs as well. 
* -hier, to include all elements in subsets. 
* -subsets, to include subsets only, not elements. 
* -rule, to include all elements that satisfy rule. 
* -selrule, the same as -rule -first, to include all elements after the first index. 
* -last, to include all elements before the last index. 

Examples: 
set setId [vtk_set_find System:jobs] 
00000003 
# Get all elements 
vtk_set_get_elements $setId "@ID@ @STATUS@ @HOST@ @USER@ @COMMAND@ 
{03691207 VALID bison john vov updateVersionHeader buildVersion.tcl} 
{03691386 VALID noyce john vw cc -o pngrtran.o -c  pngrtran.c} 
... 
# Get the first 20 elements 
vtk_set_get_elements $setId} "@ID@ @STATUS@ @HOST@ @USER@ @COMMAND@ -first 0 -last 19 
# Get the last 20 elements 
vtk_set_get_elements {$setId} @ID@ @STATUS@ @HOST@ @USER@ @COMMAND@ -20 -1

Returns:       
A list of formatted element descriptions.

vtk_set_get_elements_chunks

Usage         vtk_set_get_elements_chunks 

Description   DEPRECATED

vtk_set_get_elements_enhanced

Usage         vtk_set_get_elements_enhanced 

Description   DEPRECATED. Please use vtk_set_get_elements.

vtk_set_get_or_create

Usage:         
vtk_set_get_or_create setname selectionrule

Description:   
If the set with setname exists, the procedure does vtk_set_find. If the set doesn't exist, it is the same as vtk_set_create.

vtk_set_operation

Usage:         
vtk_set_operation setId  nodeOrSetId  operation

Description:   
The first argument setId should be the ID of an existing set, which has been created by vtk_set_create. 

If operation is CONTAINS, ATTACH or DETACH, the second argument represent a list of node id's. 

If operation is UNION, INTERSECTION, COMPLEMENT, UPCONE or DOWNCONE the second argument must be the Id of a set. The COMPLEMENT operation is defined as the intersection of the second set with the complement of the first set. 

If operation is INPUTS, OUTPUTS, the second argument is the reference set, the first argument is the accumulator. 

If operation is CLEAR, the second argument is ignored. 

The parameter operation is case-insensitive.

Returns:       
1 if the operation returns OK, 0 otherwise. The return code is especially useful for the CONTAINS operation.

vtk_set_recompute

Usage:         
vtk_set_recompute [-hier] setId

Description:   
For sets with a selection rule, this procedure causes the server to recompute the set. 

Example: 
vtk_set_recompute 12345 
vtk_set_recompute -hier 12345

Returns:       
Nothing

vtk_set_rename

Usage:         
vtk_set_rename setId newSetName

Description:   
Rename the given set. 

The procedure fails if:
* the set does not exist
* the set is protected
* the new name is reserved
* there already exist a set by the same name.

vtk_set_report

Usage:         
vtk_set_report [-hier] setId which array

Description:   
Get a report by user, group, host, osgroup, jobclass or jobproj for a given set. 

Example: 
vtk_set_report 00012345 user reportInfo; parray reportInfo

vtk_set_set

Usage:         
vtk_set_set setId array

Description:   
array indices include name rule flag:transient flag:client flag:smart flag:smartc which are Set Name, Rule, Transient and Client flags for the given set. 

The procedure fails if:
* the set does not exist
* the set is protected
* the new name is reserved
* there already exist a set by the same name.

vtk_set_statistics

Usage:         
vtk_set_statistics [-hier] [-levels] setId [array]

Description:   
With just the setId argument, this procedure returns a list consisting of the following information: 
1. setStatus (see info on set status) 
2. number of nodes 
3. number of files 
4. number of jobs 
5. total duration for all jobs in the set 
6. number of jobs with unknown duration 
7. {file_status_desc} 
8 {job_status_desc} 

The two lists file_status_desc and job_status_desc consists of an even number of elements, in which the first element represent a node status and the second element is the number of nodes with that status. 

Examples:
vtk_set_statistics 3
FAILED 19777 0 19777 127510 1 {} {VALID 17170 INVALID 2595 FAILED 12 }
vtk_set_statistics 3 stats
parray stats
stats(duration)                 = 127510
stats(files)                    = 0
stats(files,BOGUS2)             = 0
stats(files,DELETED)            = 0
stats(files,EMPTY)              = 0
stats(files,FAILED)             = 0
stats(files,INVALID)            = 0
stats(files,MISSING)            = 0
stats(files,RETRACING)          = 0
stats(files,RUNNING)            = 0
stats(files,SLEEPING)           = 0
stats(files,UNKNOWN)            = 0
stats(files,VALID)              = 0
stats(jobs)                     = 19777
stats(jobs,BOGUS2)              = 0
stats(jobs,DELETED)             = 0
stats(jobs,EMPTY)               = 0
stats(jobs,FAILED)              = 12
stats(jobs,INVALID)             = 2595
stats(jobs,INVALID,scheduled)   = 17
stats(jobs,MISSING)             = 0
stats(jobs,RETRACING)           = 0
stats(jobs,RETRACING,suspended) = 0
stats(jobs,RUNNING)             = 0
stats(jobs,RUNNING,suspended)   = 0
stats(jobs,SLEEPING)            = 0
stats(jobs,UNKNOWN)             = 0
stats(jobs,VALID)               = 17170
stats(nodes)                    = 19777
stats(status)                   = FAILED
stats(unknown)                  = 1
stats(lastchange)               = 1076690458


vtk_set_subselect

Usage:         
vtk_set_subselect [OPTIONS] setNameOrId selectionRule

Description:   
Select a subset of the given set, according to the given selection rule. The original set can be specified either by name or by id. 

Options: 
* -name name_of_new_set, to specify the name of the new set, otherwise a default name is chosen. 
* -setname name_of_new_set, same as -name. 
* -transient, to label the new set as transient, in order to disable the generation of uninteresting events. 
* -client, to label the new set as private to the calling client. The set will be automatically deleted when the client exits. 
* -hier, to include all elements in subsets.

Returns:       
The id of the new subset.