Index: trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt
===================================================================
--- trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt	(revision 42441)
+++ trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt	(revision 42445)
@@ -80,13 +80,16 @@
     book setword md5sum.book $pageName pantaskState RUN
     book getword md5sum.book $pageName dateobs -var DATEOBS
+    book getword md5sum.book $pageName iter    -var ITER
     option $pageName
     # save the page so we can use it below
 
     # write an entry point in the log for this night
-    sprintf tmpline "%s/%s/log.md5sum.runhosts.v0" $mypath $DATEOBS
+    sprintf tmpline "%s/%s/log.md5sum.runhosts.v%d" $mypath $DATEOBS $ITER
     date -var mydate
     exec echo "# start runhosts $mydate" >> $tmpline
 
-    command $mypath/get_hosts_md5s.sh $mypath $DATEOBS v0
+    # the command returns these fields: dateobs stage md5host
+    # NOTE: stage == ITER
+    command $mypath/get_hosts_md5s.sh $mypath $DATEOBS $ITER
   end
 
@@ -142,6 +145,8 @@
     if ("$pageName" == "NULL") break
 
+    # XXX NOTE: the output field is called 'stage'
     book setword md5host.book $pageName pantaskState RUN
     book getword md5host.book $pageName dateobs -var DATEOBS
+    book getword md5host.book $pageName stage   -var ITER
     book getword md5host.book $pageName md5host -var MD5HOST
 
@@ -150,6 +155,6 @@
 
     # does the output go here?
-    stdout $mypath/$DATEOBS/log.md5sum.runhosts.v0  
-    stderr $mypath/$DATEOBS/log.md5sum.runhosts.v0  
+    stdout $mypath/$DATEOBS/log.md5sum.runhosts.v$ITER  
+    stderr $mypath/$DATEOBS/log.md5sum.runhosts.v$ITER  
 
     # XXX TEST: $USE_HOST = ipp060
@@ -167,10 +172,10 @@
 
     ## even when testing, use the original hostname here:
-    $input = $mypath/$DATEOBS/$MD5HOST.inst.v0.txt
+    $input = $mypath/$DATEOBS/$MD5HOST.inst.$ITER.txt
 
     # need to make sure this will work on the ipp b-nodes:
     # if we are able to run the 'exec', use a short retry time to launch all outstanding jobs
     periods -exec 0.05
-    command $mypath/get_md5s_instances.pl --hostname $USE_HOST --input $input --stage v0
+    command $mypath/get_md5s_instances.pl --hostname $USE_HOST --input $input --stage $ITER
   end
 
@@ -271,9 +276,10 @@
   book getword md5sum.book $options:1 NHOST -var Nhosts
   book getword md5sum.book $options:1 NDONE -var Ndone
+  book getword md5sum.book $options:1 stage -var ITER
   $Ndone ++
   book setword md5sum.book $options:1 NDONE $Ndone
   if ("$1" != "OK")
     book setword md5sum.book $options:1 pantasksQuality $1
-    sprintf tmpline "%s/%s/log.md5sum.runhosts.v0" $mypath $options:1
+    sprintf tmpline "%s/%s/log.md5sum.runhosts.v%d" $mypath $options:1 $ITER
     exec echo "failure $1 $options:0" >> $tmpline
   else
