Changeset 6702 for branches/1.7


Ignore:
Timestamp:
Sep 27, 2018 2:24:29 PM (6 years ago)
Author:
clarksm
Message:

Push empty <current> tags for rappture -execute to driver file
Examine HTTP headers to determine cache SQUID

Location:
branches/1.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.7/gui/apps/execute.tcl

    r6700 r6702  
    8282# copy structure.current.fields and structure.current.components
    8383foreach path [Rappture::entities -as path $driverobj input] {
    84     if {[$driverobj element -as type $path.current] eq ""} {
     84    if       {[$driverobj element -as type $path.current] eq ""} {
     85# if element has no current tag copy it
    8586        $toolobj copy $path from $driverobj $path
     87    } elseif {[$driverobj get $path.current] eq ""} {
     88# if element has current tag and it is empty and toolobj is missing the element
     89        if {[$toolobj element -as type $path.current] eq ""} {
     90            $toolobj copy $path.current from $driverobj $path.current
     91        }
    8692    }
    8793}
  • branches/1.7/lang/tcl/scripts/task.tcl

    r6700 r6702  
    226226
    227227    # Initialize job array variables
    228     array set _job { 
     228    array set _job {
    229229        control  ""
    230230        exitcode 0
     
    237237    }
    238238
    239     SetCpuResourceLimit 
     239    SetCpuResourceLimit
    240240    set driverFile [GetDriverFile]
    241241    set cached 0
    242242    if { [IsCacheable] } {
    243243puts stderr "Cache checking: [time {
    244         set cached [CheckForCachedRunFile $driverFile] 
     244        set cached [CheckForCachedRunFile $driverFile]
    245245     } ]"
    246246puts stderr "checking cache=$cached"
     
    674674        set _job(mesg) ""
    675675        return 1;                       # Success
    676     } 
     676    }
    677677
    678678    # Step 3. Execute the command, collecting its stdout and stderr.
     
    697697            if {$_job(exitcode) > 128} {
    698698                set logmesg "Program signaled: signal was [GetSignal $_job(exitcode)]"
    699             } else { 
     699            } else {
    700700                set logmesg "Program finished: non-zero exit code is $_job(exitcode)"
    701701            }
     
    756756            "cputime"  $times(cputime) \
    757757            "status"   $_job(exitcode)
    758         uplevel #0 $jobstats $args 
     758        uplevel #0 $jobstats $args
    759759    }
    760760
     
    847847#           "cputime"  $times(cputime) \
    848848#           "status"   $_job(exitcode)
    849 #       uplevel #0 $jobstats $args 
     849#       uplevel #0 $jobstats $args
    850850#   }
    851851
     
    859859            "cputime"  0 \
    860860            "status"   0
    861         uplevel #0 $jobstats $args 
     861        uplevel #0 $jobstats $args
    862862    }
    863863
     
    940940            "cputime"  0 \
    941941            "status"   0
    942         uplevel #0 $jobstats $args 
     942        uplevel #0 $jobstats $args
    943943    }
    944944
     
    960960        error "Can't create rappture library: $xmlobj"
    961961    }
    962     # Get the session from runfile 
     962    # Get the session from runfile
    963963    set session [$xmlobj get "output.session"]
    964964    if { [catch {exec submit --cache $session} result] != 0 } {
     
    984984        return 0
    985985    }
     986
     987#   puts stderr "ncode  = [http::ncode $token]"
     988#   puts stderr "code   = [::http::code $token]"
     989#   puts stderr "status = [::http::status $token]"
     990#   puts stderr "meta   = [::http::meta $token]"
     991
     992    foreach {key value} [::http::meta $token] {
     993        set headers([string tolower $key]) $value
     994        if { [string tolower $key] == "etag" } {
     995            set guid $value
     996        }
     997    }
     998#   puts stderr "SQUID = $headers(etag)"
     999#   puts stderr "SQUID = $guid"
     1000
    9861001    # If the code isn't 200, we'll assume it's a cache miss.
    9871002    if { [http::ncode $token] != 200} {
    9881003        return 0
    9891004    }
    990     # Get contents of the run file. 
     1005    # Get contents of the run file.
    9911006    set contents [http::data $token]
    9921007    if { $contents == "" } {
     
    9941009    }
    9951010
    996     # Create a new run.xml file and write the results into it. 
     1011    # Create a new run.xml file and write the results into it.
    9971012    set secs [clock seconds]
    9981013    set millisecs [expr [clock clicks -milliseconds] % 1000]
Note: See TracChangeset for help on using the changeset viewer.