Forcevalidate from command line

ForceValidating a job is not a simple task or a single command. 
This command creates output files when are missing, it marks the 'Why' tab of jobs approppriately
with information who ForceValidated a job and at what time.
Paste the code below into an executable csh script and specify the nodeId of the job
to ForceValidate.

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

namespace eval Aeware {
proc makeDashT { idList } {
    # Emulation of the make -t functionality.
    # We strongly discourage the use of this procedure!!
    # Then for each INVALID job, we set the job  to VALID
    # and we set all its outputs to valid as well.
    # Furthermore, we set the timestamp of the outputs to be
    # the same as the end time of the job.
    # The jobs that have been force-validated in this way
    # are recognizable because they have the property  FORCE_VALIDATE
    # Can deprecate this code on acceptance of ForcedExecution menu : ST 2013/5/15
    # ForceValidate should go away.
    set now   [clock seconds]
    set nowpp [clock format $now]
    set setid [vtk_set_create -client "tmp:[pid]"       ""]
    set ucid  [vtk_set_create -client "tmp:[pid]upcone" ""]
    vtk_set_operation $setid $idList ATTACH
    vtk_set_operation $ucid  $setid  UPCONE
    vtk_set_get $ucid setinfo
    set size $setinfo(size)
    # Given the node, we get the upcone and sort it by levels.
    set fmt "@LEVEL@ @NODETYPE@ @ID@ @STATUS@ @ENDED@"
    set count 0
    foreach elem [lsort -integer -index 0 [vtk_set_get_elements $ucid $fmt]] {
        set lv [shift elem];            # Discard level.
        set nt [shift elem];            # Node type. Only care about jobs
        if { $nt == "FILE" } continue
        set id [shift elem]
        set st [shift elem]
        set et [shift elem];
        if { $et == 0 } {
            set et $now
        switch $st {
            "FAILED" -
            "INVALID" -
            "SCHEDULED" {}
            default {
        # puts "CCCC FORCING JOB $id to become VALID"
        vtk_transition_get $id jobInfo
        set jobInfo(start) $now
        set jobInfo(end)   $now
        set jobInfo(host)  "force_validate"
        vtk_transition_set $id jobInfo

        vtk_node_change_status $id VALID THIS_NODE_ONLY
        # catch {vtk_prop_set -text $id "FORCE_VALIDATE" "Forced validation at $nowpp"}

        set ios [vtk_ios_get $id "@ID@ @DB@ @NAME@"]
        foreach output [lindex $ios 1] {
            set outid [shift output]
            set db    [shift output]
            set name  [shift output]
            if { $db == "FILE" } {
                set nax [vtk_path_expand $name]
                if { ! [file exists $nax] } {
                    set dir [file dirname $nax]
                    if [catch {file mkdir $dir} errmsg] {
                        VovError "Cannot create directory $dir: $errmsg"
                    } else {

            set fp [open $nax "w"]
                        if { $fp == 0 } {
                            VovError "Cannot create file $nax"
            puts $fp "### Created By VovGUI::ForceValidate  ###"
                        puts $fp "### Actually VovGUI::makeDashT        ###"
                        puts $fp "### On [clock format [clock seconds]] ###"
            close $fp
                # puts " make-t: utime $name"
                vtk_node_change_status $outid VALID THIS_NODE_ONLY
                if [catch {vtk_utime $nax $now $now} errmsg] {
                    VovError "Cannot vtk_utime $nax: $errmsg"
                } else {
                    vtk_place_update $outid
        # update idletasks
    vtk_set_forget $ucid
    vtk_set_forget $setid

proc ForceValidateNodes { sel } {

    if [catch { makeDashT $sel } errmsg] {
        VovError "Failed to run make-t on $sel: $errmsg"

    vtk_sanity_check 0 NODESTATUS

::Aeware::ForceValidateNodes $argv

Did you find this article helpful?