Changeset 11210 for trunk/ippTasks/phase3.pro
- Timestamp:
- Jan 19, 2007, 5:24:59 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/phase3.pro (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/phase3.pro
r10758 r11210 1 ## this file contains the tasks for running the phase 0 stage 1 ## this file contains the tasks for running the phase 3 stage 2 ## these tasks use the book p3PendingExp 2 3 3 ## these tasks use the queue Phase3Exposures4 ## the Phase3Exposures queue contains:5 ## STATE EXP_TAG CLASS CLASS_ID URI-FITS6 ## queue keys are counted from 07 8 queueinit Phase3Exposures9 4 if ($?network == 0) 10 5 $network = 1 … … 13 8 $parallel = 0 14 9 end 15 16 $Phase3ExposureFail = 017 18 10 if ($?VERBOSE == 0) 19 11 echo "VERBOSE not defined: load pantasks.pro first" … … 24 16 break 25 17 end 18 26 19 $LOGSUBDIR = $LOGDIR/phase3 27 20 exec mkdir -p $LOGSUBDIR 28 21 22 book init p3PendingExp 23 29 24 macro phase3.status 30 queueprint Phase3Exposures 31 echo "Phase3ExposureFail: $Phase3ExposureFail" 25 book listbook p3PendingExp 32 26 end 33 27 34 28 # select images ready for phase3 analysis 35 # new entries are added to queue Phase3Exposures36 # compare the new list with the ones already selected29 # new entries are added to p3PendingExp 30 # skip already-present entries 37 31 task phase3.exp.load 38 32 host local … … 46 40 47 41 task.exec 48 command p3tool -pendingexp -simple42 command p3tool -pendingexp -limit 20 49 43 end 50 44 51 45 # success 52 46 task.exit 0 53 local i Nqueue 54 55 # compare output with Phase3Exposures queue 56 # only add entries which don't exist in queue 57 queuesize stdout -var Nqueue 58 for i 0 $Nqueue 59 queuepop stdout -var line 60 if ($VERBOSE > 2) 61 echo $line 62 end 63 list word -split $line 64 $EXP_TAG = $word:0 65 queuepush Phase3Exposures -uniq -key 1 "NEW $EXP_TAG" 47 # convert 'stdout' to book format 48 ipptool2book stdout p3PendingExp -key exp_tag -uniq 49 if ($VERBOSE > 2) 50 book listbook p3PendingExp 66 51 end 67 52 68 53 # delete existing entries which are DONE 69 queuedrop Phase3Exposures -key 0DONE54 book delpage p3PendingExp -key state DONE 70 55 end 71 56 … … 88 73 89 74 task.exec 90 queuesize Phase3Exposures-var N75 book npages p3PendingExp -var N 91 76 if ($N == 0) break 92 77 if ($network == 0) break 93 78 94 # look for new images on the internal DetrendExposuresToProcess queue 95 # caution with these 'if' statements: syntax errors 96 # will make the task fail without given a good status 97 queuepop Phase3Exposures -var line -key 0 NEW 98 if ("$line" == "NULL") break 79 # look for new images in p3PendingExp (state == NULL) 80 book getpage p3PendingExp 0 -var pageName -key state NULL 81 if ($pageName == NULL) break 99 82 100 strpop line state 101 queuepush Phase3Exposures -replace -key 1 "RUN $line" 83 book setword p3PendingExp $pageName state RUN 84 book getword p3PendingExp $pageName camera -var CAMERA 85 book getword p3PendingExp $pageName exp_tag -var EXP_TAG 102 86 103 ## the Phase3Exposures queue contains: 104 ## STATE EXP_TAG CAMERA TELESCOPE TYPE NCLASS 105 list word -split $line 106 $EXP_TAG = $word:0 87 # specify choice of remote host:(need to choose based on chips) 88 if ($parallel) 89 host anyhost 90 else 91 host local 92 end 107 93 108 94 # XXX this is still a lame rule … … 114 100 exec mkdir -p $LOGSUBDIR/$base 115 101 116 # specify choice of remote host:(need to choose based on chips) 117 if ($parallel) 118 host anyhost 119 else 120 host local 121 end 102 # save the pageName for future reference below 103 options $pageName 122 104 123 105 # create the command line 124 options "$line"125 106 if ($VERBOSE > 1) 126 107 echo command phase3.pl --exp_tag $EXP_TAG 127 108 end 128 command phase3.pl --exp_tag $EXP_TAG --camera CTIO_MOSAIC2109 command phase3.pl --exp_tag $EXP_TAG --camera $CAMERA 129 110 end 130 111 131 112 # success 132 113 task.exit 0 133 # phase3exp.pl updates DB tables, here we just update the queue134 queuepush Phase3Exposures -replace -key 1 "DONE $options:0"114 # phase3exp.pl updates DB tables, here we just update the page 115 book setword p3PendingExp $options:0 state DONE 135 116 end 136 117 … … 138 119 task.exit default 139 120 showcommand failure 140 queuepush Phase3Exposures -replace -key 1 "FAIL $options:0" 141 $Phase3ExposureFail ++ 121 book setword p3PendingExp $options:0 state FAIL 142 122 end 143 123 … … 145 125 task.exit timeout 146 126 showcommand timeout 147 queuepush Phase3Exposures -replace -key 1 "TIMEOUT $options:0" 148 $Phase3ExposureFail ++ 127 book setword p3PendingExp $options:0 state TIMEOUT 149 128 end 150 129 end
Note:
See TracChangeset
for help on using the changeset viewer.
