Changeset 734
- Timestamp:
- May 12, 2007, 7:12:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/tool.tcl
r731 r734 194 194 # ...job is finished 195 195 array set times [Rappture::rusage measure] 196 puts stderr "MiddlewareTime: job=[incr jobnum] event=simulation start=$times(start) walltime=$times(walltime) cputime=$times(cputime) status=$status" 197 198 # 199 # Scan through stderr channel and look for statements that 200 # represent grid jobs that were executed. The statements 201 # look like this: 202 # 203 # MiddlewareTime: job=1 event=simulation start=3.001094 ... 204 # 205 set subjobs 0 206 while {[regexp -indices {(^|\n)MiddlewareTime:( +[a-z]+=[^ \n]+)+(\n|$)} $job(error) match]} { 207 foreach {p0 p1} $match break 208 if {[string index $job(error) $p0] == "\n"} { incr p0 } 209 210 catch {unset data} 211 array set data { 212 job 1 213 event simulation 214 start 0 215 walltime 0 216 cputime 0 217 status 0 196 197 if {[resources -jobprotocol] != "submit"} { 198 puts stderr "MiddlewareTime: job=[incr jobnum] event=simulation start=$times(start) walltime=$times(walltime) cputime=$times(cputime) status=$status" 199 200 # 201 # Scan through stderr channel and look for statements that 202 # represent grid jobs that were executed. The statements 203 # look like this: 204 # 205 # MiddlewareTime: job=1 event=simulation start=3.001094 ... 206 # 207 set subjobs 0 208 while {[regexp -indices {(^|\n)MiddlewareTime:( +[a-z]+=[^ \n]+)+(\n|$)} $job(error) match]} { 209 foreach {p0 p1} $match break 210 if {[string index $job(error) $p0] == "\n"} { incr p0 } 211 212 catch {unset data} 213 array set data { 214 job 1 215 event simulation 216 start 0 217 walltime 0 218 cputime 0 219 status 0 220 } 221 foreach arg [lrange [string range $job(error) $p0 $p1] 1 end] { 222 foreach {key val} [split $arg =] break 223 set data($key) $val 224 } 225 set data(job) [expr {$jobnum+$data(job)}] 226 set data(event) "subsimulation" 227 set data(start) [expr {$times(start)+$data(start)}] 228 229 set stmt "MiddlewareTime:" 230 foreach key {job event start walltime cputime status} { 231 # add required keys in a particular order 232 append stmt " $key=$data($key)" 233 unset data($key) 234 } 235 foreach key [array names data] { 236 # add anything else that the client gave -- venue, etc. 237 append stmt " $key=$data($key)" 238 } 239 puts stderr $stmt 240 incr subjobs 241 242 # done -- remove this statement 243 set job(error) [string replace $job(error) $p0 $p1] 218 244 } 219 foreach arg [lrange [string range $job(error) $p0 $p1] 1 end] { 220 foreach {key val} [split $arg =] break 221 set data($key) $val 222 } 223 set data(job) [expr {$jobnum+$data(job)}] 224 set data(event) "subsimulation" 225 set data(start) [expr {$times(start)+$data(start)}] 226 227 set stmt "MiddlewareTime:" 228 foreach key {job event start walltime cputime status} { 229 # add required keys in a particular order 230 append stmt " $key=$data($key)" 231 unset data($key) 232 } 233 foreach key [array names data] { 234 # add anything else that the client gave -- venue, etc. 235 append stmt " $key=$data($key)" 236 } 237 puts stderr $stmt 238 incr subjobs 239 240 # done -- remove this statement 241 set job(error) [string replace $job(error) $p0 $p1] 242 } 243 incr jobnum $subjobs 245 incr jobnum $subjobs 246 } 244 247 245 248 } else {
Note: See TracChangeset
for help on using the changeset viewer.