Index: /trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl	(revision 42441)
@@ -16,6 +16,6 @@
 # USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt --stage v0
 
-my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts;
-my ($neb_dbh, $gpc_dbh) = &parse_db_config ('nebulous.config');
+my ($fulldate, $dateword, $chiplist, $stage, $topdir) = &parse_cmdopts;
+my ($neb_dbh, $gpc_dbh) = &parse_db_config ("$topdir/nebulous.config");
 
 # read the list of chip_ids:
@@ -27,5 +27,5 @@
 
 # put output files in a directory defined by the night
-mkdir $dateword;
+mkdir "$topdir/$dateword";
 
 # output files: 
@@ -35,7 +35,6 @@
 foreach my $chip_id (@chip_ids) {
 
-    my $outfile = "$dateword/$chip_id.uris.txt";
     my $outfh;
-    open ($outfh, ">$outfile");
+    open ($outfh, ">$topdir/$dateword/$chip_id.uris.txt");
 
     # get the list of chip neb paths for one chip
@@ -74,5 +73,5 @@
     # now save the host count for this chip
     my $hostfh;
-    open ($hostfh, ">$dateword/$chip_id.hosts.txt");
+    open ($hostfh, ">$topdir/$dateword/$chip_id.hosts.txt");
 
     # save the host count for this chip
@@ -121,5 +120,5 @@
     my @chip_ids;
 
-    open(CHIPS,$chiplist) or die "cannot open file $chiplist\n"; 
+    open(CHIPS,"$topdir/$chiplist") or die "cannot open file $chiplist\n"; 
 
     my @lines = <CHIPS>;
@@ -226,4 +225,8 @@
 	my $xattr    = $values[3];
 	
+	if ($xattr  > 1) { $Ndead ++; next; } # do not save instances on dead partitions
+	if ($xattr == 0) { $Nmain ++; }
+	if ($xattr == 1) { $Nback ++; }
+
 	# count the number of each host by incrementing the hash element corresponding to the hostname:
 	# NOTE: hostcount is global
@@ -231,13 +234,10 @@
 
 	if (not defined $hostfile{$hostname}) {
-	    open ($hostfile{$hostname}, ">$dateword/$hostname.inst.$stage.txt");
+	    open ($hostfile{$hostname}, ">$topdir/$dateword/$hostname.inst.$stage.txt");
 	    ## XXX deal with open failure here
 	}
+
 	my $fh = $hostfile{$hostname};
 	print $fh "$instance $data_st $md5_sum\n";
-
-	if ($xattr == 0) { $Nmain ++; }
-	if ($xattr == 1) { $Nback ++; }
-	if ($xattr  > 1) { $Ndead ++; }
     }
 
@@ -330,10 +330,11 @@
 sub parse_cmdopts {
 
-    my ($dateobs, $chiplist, $stage);
-    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2);
+    my ($dateobs, $chiplist, $stage, $topdir);
+    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'topdir=s' => \$topdir, 'stage=s' => \$stage) || pod2usage(2);
     
     pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
     pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist;
     pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage;
+    pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir;
     
     # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
@@ -348,5 +349,5 @@
     my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
 
-    return ($fulldate, $dateword, $chiplist, $stage) 
+    return ($fulldate, $dateword, $chiplist, $stage, $topdir) 
 }
 
Index: /trunk/tools/eam/rawfix.20230221/src/check_md5s_dateobs.pl
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/check_md5s_dateobs.pl	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/check_md5s_dateobs.pl	(revision 42441)
@@ -12,10 +12,10 @@
 use Getopt::Long qw( GetOptions :config auto_help auto_version );
 
-# USAGE: check_md5s_dateobs.pl --dateobs (night)
+# USAGE: check_md5s_dateobs.pl --dateobs (night) --topdir (topdir)
 
-my ($dateword) = &parse_cmdopts;
+my ($dateword, $stage, $topdir) = &parse_cmdopts;
 
-my @instlist = glob ("$dateword/*.inst.txt");
-my @md5slist = glob ("$dateword/*.md5s.txt");
+my @instlist = glob ("$topdir/$dateword/*.inst.$stage.txt");
+my @md5slist = glob ("$topdir/$dateword/*.md5s.txt");
 
 my $Nfail = 0;
@@ -25,5 +25,5 @@
     # find the matching md5sum file for this host
 
-    my ($host) = $instfile =~ m|$dateword/([0-9a-zA-Z]*).inst.txt|;
+    my ($host) = $instfile =~ m|$dateword/([0-9a-zA-Z]*).inst.$stage.txt|;
     # print STDERR "host: $host\n";
 
@@ -100,8 +100,10 @@
 sub parse_cmdopts {
 
-    my ($dateobs);
-    GetOptions( 'dateobs=s' => \$dateobs) || pod2usage(2);
+    my ($dateobs, $stage, $topdir);
+    GetOptions( 'dateobs=s' => \$dateobs, 'topdir=s' => \$topdir, 'stage=s' => \$stage) || pod2usage(2);
     
     pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
+    pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir;
+    pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage;
     
     # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
@@ -115,5 +117,5 @@
     my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
 
-    return ($dateword);
+    return ($dateword, $stage, $topdir);
 }
 
Index: /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl	(revision 42441)
@@ -18,6 +18,6 @@
 # for each chip, target a single host?
 
-my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts;
-my ($neb_dbh) = &parse_db_config ('nebulous.config');
+my ($fulldate, $dateword, $chiplist, $stage, $topdir) = &parse_cmdopts;
+my ($neb_dbh) = &parse_db_config ("$topdir/nebulous.config");
 
 # read the list of chip_ids:
@@ -42,6 +42,6 @@
 foreach my $chip_id (@chip_ids) {
 
-    my $urifile = "$dateword/$chip_id.uris.txt";
-    open (FILE, "$urifile");
+    my $urifile = "$topdir/$dateword/$chip_id.uris.txt";
+    open (FILE,  $urifile);
     my @lines = <FILE>;
     close (FILE);
@@ -71,5 +71,5 @@
 	    my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
 	    unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; }
-	    open (OUTFILE, ">>$dateword/$newhost.inst.$stage.txt");
+	    open (OUTFILE, ">>$topdir/$dateword/$newhost.inst.$stage.txt");
 	    print OUTFILE "$newfile $datast $md5sum\n";
 	    close (OUTFILE);
@@ -85,5 +85,5 @@
 	    my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
 	    unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; }
-	    open (OUTFILE, ">>$dateword/$newhost.inst.$stage.txt");
+	    open (OUTFILE, ">>$topdir/$dateword/$newhost.inst.$stage.txt");
 	    print OUTFILE "$newfile $datast $md5sum\n";
 	    close (OUTFILE);
@@ -170,5 +170,5 @@
     my @chip_ids;
 
-    open(CHIPS,$chiplist) or die "cannot open file $chiplist\n"; 
+    open(CHIPS,"$topdir/$chiplist") or die "cannot open file $chiplist\n"; 
 
     my @lines = <CHIPS>;
@@ -189,10 +189,11 @@
 sub parse_cmdopts {
 
-    my ($dateobs, $chiplist, $stage);
-    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2);
+    my ($dateobs, $chiplist, $stage, $topdir);
+    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'topdir=s' => \$topdir, 'stage=s' => \$stage) || pod2usage(2);
     
     pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
     pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist;
     pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage;
+    pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir;
     
     # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
@@ -207,5 +208,5 @@
     my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
 
-    return ($fulldate, $dateword, $chiplist, $stage);
+    return ($fulldate, $dateword, $chiplist, $stage, $topdir);
 }
 
Index: /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations_stage2.pl
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations_stage2.pl	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations_stage2.pl	(revision 42441)
@@ -18,6 +18,6 @@
 # for each chip, target a single host?
 
-my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts;
-my ($neb_dbh) = &parse_db_config ('nebulous.config');
+my ($fulldate, $dateword, $chiplist, $stage, $topdir) = &parse_cmdopts;
+my ($neb_dbh) = &parse_db_config ("$topdir/nebulous.config");
 
 # read the list of chip_ids:
@@ -42,6 +42,6 @@
 foreach my $chip_id (@chip_ids) {
 
-    my $urifile = "$dateword/$chip_id.uris.txt";
-    open (FILE, "$urifile");
+    my $urifile = "$topdir/$dateword/$chip_id.uris.txt";
+    open (FILE,  $urifile);
     my @lines = <FILE>;
     close (FILE);
@@ -75,5 +75,5 @@
 	    my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
 	    unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; }
-	    open (OUTFILE, ">>$dateword/$newhost.inst.$stage.txt");
+	    open (OUTFILE, ">>$topdir/$dateword/$newhost.inst.$stage.txt");
 	    print OUTFILE "$newfile $datast $md5sum\n";
 	    close (OUTFILE);
@@ -89,5 +89,5 @@
 	    my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
 	    unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; }
-	    open (OUTFILE, ">>$dateword/$newhost.inst.txt");
+	    open (OUTFILE, ">>$topdir/$dateword/$newhost.inst.$stage.txt");
 	    print OUTFILE "$newfile $datast $md5sum\n";
 	    close (OUTFILE);
@@ -170,5 +170,5 @@
     my @chip_ids;
 
-    open(CHIPS,$chiplist) or die "cannot open file $chiplist\n"; 
+    open(CHIPS,"$topdir/$chiplist") or die "cannot open file $chiplist\n"; 
 
     my @lines = <CHIPS>;
@@ -189,10 +189,11 @@
 sub parse_cmdopts {
 
-    my ($dateobs, $chiplist, $stage);
-    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2);
+    my ($dateobs, $chiplist, $stage, $topdir);
+    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'topdir=s' => \$topdir, 'stage=s' => \$stage) || pod2usage(2);
     
     pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
     pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist;
     pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage;
+    pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir;
     
     # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
@@ -207,5 +208,5 @@
     my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
 
-    return ($fulldate, $dateword, $chiplist, $stage);
+    return ($fulldate, $dateword, $chiplist, $stage, $topdir);
 }
 
Index: /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations_stage3.pl
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations_stage3.pl	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/fix_chip_locations_stage3.pl	(revision 42441)
@@ -14,6 +14,6 @@
 # USAGE: fix_chip_locations_stage3.pl --dateobs (night) --chiplist (file)
 
-my ($fulldate, $dateword, $chiplist) = &parse_cmdopts;
-my ($neb_dbh) = &parse_db_config ('nebulous.config');
+my ($fulldate, $dateword, $chiplist, $topdir) = &parse_cmdopts;
+my ($neb_dbh) = &parse_db_config ("$topdir/nebulous.config");
 
 # read the list of chip_ids:
@@ -35,6 +35,6 @@
 foreach my $chip_id (@chip_ids) {
 
-    my $urifile = "$dateword/$chip_id.uris.txt";
-    open (FILE, "$urifile");
+    my $urifile = "$topdir/$dateword/$chip_id.uris.txt";
+    open (FILE,  $urifile);
     my @lines = <FILE>;
     close (FILE);
@@ -175,5 +175,5 @@
     my @chip_ids;
 
-    open(CHIPS,$chiplist) or die "cannot open file $chiplist\n"; 
+    open(CHIPS,"$topdir/$chiplist") or die "cannot open file $chiplist\n"; 
 
     my @lines = <CHIPS>;
@@ -195,9 +195,10 @@
 sub parse_cmdopts {
 
-    my ($dateobs, $chiplist);
-    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist) || pod2usage(2);
+    my ($dateobs, $chiplist, $topdir);
+    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'topdir=s' => \$topdir) || pod2usage(2);
     
     pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
     pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist;
+    pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir;
     
     # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
@@ -212,5 +213,5 @@
     my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
 
-    return ($fulldate, $dateword, $chiplist);
+    return ($fulldate, $dateword, $chiplist, $topdir);
 }
 
Index: /trunk/tools/eam/rawfix.20230221/src/get_hosts_md5s.sh
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/get_hosts_md5s.sh	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/get_hosts_md5s.sh	(revision 42441)
@@ -1,18 +1,24 @@
 #!/bin/csh
 
-if ($#argv != 2) then
-  echo "USAGE: get_hosts_md5s.sh (dateobs) (stage)"
+if ($#argv != 3) then
+  echo "USAGE: get_hosts_md5s.sh (topdir) (dateobs) (stage)"
   exit 2
 endif
 
-set dirname = $1
-set stage   = $2
+set topdir  = $1
+set dateobs = $2
+set stage   = $3
 
-if (! -d $dirname) then
-  echo "ERROR: missing dateobs directory $dirname"
+if (! -d $topdir) then
+  echo "ERROR: missing top-level directory $topdir"
+  exit 3
+endif
+
+if (! -d $topdir/$dateobs) then
+  echo "ERROR: missing dateobs directory $topdir/$dateobs"
   exit 3
 endif
 
 # report both the dateobs and the hostnames 
-ls $dirname/*.inst.$stage.txt | awk -v dateobs=$dirname -F/ '(NR == 1){print "dateobs md5host"}{print dateobs, $2}' | sed s/.inst.$stage.txt//
+ls $topdir/$dateobs/*.inst.$stage.txt | awk -v dateobs=$dateobs -F/ '(NR == 1){print "dateobs md5host"}{print dateobs, $NF}' | sed s/.inst.$stage.txt//
 exit 0
Index: /trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl	(revision 42441)
@@ -43,4 +43,10 @@
     my $filename = $instance;
     $filename =~ s|file://||;
+    
+    # check for the existence of the file first:
+    unless (-e $filename) {
+	print OUTFILE "$instance $data_state $md5sum_tru XXX\n";
+	next;
+    }
 
     my $line;
Index: /trunk/tools/eam/rawfix.20230221/src/get_md5s_instances_stage2.pl
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/get_md5s_instances_stage2.pl	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/get_md5s_instances_stage2.pl	(revision 42441)
@@ -53,4 +53,10 @@
     my $filename = $instance;
     $filename =~ s|file://||;
+
+    # check for the existence of the file first:
+    unless (-e $filename) {
+	print OUTFILE "$instance $data_state $md5sum_tru XXX\n";
+	next;
+    }
 
     my $line;
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.advance.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.advance.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.advance.pt	(revision 42441)
@@ -7,4 +7,5 @@
   periods -exec 10
   periods -timeout 30
+  host local
 
   stdout $LOGDIR/advance.log  
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip.pt	(revision 42441)
@@ -55,8 +55,8 @@
 
 task nights.ckchip.run
-
   periods      -poll $RPOLL
   periods      -exec $REXEC
   periods      -timeout 60
+  host          anyhost
   npending 1
 
@@ -88,5 +88,5 @@
     sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY
 
-    command check_chip_locations.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0
+    command $mypath/check_chip_locations.pl --topdir $mypath --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0
   end
 
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip_s3.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip_s3.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.ckchip_s3.pt	(revision 42441)
@@ -55,8 +55,8 @@
 
 task nights.ckchip_s3.run
-
   periods      -poll $RPOLL
   periods      -exec $REXEC
   periods      -timeout 60
+  host          anyhost
   npending 1
 
@@ -86,5 +86,5 @@
     sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY
 
-    command check_chip_locations.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v1
+    command $mypath/check_chip_locations.pl --topdir $mypath --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v1
   end
 
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip.pt	(revision 42441)
@@ -54,8 +54,8 @@
 
 task nights.fixchip.run
-
   periods      -poll $RPOLL
   periods      -exec $REXEC
   periods      -timeout 1800
+  host          anyhost
   npending 1
 
@@ -84,5 +84,5 @@
     sprintf FULLDATE "%s/%s/%s" $YEAR $MONTH $DAY
 
-    command fix_chip_locations.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0
+    command $mypath/fix_chip_locations.pl --topdir $mypath --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0
   end
 
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s2.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s2.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s2.pt	(revision 42441)
@@ -54,8 +54,8 @@
 
 task nights.fixchip_s2.run
-
   periods      -poll $RPOLL
   periods      -exec $REXEC
   periods      -timeout 1800
+  host          anyhost
   npending 1
 
@@ -85,5 +85,5 @@
     stderr $mypath/$DATEOBS/log.fixchip_s2.runhosts.v0  
 
-    command fix_chip_locations_stage2.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0
+    command $mypath/fix_chip_locations_stage2.pl --topdir $mypath --dateobs $FULLDATE --chiplist gpc1.chips.txt --stage v0
   end
 
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s3.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s3.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip_s3.pt	(revision 42441)
@@ -54,8 +54,8 @@
 
 task nights.fixchip_s3.run
-
   periods      -poll $RPOLL
   periods      -exec $REXEC
   periods      -timeout 1800
+  host          anyhost
   npending 1
 
@@ -85,5 +85,5 @@
     stderr $mypath/$DATEOBS/log.fixchip_s3.runhosts.v0  
 
-    command fix_chip_locations_stage3.pl --dateobs $FULLDATE --chiplist gpc1.chips.txt
+    command $mypath/fix_chip_locations_stage3.pl --topdir $mypath --dateobs $FULLDATE --chiplist gpc1.chips.txt
   end
 
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.md5chk.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.md5chk.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.md5chk.pt	(revision 42441)
@@ -53,5 +53,5 @@
 
 task nights.md5chk.run
-
+  host anyhost
   periods      -poll $RPOLL
   periods      -exec $REXEC
@@ -84,5 +84,5 @@
     stderr $mypath/$DATEOBS/log.md5chk.v0  
 
-    command check_md5s_dateobs.pl --dateobs $FULLDATE
+    command $mypath/check_md5s_dateobs.pl --topdir $mypath --dateobs $FULLDATE --stage v0
   end
 
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.md5chk_s2.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.md5chk_s2.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.md5chk_s2.pt	(revision 42441)
@@ -53,8 +53,8 @@
 
 task nights.md5chk_s2.run
-
   periods      -poll $RPOLL
   periods      -exec $REXEC
   periods      -timeout 60
+  host          anyhost
   npending 1
 
@@ -84,5 +84,5 @@
     stderr $mypath/$DATEOBS/log.md5chk_s2.v0  
 
-    command check_md5s_dateobs.pl --dateobs $FULLDATE
+    command $mypath/check_md5s_dateobs.pl --topdir $mypath --dateobs $FULLDATE --stage v0
   end
 
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt	(revision 42441)
@@ -55,9 +55,11 @@
 # output: md5host.book
 task nights.md5sum.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/md5sum.loadhosts.stdout.log  
@@ -86,5 +88,5 @@
     exec echo "# start runhosts $mydate" >> $tmpline
 
-    command get_hosts_md5s.sh $DATEOBS v0
+    command $mypath/get_hosts_md5s.sh $mypath $DATEOBS v0
   end
 
@@ -92,8 +94,11 @@
     # 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:md5host -uniq -setword pantaskState INIT stdout md5host.book
     book setword md5sum.book $options:0 NHOST {$Nhosts - 1}
     book setword md5sum.book $options:0 NDONE 0
+    book list
+    book listbook md5sum.book
     # use the queuesize (Nhosts) to track how many jobs are done / to be done
   end
@@ -117,4 +122,5 @@
 end
 
+# runs on the hosts identified by get_hosts_md5s.sh
 # output: md5host.book
 task nights.md5sum.runhosts
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum_s2.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum_s2.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum_s2.pt	(revision 42441)
@@ -55,8 +55,8 @@
 # output: md5host_s2.book
 task nights.md5sum_s2.loadhosts
-
   periods      -poll $RPOLL
   periods      -exec $REXEC
   periods      -timeout 60
+  host          local
   npending 1
 
@@ -86,5 +86,5 @@
     exec echo "# start runhosts $mydate" >> $tmpline
 
-    command get_hosts_md5s.sh $DATEOBS v0
+    command $mypath/get_hosts_md5s.sh $mypath $DATEOBS v0
   end
 
Index: /trunk/tools/eam/rawfix.20230221/src/rawfix.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/rawfix.pt	(revision 42440)
+++ /trunk/tools/eam/rawfix.20230221/src/rawfix.pt	(revision 42441)
@@ -32,4 +32,5 @@
 input rawfix.md5chk_s2.pt
 input rawfix.fixchip_s3.pt
+input rawfix.ckchip_s3.pt
 
 # no need to run rsync if we use the b-node working directory:
Index: /trunk/tools/eam/rawfix.20230221/src/task.test.pt
===================================================================
--- /trunk/tools/eam/rawfix.20230221/src/task.test.pt	(revision 42441)
+++ /trunk/tools/eam/rawfix.20230221/src/task.test.pt	(revision 42441)
@@ -0,0 +1,59 @@
+## pantasks scripts to manage the raw exposure data repair / cleanup
+## this is for the md5sum calculations
+## use the top-level rawfix.pt to load
+
+$RPOLL = 1
+$REXEC = 1
+
+# use this to find the files in this local directory
+# $mypath = /home/panstarrs/eugene/rawfix.20230221
+
+# NOTE: use a directory located on a b-node so the results can
+# be seen by both ATRC and ITC machines
+$mypath = /data/ippb07.0/home/eugene/rawfix.20230221
+
+if (not($?LOGDIR)) 
+  $LOGDIR = $mypath/pantasks_logs
+  mkdir $LOGDIR
+end
+
+#### the scripts below take the input files (YYYYMMDD/*.inst.txt) 
+#### and run get_md5s_instances.pl on the hosts associated with those lists
+#### the outputs are files (YYYYMMDD/*.md5s.txt) 
+
+if (not($?RAWFIX_MD5SUM_INIT))
+  book init md5sum.book
+  book init md5host.book
+  $RAWFIX_MD5SUM_INIT = 1
+end
+
+# output: md5host.book
+task nights.md5sum.loadhosts
+  periods      -poll $RPOLL
+  periods      -exec $REXEC
+  periods      -timeout 60
+  host		anyhost
+  npending 1
+
+  #stdout test.loadhosts.stdout.log  
+  #stderr test.loadhosts.stderr.log
+
+  task.exec
+    # if we are unable to run the 'exec', use a long retry time
+    periods -exec 1000
+    
+    command $mypath/get_hosts_md5s.sh $mypath 20101129 v0
+  end
+
+  task.exit 0
+    queuesize stdout -var Nhosts
+    for i 0 $Nhosts
+      queuepop stdout -var line:$i
+    end
+    echo "done with nights.md5sum.loadhosts, $Nhosts"
+    queueprint stdout
+  end
+end
+
+## It looks like stdout buffer is not completely filled, and i
+## it has an extra line at the start (stdout 1)
