IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11001


Ignore:
Timestamp:
Jan 9, 2007, 2:00:46 PM (19 years ago)
Author:
eugene
Message:

converting to book/page syntax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_00/ippTasks/phase2.pro

    r10758 r11001  
    66## queue keys are counted from 0
    77
     8# XXX change book names to match ippTool values?
     9# XXX replace with book init p2pending
    810queueinit Phase2Imfiles
    911if ($?network == 0)
     
    4749  task.exec
    4850    # command p2tool -pendingimfile -simple -limit {$Phase2ImfileFail + 20}
    49     command p2tool -pendingimfile -simple
     51    command p2tool -pendingimfile
    5052  end
    5153
    5254  # success
    5355  task.exit    0
    54     local i Nqueue
    55 
    56     # save stdout and stderr
    57 
    58     # compare output with Phase2Imfiles queue
    59     # only add entries which don't exist in queue
    60     queuesize stdout -var Nqueue
    61     for i 0 $Nqueue
    62       queuepop stdout -var line
    63       if ($VERBOSE > 2)
    64         echo $line
    65       end
    66       list word -split $line
    67       $EXP_TAG  = $word:0
    68       $CLASS_ID = $word:1
    69       $URI      = $word:2
    70       queuepush Phase2Imfiles -uniq -key 1:2 "NEW $EXP_TAG $CLASS_ID $URI"
     56    # convert output to book format
     57    # only add entries which don't exist in the book
     58    ipptool2book stdout p2pending -key exp_tag:class_id -uniq
     59    if ($VERBOSE > 2)
     60      book listbook p2pending
    7161    end
    7262
    7363    # delete existing entries which are DONE
    74     queuedrop Phase2Imfiles -key 0 DONE
     64    book delpage p2pending -key state DONE
    7565  end
    7666
     
    9383
    9484  task.exec
    95     queuesize Phase2Imfiles -var N
     85    # XXX make equiv book command:
     86    book npages p2pending -var N
    9687    if ($N == 0) break
    9788    if ($network == 0) break
    9889   
    99     # look for new images on the internal DetrendImfilesToProcess queue
     90    # look for new images on the internal p2pending book
    10091    # caution with these 'if' statements: syntax errors
    10192    # will make the task fail without given a good status
    102     queuepop Phase2Imfiles -var line -key 0 NEW
    103     if ("$line" == "NULL") break
     93    # XXX pop off the bottom or the top?
     94    book getpage p2pending 0 -var pageName
     95    book setword p2pending $pageName status RUN
    10496
    105     strpop line state
    106     queuepush Phase2Imfiles -replace -key 1:2 "RUN $line"
    107 
    108     ## the Phase2Imfiles queue contains (line has popped STATE)
    109     ## STATE EXP_TAG CLASS CLASS_ID URI-FITS
    110     list word -split $line
    111     $EXP_TAG  = $word:0
    112     $CLASS_ID = $word:1
    113     $URI      = $word:2
     97    book getword p2pending $pageName exp_tag -var EXP_TAG
     98    book getword p2pending $pageName class_id -var CLASS_ID
     99    book getword p2pending $pageName uri -var URI
    114100
    115101    # specify choice of remote host:(need to choose based on chips)
     
    122108    ## add 'p2' to the log files?
    123109    # XXX this is still a lame rule
     110    # make 'basename' an opihi function?
    124111    $word = `basename $EXP_TAG | tr '.' ' '`
    125112    list word -split $word
     
    129116    exec mkdir -p $LOGSUBDIR/$base
    130117
     118    # save the p2pending book pageName for future reference below
     119    options $pageName
     120
    131121    # create the command line
    132     options "$line"
    133122    if ($VERBOSE > 1)
    134123      echo command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
     
    141130  task.exit 0
    142131    # phase2imfile.pl updates DB tables, here we just update the queue
    143     queuepush Phase2Imfiles -replace -key 1:2 "DONE $options:0"
     132    book setword p2pending $options:0 status DONE
     133    # queuepush Phase2Imfiles -replace -key 1:2 "DONE $options:0"
    144134  end
    145135
     
    147137  task.exit    default
    148138    showcommand failure
    149     queuepush Phase2Imfiles -replace -key 1:2 "FAIL $options:0"
     139    book setword p2pending $options:0 status FAIL
     140    # queuepush Phase2Imfiles -replace -key 1:2 "FAIL $options:0"
    150141    $Phase2ImfileFail ++
    151142  end
     
    154145  task.exit    timeout
    155146    showcommand timeout
    156     queuepush Phase2Imfiles -replace -key 1:2 "TIMEOUT $options:0"
     147    book setword p2pending $options:0 status TIMEOUT
     148    # queuepush Phase2Imfiles -replace -key 1:2 "TIMEOUT $options:0"
    157149    $Phase2ImfileFail ++
    158150  end
Note: See TracChangeset for help on using the changeset viewer.