IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26050


Ignore:
Timestamp:
Nov 6, 2009, 11:12:08 AM (17 years ago)
Author:
bills
Message:

Select host by stage_id if component == 'exposure' instead of using
random host causes files to not get overwritten in case of fault and revert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/dist.pro

    r26045 r26050  
    7474macro set.dist.workdir.by.component
    7575    # component template default varname
    76     if ($0 != 5)
    77         echo "USAGE: set.workdir.by.component (componentID) (template) (default) (varname)"
    78         break
    79     end
    80     local host component default template varname length start count component_id random_number
    81     $component = $1
    82     $template = $2
    83     $default = $3
    84     $varname = $4
     76    if ($0 != 6)
     77        echo "USAGE: set.workdir.by.component (stage_id) (componentID) (template) (default) (varname)"
     78        break
     79    end
     80    local host stage_id component default template varname length start count selector component_id random_number
     81    $stage_id = $2
     82    $component = $2
     83    $template = $3
     84    $default = $4
     85    $varname = $5
    8586    if ("$template" == "NULL")
    8687        echo "ERROR: WORKDIR template not set."
     
    9293        break
    9394    end
    94     if ("$component" != "exposure")
    95         # take last two letters of component id
    96         # treat it as an integer and use modulous of length of distribution hosts
    97         # to compute a host
    98         strlen $component length
    99         $start = $length - 2
    100         substr $component $start 2 index
    101         $component_id = $index % $count
     95    if ("$component" == "exposure")
     96        $selector = $stage_id
    10297    else
    103         # randomly chose one of the hosts
    104         $random_number = int(100 * rnd(0)) % $count
    105         sprintf component_id "%d" $random_number
    106     end
     98        $selector = $component
     99    end
     100    # take last two letters of selector
     101    # treat it as an integer and use modulous of length of distribution hosts
     102    # to compute an index into the host table
     103    strlen $selector length
     104    $start = $length - 2
     105    substr $selector $start 2 index
     106    $component_id = $index % $count
    107107
    108108    book getword ipphosts distribution $component_id -var host
     
    231231#    host anyhost
    232232
    233     set.dist.workdir.by.component $COMPONENT $OUTDIR_TEMPLATE ipp049 OUTDIR
     233    set.dist.workdir.by.component $STAGE_ID $COMPONENT $OUTDIR_TEMPLATE ipp049 OUTDIR
    234234    if ("$OUTDIR" == "NULL")
    235235        echo ERROR failed to set workdir for $COMPONENT
     
    355355    # using $DIST_ID as the "component" works fine here since we only look
    356356    # at the last two digits
    357     set.dist.workdir.by.component $DIST_ID $OUTDIR_TEMPLATE ipp049 OUTDIR
     357    set.dist.workdir.by.component $STAGE_ID $DIST_ID $OUTDIR_TEMPLATE ipp049 OUTDIR
    358358    if ("$OUTDIR" == "NULL")
    359359        echo ERROR failed to set workdir for $DIST_ID
Note: See TracChangeset for help on using the changeset viewer.