- Timestamp:
- May 12, 2023, 9:21:20 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl
r42451 r42462 18 18 # for each chip, target a single host? 19 19 20 my ($fulldate, $dateword, $chiplist, $chipID, $stage, $topdir ) = &parse_cmdopts;20 my ($fulldate, $dateword, $chiplist, $chipID, $stage, $topdir, $basedir) = &parse_cmdopts; 21 21 my ($neb_dbh, $raw_dbh) = &parse_db_config ("$topdir/nebulous.config"); 22 # topdir used for nebulous.config and chiplist.txt, basedir used for night-level data 22 23 23 24 # choose ITC machines on which to place backup copies: … … 40 41 my $Nfail = 0; 41 42 42 my ($goodchips_r, $failchips_r) = &get_good_or_fail_chiplists ($ topdir, $dateword, $stage);43 my ($goodchips_r, $failchips_r) = &get_good_or_fail_chiplists ($basedir, $dateword, $stage); 43 44 44 45 # read the list of chip_ids: … … 80 81 } else { 81 82 82 open (OUTFILE, ">$ topdir/$dateword/$chipID.stats.$stage.txt");83 open (OUTFILE, ">$basedir/$dateword/$chipID.stats.$stage.txt"); 83 84 84 85 print OUTFILE "Nchip: $Nchip\n"; … … 106 107 107 108 # read from chip_id file, update to next stage number 108 my $urifile = "$ topdir/$dateword/$chip_id.uris.$stage.txt";109 my $urifile = "$basedir/$dateword/$chip_id.uris.$stage.txt"; 109 110 if (! -e $urifile) { die "missing file $urifile\n"; } 110 111 open (URIFILE, $urifile); … … 145 146 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 146 147 unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; } 147 open (OUTFILE, ">>$ topdir/$dateword/$newhost.$chip_id.inst.$stage.txt");148 open (OUTFILE, ">>$basedir/$dateword/$newhost.$chip_id.inst.$stage.txt"); 148 149 print OUTFILE "$newfile $datast $md5sum\n"; 149 150 close (OUTFILE); … … 160 161 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 161 162 unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; } 162 open (OUTFILE, ">>$ topdir/$dateword/$newhost.$chip_id.inst.$stage.txt");163 open (OUTFILE, ">>$basedir/$dateword/$newhost.$chip_id.inst.$stage.txt"); 163 164 print OUTFILE "$newfile $datast $md5sum\n"; 164 165 close (OUTFILE); … … 175 176 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 176 177 unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; } 177 open (OUTFILE, ">>$ topdir/$dateword/$newhost.$chip_id.inst.$stage.txt");178 open (OUTFILE, ">>$basedir/$dateword/$newhost.$chip_id.inst.$stage.txt"); 178 179 print OUTFILE "$newfile $datast $md5sum\n"; 179 180 close (OUTFILE); … … 197 198 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 198 199 unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; } 199 open (OUTFILE, ">>$ topdir/$dateword/$newhost.$chip_id.inst.$stage.txt");200 open (OUTFILE, ">>$basedir/$dateword/$newhost.$chip_id.inst.$stage.txt"); 200 201 print OUTFILE "$newfile $datast $md5sum\n"; 201 202 close (OUTFILE); … … 327 328 sub get_good_or_fail_chiplists { 328 329 329 my $ topdir = $_[0];330 my $basedir = $_[0]; 330 331 my $dateword = $_[1]; 331 332 my $stage = $_[2]; … … 333 334 # load the lists of good and fail chips 334 335 my $prev = $stage - 1; 335 my $goodfile = "$ topdir/$dateword/goodchips.$prev.txt";336 my $goodfile = "$basedir/$dateword/goodchips.$prev.txt"; 336 337 my %goodchips; 337 338 if (-e $goodfile) { … … 345 346 } 346 347 } 347 my $failfile = "$ topdir/$dateword/failchips.$prev.txt";348 my $failfile = "$basedir/$dateword/failchips.$prev.txt"; 348 349 my %failchips; 349 350 if (-e $failfile) { … … 464 465 my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day); 465 466 466 return ($fulldate, $dateword, $chiplist, $chipID, $stage, $topdir); 467 my ($yearobs) = substr ($dateword, 0, 4); 468 my $basedir = "$topdir/$yearobs"; 469 470 return ($fulldate, $dateword, $chiplist, $chipID, $stage, $topdir, $basedir); 467 471 } 468 472
Note:
See TracChangeset
for help on using the changeset viewer.
