Changeset 42912
- Timestamp:
- Jul 7, 2025, 12:32:35 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20250626/tools/eam/burntool.20250520/src/bt.getchip.pt
r42911 r42912 1 1 2 # master book is btChipNight listing allCHIPNIGHT books2 # the master book btChipNights lists all of CHIPNIGHT books 3 3 # CHIPNIGHT books are named after the nights and chips, e.g. 20250704.XY01 4 4 5 if (not($BT_CHIPNIGHT_NSEQ)) set BT_CHIPNIGHT_NSEQ = 0 6 5 7 # get the next available chip (one chip from an exposure for a single night) 6 task bt.getchip.run 8 # all ops are done within the task exec 9 task bt.getchip 7 10 periods -poll $BT_POLL 8 11 periods -exec $BT_EXEC 9 12 periods -timeout 1800 13 host local 10 14 11 15 task.exec … … 13 17 periods -exec $BT_EXEC 14 18 19 # XXX is this sensible? 15 20 if ($BT_PAUSE) break 16 21 17 # how many hosts are defined?18 book npages btChipNight -var Nnights22 # how many nights are defined? 23 book npages btChipNights -var Nnights 19 24 20 25 # if we have reached the end, restart the loop over chip hosts … … 25 30 end 26 31 27 # XXX CHIPNIGHT could be the same as the page name28 book getpage btChipNight $BT_CHIPNIGHT_NSEQ -var BT_CHIPNIGHT_PAGE29 book getword btChipNight $BT_CHIPNIGHT_PAGE CHIPNIGHT -var BT_CHIPNIGHT_BOOK30 book getword btChipNight $BT_CHIPNIGHT_PAGE STATE -var BT_CHIPNIGHT_STATE32 # grab info for this CHIPNIGHT 33 book getpage btChipNights $BT_CHIPNIGHT_NSEQ -var BT_CHIPNIGHT_PAGE 34 book getword btChipNights $BT_CHIPNIGHT_PAGE CHIPNIGHT -var BT_CHIPNIGHT_BOOK 35 book getword btChipNights $BT_CHIPNIGHT_PAGE STATE -var BT_CHIPNIGHT_STATE 31 36 32 37 # ENTRY tracks the sequence number in the CHIPNIGHT 33 book getword btChipNight $BT_CHIPNIGHT_PAGE ENTRY -var BT_CHIPNIGHT_ENTRY38 book getword btChipNights $BT_CHIPNIGHT_PAGE ENTRY -var BT_CHIPNIGHT_ENTRY 34 39 35 # PREVTABLE (previousTable) will be NULL at the start (populated below)36 book getword btChipNight $BT_CHIPNIGHT_PAGE PREVTABLE-var previousTable40 # OUTTABLE (previousTable) will be NULL at the start (populated below) 41 book getword btChipNights $BT_CHIPNIGHT_PAGE OUTTABLE -var previousTable 37 42 38 43 # is this chip/night ready to go? … … 64 69 book getpage $BT_CHIPNIGHT_BOOK $BT_CHIPNIGHT_ENTRY -var pageName 65 70 if ("$pageName" == "NULL") 66 # this is a programming error 67 stop 71 ?? 68 72 echo "PROGRAMMING ERROR" 69 break73 exit 70 74 end 71 75 … … 74 78 75 79 # save info about currently active entry 76 book setword btChipNight $BT_CHIPNIGHT_PAGE STATE RUN77 book setword btChipNight $BT_CHIPNIGHT_PAGE ENTRY $BT_CHIPNIGHT_ENTRY78 book setword btChipNight $BT_CHIPNIGHT_PAGE PREVTABLE$outTableReal80 book setword btChipNights $BT_CHIPNIGHT_PAGE STATE RUN 81 book setword btChipNights $BT_CHIPNIGHT_PAGE ENTRY $BT_CHIPNIGHT_ENTRY 82 book setword btChipNights $BT_CHIPNIGHT_PAGE OUTTABLE $outTableReal 79 83 80 84 # XXX choose something sensible: 81 # stdout $mypath/$YEAR/$DATEOBS/log.burntool.run.$CHIP_ID.v$ITER82 # stderr $mypath/$YEAR/$DATEOBS/log.burntool.run.$CHIP_ID.v$ITER85 stdout log.bt.getchip 86 stderr log.bt.getchip 83 87 84 88 periods -exec 0.05 85 89 command echo selected $exposure, $class_id for processing 86 90 end 87 88 task.exit 089 bt.getchip.exit OK90 end91 92 # exit values other than 0:93 task.exit default94 bt.getchip.exit FAIL95 showcommand failure96 end97 98 task.exit crash99 bt.getchip.exit CRASH100 showcommand crash101 end102 103 # operation times out?104 task.exit timeout105 bt.getchip TIMEOUT106 showcommand timeout107 end108 91 end 109 110 macro bt.getchip.exit111 if ($0 != 2)112 echo "USAGE: bt.getchip.exit (quality)"113 break114 end115 116 local myBook myPage chPage117 $myBook = $options:0118 $myPage = $options:1119 $chPage = $options:2120 121 book setword $myBook $myPage pantaskState DONE122 123 # what else needs to happen after the job is done?124 125 # decrement NRUN for this host126 book getword btChipNight $chPage NRUN -var BT_CHIPNIGHT_NRUN127 $BT_CHIPNIGHT_NRUN --128 book setword btChipNight $chPage NRUN $BT_CHIPNIGHT_NRUN129 130 # update the night/exp/chip list as well131 # this chip state set to DONE or FAIL132 # book delpage burnhost.book $options:0133 end134 135 92 136 93 ######### supporting methods ############# … … 149 106 local rawImfileReal outTableReal previousTable expname chipID myHost 150 107 151 ### XXX need to track entry in btChipNight so bt.onechip.exit can update108 ### XXX need to track entry in btChipNights so bt.onechip.exit can update 152 109 153 110 book getword $BT_CHIPNIGHT_BOOK $pageName rawImfileReal -var rawImfileReal
Note:
See TracChangeset
for help on using the changeset viewer.
