Changeset 731 for trunk/gui/scripts


Ignore:
Timestamp:
May 12, 2007 3:33:40 PM (17 years ago)
Author:
mmc
Message:

Fixed tool execution to honor the new "job_protocol" directive.
If job_protocol in the resources file is set to "submit", then
the job is exec'd as "submit --local ...", so the new submit
command can handle job execution and timing stats. We'll roll
this out for a few tools first. Eventually, all tools will use
"submit" and we'll remove the job_protocol entirely.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/tool.tcl

    r726 r731  
    4444    public proc setHubURL {name}  { set _resources(-huburl) $name }
    4545    public proc setSession {name} { set _resources(-session) $name }
     46    public proc setJobPrt {name}  { set _resources(-jobprotocol) $name }
    4647}
    4748
     
    5354        hub_name         Rappture::Tool::setHubName \
    5455        hub_url          Rappture::Tool::setHubURL \
    55         session_token    Rappture::Tool::setSession
     56        session_token    Rappture::Tool::setSession \
     57        job_protocol     Rappture::Tool::setJobPrt
    5658}
    5759                                                                               
     
    8284        return [array get _resources]
    8385    }
    84     if {![info exists _resources($option)]} {
    85         error "bad option \"$option\": should be [join [array names _resources] {, }]"
    86     }
    87     return $_resources($option)
     86    if {[info exists _resources($option)]} {
     87        return $_resources($option)
     88    }
     89    return ""
    8890}
    8991
     
    170172        set cmd [string trimleft $cmd " "]
    171173
     174        # if job_protocol is "submit", then use use submit command
     175        if {[resources -jobprotocol] == "submit"} {
     176            set cmd [linsert $cmd 0 submit --local]
     177        }
     178
    172179        # starting job...
    173180        Rappture::rusage mark
     
    177184            set job(output) [string range $cmd 5 end]
    178185        } else {
    179         set status [catch {eval blt::bgexec \
    180             ::Rappture::Tool::job(control) \
    181             -keepnewline yes \
    182             -killsignal SIGTERM \
    183             -onoutput [list [itcl::code $this _output]] \
    184             -output ::Rappture::Tool::job(output) \
    185             -error ::Rappture::Tool::job(error) $cmd} result]
     186            set status [catch {eval blt::bgexec \
     187                ::Rappture::Tool::job(control) \
     188                -keepnewline yes \
     189                -killsignal SIGTERM \
     190                -onoutput [list [itcl::code $this _output]] \
     191                -output ::Rappture::Tool::job(output) \
     192                -error ::Rappture::Tool::job(error) $cmd} result]
    186193        }
    187194        # ...job is finished
Note: See TracChangeset for help on using the changeset viewer.