Changeset 42451
- Timestamp:
- Apr 14, 2023, 12:02:11 PM (3 years ago)
- Location:
- trunk/tools/eam/rawfix.20230221/src
- Files:
-
- 7 edited
-
check_chip_locations.pl (modified) (1 diff)
-
create.rawfix.sh (modified) (1 diff)
-
fix_chip_locations.pl (modified) (4 diffs)
-
get_md5s_instances.pl (modified) (7 diffs)
-
rawfix.fixchip.pt (modified) (1 diff)
-
rawfix.md5sum.pt (modified) (1 diff)
-
rawfix.pt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl
r42450 r42451 55 55 open ($outfh, ">$topdir/$dateword/$chip_id.uris.$stage.txt"); 56 56 57 print "open $topdir/$dateword/$chip_id.uris.$stage.txt\n";57 # print "open $topdir/$dateword/$chip_id.uris.$stage.txt\n"; 58 58 59 59 # get the list of chip neb paths for one chip -
trunk/tools/eam/rawfix.20230221/src/create.rawfix.sh
r42445 r42451 6 6 7 7 # add in the iteration and the state summary 8 9 mysql -h localhost -u root <<EOF 10 use $DBNAME; 11 ALTER TABLE nights MODIFY Ngood INT, MODIFY Ndead INT, MODIFY Ngone INT; 12 ALTER TABLE nights MODIFY Nsing INT, MODIFY Ndups INT, MODIFY Nsbck INT, MODIFY Nxbck INT, MODIFY Nfail INT; 13 ALTER TABLE nights MODIFY Ncul1 INT, MODIFY Ncul2 INT, MODIFY Ncul3 INT; 14 EOF 15 16 exit 0 8 17 9 18 mysql -h localhost -u root <<EOF -
trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl
r42450 r42451 145 145 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 146 146 unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; } 147 open (OUTFILE, ">>$topdir/$dateword/$newhost. inst.$stage.txt");147 open (OUTFILE, ">>$topdir/$dateword/$newhost.$chip_id.inst.$stage.txt"); 148 148 print OUTFILE "$newfile $datast $md5sum\n"; 149 149 close (OUTFILE); … … 160 160 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 161 161 unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; } 162 open (OUTFILE, ">>$topdir/$dateword/$newhost. inst.$stage.txt");162 open (OUTFILE, ">>$topdir/$dateword/$newhost.$chip_id.inst.$stage.txt"); 163 163 print OUTFILE "$newfile $datast $md5sum\n"; 164 164 close (OUTFILE); … … 175 175 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 176 176 unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; } 177 open (OUTFILE, ">>$topdir/$dateword/$newhost. inst.$stage.txt");177 open (OUTFILE, ">>$topdir/$dateword/$newhost.$chip_id.inst.$stage.txt"); 178 178 print OUTFILE "$newfile $datast $md5sum\n"; 179 179 close (OUTFILE); … … 197 197 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 198 198 unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; } 199 open (OUTFILE, ">>$topdir/$dateword/$newhost. inst.$stage.txt");199 open (OUTFILE, ">>$topdir/$dateword/$newhost.$chip_id.inst.$stage.txt"); 200 200 print OUTFILE "$newfile $datast $md5sum\n"; 201 201 close (OUTFILE); -
trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl
r42444 r42451 13 13 # USAGE: get_md5s_instances.pl --hostname (hostname) --input (file) --stage (0,1,etc) 14 14 15 my ($myhost, $input, $stage) = &parse_cmdopts; 15 my $input; 16 my ($myhost, $dateword, $topdir, $stage) = &parse_cmdopts; 16 17 17 18 # check that we are running this script on 'myhost' … … 20 21 21 22 # read the list of instances: 22 my ($ins_list_r, $dst_list_r, $md5_list_r) = &load_instance_list ( $input);23 my ($ins_list_r, $dst_list_r, $md5_list_r) = &load_instance_list (); 23 24 24 my $output = $input; 25 $output =~ s/inst.$stage/md5s/; 25 my $output = "$topdir/$dateword/$myhost.md5s.txt"; 26 26 27 if ($output eq $input) { die "output file ($output) matches input file ($input)\n"; } 28 29 # read in both instance 27 # read in existing md5s 30 28 my $out_hash_r; 31 29 if (-e $output) { … … 60 58 } 61 59 62 my $line; 63 if (0) { 64 $line = "fakevalue $filename"; # XXX TEST: disable calculation: 65 } else { 66 $line = `md5sum $filename`; 67 } 60 my $line = `md5sum $filename`; 68 61 69 62 my ($md5sum, $rawfile) = split (" ", $line); … … 73 66 exit 0; 74 67 68 # use global $topdir, $dateword, $myhost, $stage 69 sub load_instance_list { 70 my (@ins_list, @dst_list, @md5_list); 71 72 # load the master list 73 my $input = "$topdir/$dateword/$myhost.inst.$stage.txt"; 74 &load_instance_list_onefile ($input, \@ins_list, \@dst_list, \@md5_list); 75 76 # there may be additional instances in files with names like HOSTNAME.XYnn.inst.STAGE 77 my @instlist = glob ("$topdir/$dateword/$myhost.XY??.inst.$stage.txt"); 78 foreach my $infile (@instlist) { 79 &load_instance_list_onefile ($infile, \@ins_list, \@dst_list, \@md5_list); 80 } 81 return (\@ins_list, \@dst_list, \@md5_list); 82 } 83 75 84 # read the instance info 76 sub load_instance_list {85 sub load_instance_list_onefile { 77 86 my $infile = $_[0]; 78 79 my (@ins_list, @dst_list, @md5_list); 87 my $ins_list_r = $_[1]; # reference to the instance list array 88 my $dst_list_r = $_[2]; # reference to the instance list array 89 my $md5_list_r = $_[3]; # reference to the instance list array 80 90 81 91 open(FILE,$infile) or die "cannot open file $infile\n"; … … 89 99 90 100 if (@words != 3) { die "error in input $infile : $line\n"; } 91 push (@ ins_list, $words[0]);92 push (@ dst_list, $words[1]);93 push (@ md5_list, $words[2]);101 push (@$ins_list_r, $words[0]); 102 push (@$dst_list_r, $words[1]); 103 push (@$md5_list_r, $words[2]); 94 104 } 95 105 close (FILE); 96 97 return (\@ins_list, \@dst_list, \@md5_list);98 106 } 99 107 … … 123 131 sub parse_cmdopts { 124 132 125 my ($myhost, $ input, $stage);126 GetOptions( 'hostname=s' => \$myhost, ' input=s' => \$input, 'stage=s' => \$stage) || pod2usage(2);133 my ($myhost, $topdir, $dateobs, $stage); 134 GetOptions( 'hostname=s' => \$myhost, 'topdir=s' => \$topdir, 'dateobs=s' => \$dateobs, 'stage=s' => \$stage) || pod2usage(2); 127 135 128 pod2usage( -msg => "Provide the input list with --input", -exitval => 2) unless defined $input; 136 pod2usage( -msg => "Cannot determine target date, use --dateobs YYYYMMDD", -exitval => 2) unless defined $dateobs; 137 # pod2usage( -msg => "Provide the input list with --input", -exitval => 2) unless defined $input; 129 138 pod2usage( -msg => "Define the host machine with --hostname", -exitval => 2) unless defined $myhost; 130 139 pod2usage( -msg => "Define the stage (0, 1, etc) with --stage", -exitval => 2) unless defined $stage; 140 pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir; 131 141 132 142 # check that stage is an integer … … 134 144 unless ($stage >= 0) { die "stage must be a non-negative integer\n"; } 135 145 136 return ($myhost, $ input, $stage);146 return ($myhost, $dateobs, $topdir, $stage); 137 147 } 138 148 -
trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip.pt
r42449 r42451 149 149 option $pageName $DATEOBS 150 150 151 stdout $ pageName/log.fixchip.run.v$ITER152 stderr $ pageName/log.fixchip.run.v$ITER151 stdout $DATEOBS/log.fixchip.run.$CHIP_ID.v$ITER 152 stderr $DATEOBS/log.fixchip.run.$CHIP_ID.v$ITER 153 153 154 154 substr $DATEOBS 0 4 YEAR -
trunk/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt
r42449 r42451 177 177 # if we are able to run the 'exec', use a short retry time to launch all outstanding jobs 178 178 periods -exec 0.05 179 command $mypath/get_md5s_instances.pl --hostname $USE_HOST --input $input --stage $ITER 179 command $mypath/get_md5s_instances.pl --hostname $USE_HOST --topdir $mypath --dateobs $DATEOBS --stage $ITER 180 # command $mypath/get_md5s_instances.pl --hostname $USE_HOST --input $input --stage $ITER 180 181 end 181 182 -
trunk/tools/eam/rawfix.20230221/src/rawfix.pt
r42447 r42451 19 19 # required host 20 20 21 $HOST_CKCHIP = ipp060 22 $HOST_ FIXCHIP = ipp07021 # run check_chip_locations.pl on this machine: 22 $HOST_CKCHIP = ippc180 23 23 24 24 if (not($?LOGDIR)) … … 38 38 if (not($?INIT_RAWFIX)) 39 39 control host add $HOST_CKCHIP 40 control host add $HOST_FIXCHIP41 40 $INIT_RAWFIX = 1 42 41 end
Note:
See TracChangeset
for help on using the changeset viewer.
