Changeset 637 for trunk/gui/scripts


Ignore:
Timestamp:
Mar 21, 2007 3:02:42 PM (17 years ago)
Author:
mmc
Message:

Fixed the way that tools are launched so that any "MiddlewareTime:"
statements that appear in the stdout from the underlying tool process
are extracted and fed up to the stderr of the overall Rappture job.
This allows us to take information from jobs farmed out to the grid
and report the information back up through Rappture to the middleware.

Start times reported by the underlying jobs are automatically offset
by the start time of the tool, and job numbers are offset by the job
number of the tool. So the tool should report job numbers and start
times relative to its own start, and Rappture will handle the rest.

File:
1 edited

Legend:

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

    r500 r637  
    157157        puts stderr "MiddlewareTime: job=[incr jobnum] event=simulation start=$times(start) walltime=$times(walltime) cputime=$times(cputime) status=$status"
    158158
     159        #
     160        # Scan through stderr channel and look for statements that
     161        # represent grid jobs that were executed.  The statements
     162        # look like this:
     163        #
     164        # MiddlewareTime: job=1 event=simulation start=3.001094 ...
     165        #
     166        set subjobs 0
     167        while {[regexp -indices {(^|\n)MiddlewareTime:( +[a-z]+=[^ \n]+)+(\n|$)} $job(error) match]} {
     168            foreach {p0 p1} $match break
     169            if {[string index $job(error) $p0] == "\n"} { incr p0 }
     170
     171            catch {unset data}
     172            array set data {
     173                job 1
     174                event simulation
     175                start 0
     176                walltime 0
     177                cputime 0
     178                status 0
     179            }
     180            foreach arg [lrange [string range $job(error) $p0 $p1] 1 end] {
     181                foreach {key val} [split $arg =] break
     182                set data($key) $val
     183            }
     184
     185            puts stderr "MiddlewareTime: job=[expr {$jobnum+$data(job)}] event=subsimulation start=[expr {$times(start)+$data(start)}] walltime=$data(walltime) cputime=$data(cputime) status=$data(status)"
     186            incr subjobs
     187
     188            # done -- remove this statement
     189            set job(error) [string replace $job(error) $p0 $p1]
     190        }
     191        incr jobnum $subjobs
     192
    159193    } else {
    160194        set job(error) "$result\n$errorInfo"
Note: See TracChangeset for help on using the changeset viewer.