- Timestamp:
- Mar 8, 2023, 9:44:22 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl
r42399 r42400 40 40 41 41 # get the list of chip neb paths for one chip 42 my @neb_paths = &get_chip_paths ($fulldate, $chip_id); 42 my ($neb_paths_r, $ds_array_r, $md_array_r) = &get_chip_paths ($fulldate, $chip_id); 43 44 # I think this makes a copy of the arrays, which is inefficient 45 # my @neb_paths = @$neb_paths_r; 46 # my @ds_array = @$ds_array_r; 47 # my @md_array = @$md_array_r; 43 48 44 49 # reset the hostcount for this chip … … 46 51 47 52 # find the neb instances for each chip nebulous entry 48 foreach my $nebname (@neb_paths) { 53 54 for (my $i = 0; $i < @$neb_paths_r; $i++) { 55 my $nebname = $neb_paths_r->[$i]; # equivalent to ${$neb_paths_r}[$i] 56 my $data_st = $ds_array_r->[$i]; 57 my $md5_sum = $md_array_r->[$i]; 58 59 # print STDERR "nebname: $nebname, dstate: $data_st, md5: $md5_sum\n"; 49 60 50 61 # get info for all instances of this chip … … 54 65 55 66 # determine the status of the instances 56 my ($Nmain, $Nback, $Ndead) = &check_instance_xattr ($inforows, $ext_id );67 my ($Nmain, $Nback, $Ndead) = &check_instance_xattr ($inforows, $ext_id, $data_st, $md5_sum); 57 68 58 69 &check_instance_state ($outfh, $ext_id, $Nmain, $Nback, $Ndead); … … 130 141 my $chip_id = $_[1]; 131 142 132 my @nebarray;133 134 my $sql_chip_paths = "SELECT uri from rawImfile WHERE class_id = '$chip_id' and dateobs > '$fulldate,00:00:00' and dateobs < '$fulldate,23:59:59'";143 my (@nebarray, @ds_array, @md_array); 144 145 my $sql_chip_paths = "SELECT uri, data_state, md5sum from rawImfile WHERE class_id = '$chip_id' and dateobs > '$fulldate,00:00:00' and dateobs < '$fulldate,23:59:59'"; 135 146 if ($DEBUG > 5) { print "sql: $sql_chip_paths\n"; } 136 147 … … 145 156 # there should only be a single value (only uri selected above) 146 157 my $Nvalues = @values; 147 if ($Nvalues == 0) { print "ERROR: missing uri\n"; next; } 148 if ($Nvalues > 1) { print "ERROR: too many uri entries?\n"; next; } 158 if ($Nvalues != 3) { print "ERROR: invalid response?\n"; next; } 149 159 150 160 push (@nebarray, $values[0]); 151 if ($DEBUG > 4) { print "$values[0]\n"; } 152 } 153 154 return @nebarray; 161 push (@ds_array, $values[1]); 162 push (@md_array, $values[2]); 163 if ($DEBUG > 4) { print "$values[0]\n $values[1]\n $values[2]\n"; } 164 } 165 166 # return references so we can keep the three arrays distinct 167 return (\@nebarray, \@ds_array, \@md_array); 155 168 } 156 169 … … 177 190 sub check_instance_xattr { 178 191 179 my $ext_id = $_[1]; 180 181 my $rowref = $_[0]; 192 my $rowref = $_[0]; 193 my $ext_id = $_[1]; 194 my $data_st = $_[2]; 195 my $md5_sum = $_[3]; 196 182 197 my @inforows = @$rowref; 183 198 my $Nrows = @inforows; … … 218 233 } 219 234 my $fh = $hostfile{$hostname}; 220 print $fh "$instance \n";235 print $fh "$instance $data_st $md5_sum\n"; 221 236 222 237 if ($xattr == 0) { $Nmain ++; }
Note:
See TracChangeset
for help on using the changeset viewer.
