Changeset 3625 for trunk/gui/apps
- Timestamp:
- Apr 4, 2013 5:18:19 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/apps/rptimes
r3624 r3625 9 9 # USAGE: 10 10 # % rptimes <run.xml> ?<run.xml>...? 11 # % rptimes -v <sqliteDB> 11 12 # 12 13 # Exits with status 0 if successful, and non-zero if any run.xml 13 14 # files cannot be processed. 14 15 # 15 # The SQLite DB created by this command contains the following data: 16 # 17 # CREATE TABLE times: 18 # tool ...... tool.id - app name of tool on nanoHUB (text) 19 # version ... tool.version.identifier - tool version (text) 20 # walltime .. execution wall time in seconds (double) 21 # cputime ... execution cpu time in seconds (double) 22 # user ...... output.user - user name (text) 16 # Creates an SQLite DB for each unique tool referenced by a run.xml 17 # file. Each DB file contains a table of parameters and a table of 18 # "jobs" info. The jobs table includes CPU time and Wall time 19 # measurements. 23 20 # 24 21 # ====================================================================== … … 40 37 if {[llength $argv] < 1} { 41 38 puts stderr "USAGE: rptimes run.xml ?run.xml...?" 39 puts stderr "USAGE: rptimes -v tool.sql3" 42 40 exit 1 41 } 42 43 set op "ingest" 44 while {[llength $argv] > 0} { 45 set flag [lindex $argv 0] 46 if {![string match -* $flag]} { 47 break 48 } 49 switch -- $flag { 50 -v { 51 set op "view" 52 if {[llength $argv] < 2} { 53 puts stderr "USAGE: rptimes -v tool.sql3" 54 exit 1 55 } 56 set dbfile [lindex $argv 1] 57 set argv [lrange $argv 2 end] 58 } 59 default { 60 puts stderr "bad flag \"$flag\": should be -v" 61 exit 1 62 } 63 } 43 64 } 44 65 … … 159 180 regsub -all {([^\'])\'} $str {\1''} str 160 181 return $str 182 } 183 184 # 185 # Handle "view" operation 186 # 187 if {$op eq "view"} { 188 sqlite3 db $dbfile 189 190 puts "PARAMETERS:" 191 db eval {SELECT nickName,rappturePath,type FROM parameters;} data { 192 puts " - $data(nickName) ($data(type)) = $data(rappturePath)" 193 } 194 195 puts "\nJOBS:" 196 set n 0 197 db eval {SELECT runToken,date,cpuTime,wallTime FROM jobs;} data { 198 puts [format " [incr n]) [clock format $data(date)]: %6.2f CPU, %6.2f Wall" $data(cpuTime) $data(wallTime)] 199 } 200 201 catch {db close} 202 exit 0 161 203 } 162 204
Note: See TracChangeset
for help on using the changeset viewer.