Index: trunk/tools/eam/burntool.20250520/src/burntool.old.pt
===================================================================
--- trunk/tools/eam/burntool.20250520/src/burntool.old.pt	(revision 42988)
+++ trunk/tools/eam/burntool.20250520/src/burntool.old.pt	(revision 42988)
@@ -0,0 +1,333 @@
+## pantasks scripts to manage the raw exposure data repair / cleanup
+## this is for the initial chip instance checks
+## use the top-level rawfix.pt to load
+
+if (not($?RAWFIX_BURNTOOL_INIT))
+  book init burntool.book
+  book init burnhost.book
+  $RAWFIX_BURNTOOL_INIT = 1
+end
+
+$MAX_BURNHOST = 2
+
+# select nights in state burntool.new
+# output: burntool.book
+task nights.burntool.load
+  host local
+  periods -poll $TPOLL
+  periods -exec $TEXEC
+  periods -timeout 30
+
+  stdout $LOGDIR/burntool.load.stdout.log  
+  stderr $LOGDIR/burntool.load.stderr.log
+
+  # only run one of these tasks at a time
+  npending 1
+
+  task.exec
+    command check.rawfix.sh state burntool.new 
+  end
+
+  task.exit 0
+    # convert the stdout 'queue' to entries in a book
+    # fields in the table will become words in the page
+    queue2book -raw-columns -key dateobs -uniq -setword pantaskState INIT -setword pantasksQuality OK stdout burntool.book
+    book delpage burntool.book -key pantaskState DONE
+  end
+
+  # exit values other than 0:
+  task.exit    default
+    showcommand failure
+  end
+
+  task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+  end
+end
+
+# output: burnhost.book
+task nights.burntool.loadhosts
+  periods      -poll $RPOLL
+  periods      -exec $REXEC
+  periods      -timeout 60
+  host		local
+  npending 1
+  # note: the tasks which return their results via stdout
+  # seem to fail if run remotely.  
+
+  stdout $LOGDIR/burntool.loadhosts.stdout.log  
+  stderr $LOGDIR/burntool.loadhosts.stderr.log
+
+  task.exec
+    # if we are unable to run the 'exec', use a long retry time
+    periods -exec $REXEC
+
+    book npages burntool.book -var N
+    if ($N == 0) break
+    if ($NETWORK == 0) break
+    
+    # look for new nights in burntool.book (pantaskState == INIT)
+    book getpage burntool.book 0 -var pageName -key pantaskState INIT
+    if ("$pageName" == "NULL") break
+
+    book setword burntool.book $pageName pantaskState RUN
+    book getword burntool.book $pageName dateobs -var DATEOBS
+    book getword burntool.book $pageName iter    -var ITER
+    option $pageName
+    # save the page so we can use it below
+
+    substr $DATEOBS 0 4 YEAR
+
+    # write an entry point in the log for this night
+    sprintf tmpline "%s/%s/%s/log.burntool.runhosts.v%d" $mypath $YEAR $DATEOBS $ITER
+    date -var mydate
+    exec echo "\\# start runhosts $mydate" >> $tmpline
+
+    # get_hosts_fixchip.sh selects the most used machine at ITC
+    # the command returns these fields: dateobs stage fixhost chipID
+    # NOTE: stage == ITER
+    command get_hosts_fixchip.sh $mypath $DATEOBS $ITER
+  end
+
+  task.exit 0
+    # convert the stdout 'queue' to entries in a book
+    # fields in the table will become words in the page
+    # queueprint stdout
+    queuesize stdout -var Nhosts
+    queue2book -raw-columns -key dateobs:chipID -uniq -setword pantaskState INIT stdout burnhost.book
+    book setword burntool.book $options:0 NHOST {$Nhosts - 1}
+    book setword burntool.book $options:0 NDONE 0
+    # book list
+    # book listbook burntool.book
+    # use the queuesize (Nhosts) to track how many jobs are done / to be done
+  end
+
+  # exit values other than 0:
+  task.exit    default
+    showcommand failure
+    book setword burntool.book $options:0 pantasksQuality FAIL
+  end
+
+  task.exit    crash
+    showcommand crash
+    book setword burntool.book $options:0 pantasksQuality CRASH
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+    book setword burntool.book $options:0 pantasksQuality TIMEOUT
+  end
+end
+
+task nights.burntool.run
+  periods      -poll $RPOLL
+  periods      -exec $REXEC
+  periods      -timeout 1800
+
+  task.exec
+    # if we are unable to run the 'exec', use a long retry time
+    periods -exec $REXEC
+
+    book npages burnhost.book -var N
+    if ($N == 0) break
+    if ($NETWORK == 0) break
+    
+    # look for new nights in burnhost.book (pantaskState == INIT)
+    book getpage burnhost.book 0 -var pageName -key pantaskState INIT
+    if ("$pageName" == "NULL") break
+
+    book setword burnhost.book $pageName pantaskState RUN
+    book getword burnhost.book $pageName dateobs -var DATEOBS
+    book getword burnhost.book $pageName iter    -var ITER
+    book getword burnhost.book $pageName fixhost -var BURNHOST
+    book getword burnhost.book $pageName chipID  -var CHIP_ID
+
+    substr $DATEOBS 0 4 YEAR
+    substr $DATEOBS 4 2 MONTH
+    substr $DATEOBS 6 2 DAY
+    sprintf STARTDATE "%s/%s/%s" $YEAR $MONTH $DAY
+    sprintf ENDDATE "%s/%s/%s,23:59:59" $YEAR $MONTH $DAY
+
+    option $pageName $DATEOBS $YEAR
+    # save DATEOBS so we can find the md5sum.book entry
+    # also save YEAR for output log
+
+    stdout $mypath/$YEAR/$DATEOBS/log.burntool.run.$CHIP_ID.v$ITER
+    stderr $mypath/$YEAR/$DATEOBS/log.burntool.run.$CHIP_ID.v$ITER
+
+   
+    host $BURNHOST
+#   host -required $BURNHOST
+#   too many jobs wanted the same machines so the processing was clogged.
+#   allow them to go elsewhere if needed.
+    
+    ## check if this host needs to be launched
+    if (not($?host:$BURNHOST)) 
+      echo "host not defined, creating : $BURNHOST"
+      $host:$BURNHOST = 0
+    end
+    if ($host:$BURNHOST < $MAX_BURNHOST) 
+      control host add $BURNHOST
+      $host:$BURNHOST ++
+    end
+
+    sprintf psvidOutput "%s/%s/%s" $mypath $YEAR $DATEOBS
+
+    # if we are able to run the 'exec', use a short retry time to launch all outstanding jobs
+    periods -exec 0.05
+    command ipp_apply_burntool_psvideo.pl --rerun --dateobs_begin $STARTDATE --dateobs_end $ENDDATE --class_id $CHIP_ID --dbname gpc1 --psvidOutput $psvidOutput
+    ## NOTE the rerun option is set here
+  end
+
+  task.exit 0
+    nights.burntool.exit OK
+  end
+
+  # exit values other than 0:
+  task.exit    default
+    nights.burntool.exit FAIL
+    showcommand failure
+  end
+
+  task.exit    crash
+    nights.burntool.exit CRASH
+    showcommand crash
+  end
+
+  # operation times out?
+  task.exit    timeout
+    nights.burntool.exit TIMEOUT
+    showcommand timeout
+  end
+end
+
+# output: burnhost.book
+task nights.burntool.clean
+
+  periods      -poll $RPOLL
+  periods      -exec $REXEC
+  periods      -timeout 60
+  npending 1
+
+  stdout $LOGDIR/burntool.clean.stdout.log  
+  stderr $LOGDIR/burntool.clean.stderr.log
+
+  task.exec
+    # if we are unable to run the 'exec', use a long retry time
+    periods -exec $REXEC
+
+    book npages burntool.book -var N
+    if ($N == 0) break
+    if ($NETWORK == 0) break
+    
+    # look for completed nights in burntool.book (pantaskState == STOP)
+    book getpage burntool.book 0 -var pageName -key pantaskState STOP
+    if ("$pageName" == "NULL") break
+
+    # book listpage burntool.book $pageName
+
+    # book setword burntool.book $pageName pantaskState RUN
+    book getword burntool.book $pageName dateobs -var DATEOBS
+    book getword burntool.book $pageName pantasksQuality -var QUALITY
+
+    option $pageName
+    # save the page so we can use it below
+
+    if ("$QUALITY" == "OK")
+      command update.rawfix.sh $DATEOBS burntool.done 
+    else
+      command update.rawfix.sh $DATEOBS burntool.fail 
+    end
+  end
+
+  task.exit 0
+    # now that the entry is set to done in the db, remove the pantasks book entry
+    echo "cleaning this page: $options:0"
+    book setword burntool.book $options:0 pantaskState DONE
+  end
+
+  # exit values other than 0:
+  task.exit    default
+    showcommand failure
+    book setword burntool.book $options:0 pantasksQuality FAIL
+  end
+
+  task.exit    crash
+    showcommand crash
+    book setword burntool.book $options:0 pantasksQuality CRASH
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+    book setword burntool.book $options:0 pantasksQuality TIMEOUT
+  end
+end
+
+######################### UTILITIES #################################
+
+macro burntool.loadhosts.state
+  if ($0 != 2)
+    echo "USAGE: burntool.loadhosts.state (state)"
+    break
+  end
+
+  task nights.burntool.loadhosts
+    active $1
+  end
+end
+
+macro burntool.clean.state
+  if ($0 != 2)
+    echo "USAGE: burntool.clean.state (state)"
+    break
+  end
+
+  task nights.burntool.clean
+    active $1
+  end
+end
+
+macro burntool.run.state
+  if ($0 != 2)
+    echo "USAGE: burntool.run.state (state)"
+    break
+  end
+
+  task nights.burntool.run
+    active $1
+  end
+end
+
+macro nights.burntool.exit
+  if ($0 != 2)
+    echo "USAGE: nights.burntool.exit (quality)"
+    break
+  end
+
+  book setword burnhost.book $options:0 pantaskState DONE
+  book getword burntool.book $options:1 NHOST -var Nhosts
+  book getword burntool.book $options:1 NDONE -var Ndone
+  book getword burntool.book $options:1 iter  -var ITER
+  $Ndone ++
+  book setword burntool.book $options:1 NDONE $Ndone
+
+  sprintf tmpline "%s/%s/%s/log.burntool.runhosts.v%d" $mypath $options:2 $options:1 $ITER
+  if ("$1" != "OK")
+    book setword burntool.book $options:1 pantasksQuality $1
+    exec echo "failure $1 $options:0" >> $tmpline
+  else
+    exec echo "success $1 $options:0" >> $tmpline
+  end 
+  if ($Ndone == $Nhosts)
+    book setword burntool.book $options:1 pantaskState STOP
+  end
+  book delpage burnhost.book $options:0
+end
+
Index: trunk/tools/eam/burntool.20250520/src/burntool_night_chip.pl
===================================================================
--- trunk/tools/eam/burntool.20250520/src/burntool_night_chip.pl	(revision 42987)
+++ trunk/tools/eam/burntool.20250520/src/burntool_night_chip.pl	(revision 42988)
@@ -71,5 +71,5 @@
 $command .= " -ordered_by_date";
 $command .= " -dbname $dbname" if defined $dbname;
-$command .= " -limit 10";
+# $command .= " -limit 10";
 
 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
