Find a job based on setname and jobname

FlowTracer does not guarantee a job is unique based on setnames and jobnames. However, in a specific usage scenario jobnames may be assigned such that they are unique for a given set. In this case a script like this can help find the job from a set with a specific name. Note the loop through all jobs that are part of the set and comparison with the name.

#!/usr/bin/csh -f
# -*- Tcl -*- \
    exec vovsh -f $0 $*:q

if { [llength $argv] != 2 } {
    VovError "usage: script setname jobname"
    return 1

set setname [lindex $argv 0]
set jobname [lindex $argv 1]

set setId [vtk_set_find $setname]
if { $setId == 0 } {
    VovError "set $etname not found"
    return 1

foreach jobiter [vtk_set_get_elements $setId "@ID@ @JOBNAME@"] {
    if { [lindex $jobiter 1] == $jobname } {
    set jobid [lindex $jobiter 0]
    VovMessage "found $jobid"
    return $jobid
VovMessage "job not found"
return -1

Did you find this article helpful?