@@ -453,9 +453,6 @@ Status DenseReader::dense_read() {
453
453
// processing.
454
454
if (qc_coords_mode_) {
455
455
t_start = t_end;
456
- if (compute_task.valid ()) {
457
- throw_if_not_ok (compute_task.wait ());
458
- }
459
456
continue ;
460
457
}
461
458
@@ -772,8 +769,8 @@ DenseReader::compute_result_space_tiles(
772
769
const auto fragment_num = (unsigned )frag_tile_domains.size ();
773
770
const auto & tile_coords = subarray.tile_coords ();
774
771
775
- // Keep track of the required memory to load the result space tiles. Split
776
- // up filtered versus unfiltered. The memory budget is combined for all
772
+ // Keep track of the required memory to load the result space tiles. Split up
773
+ // filtered versus unfiltered. The memory budget is combined for all
777
774
// query condition attributes.
778
775
uint64_t required_memory_query_condition_unfiltered = 0 ;
779
776
std::vector<uint64_t > required_memory_unfiltered (
@@ -789,28 +786,28 @@ DenseReader::compute_result_space_tiles(
789
786
aggregate_only_field[n - condition_names.size ()] = aggregate_only (name);
790
787
}
791
788
792
- // Here we estimate the size of the tile structures. First, we have to
793
- // account the size of the space tile structure. We could go deeper in the
794
- // class to account for other things but for now we keep it simpler. Second,
795
- // we try to account for the tile subarray (DenseTileSubarray). This class
796
- // will have a vector of ranges per dimensions, so 1 + dim_num *
797
- // sizeof(vector). Here we choose 32 for the size of the vector to
798
- // anticipate the conversion to a PMR vector. We also add dim_num * 2 *
799
- // sizeof(DimType) to account for at least one range per dimension (this
800
- // should be improved by accounting for the exact number of ranges). Finally
801
- // for the original range index member, we have to add 1 + dim_num *
802
- // sizeof(vector) as well and one uint64_t per dimension (this can also be
803
- // improved by accounting for the exact number of ranges).
789
+ // Here we estimate the size of the tile structures. First, we have to account
790
+ // the size of the space tile structure. We could go deeper in the class to
791
+ // account for other things but for now we keep it simpler. Second, we try to
792
+ // account for the tile subarray (DenseTileSubarray). This class will have a
793
+ // vector of ranges per dimensions, so 1 + dim_num * sizeof(vector). Here we
794
+ // choose 32 for the size of the vector to anticipate the conversion to a PMR
795
+ // vector. We also add dim_num * 2 * sizeof(DimType) to account for at least
796
+ // one range per dimension (this should be improved by accounting for the
797
+ // exact number of ranges). Finally for the original range index member, we
798
+ // have to add 1 + dim_num * sizeof(vector) as well and one uint64_t per
799
+ // dimension (this can also be improved by accounting for the
800
+ // exact number of ranges).
804
801
uint64_t est_tile_structs_size =
805
802
sizeof (ResultSpaceTile<DimType>) + (1 + dim_num) * 2 * 32 +
806
803
dim_num * (2 * sizeof (DimType) + sizeof (uint64_t ));
807
804
808
805
// Create the vector of result tiles to operate on. We stop once we reach
809
- // the end or the memory budget. We either reach the tile upper memory
810
- // limit, which is only for unfiltered data, or the limit of the available
811
- // budget, which is for filtered data, unfiltered data and the tile structs.
812
- // We try to process two tile batches at a time so the available memory is
813
- // half of what we have available.
806
+ // the end or the memory budget. We either reach the tile upper memory limit,
807
+ // which is only for unfiltered data, or the limit of the available budget,
808
+ // which is for filtered data, unfiltered data and the tile structs. We try to
809
+ // process two tile batches at a time so the available memory is half of what
810
+ // we have available.
814
811
uint64_t t_end = t_start;
815
812
bool wait_compute_task_before_read = false ;
816
813
bool done = false ;
@@ -898,8 +895,8 @@ DenseReader::compute_result_space_tiles(
898
895
uint64_t tile_memory_filtered = 0 ;
899
896
uint64_t r_idx = n - condition_names.size ();
900
897
901
- // We might not need to load this tile into memory at all for
902
- // aggregation only.
898
+ // We might not need to load this tile into memory at all for aggregation
899
+ // only.
903
900
if (aggregate_only_field[r_idx] &&
904
901
can_aggregate_tile_with_frag_md (
905
902
names[n], result_space_tile, tiles_cell_num[t_end])) {
@@ -956,14 +953,13 @@ DenseReader::compute_result_space_tiles(
956
953
required_memory_unfiltered[r_idx] +
957
954
est_tile_structs_size;
958
955
959
- // Disable the multiple iterations if the tiles don't fit in the
960
- // iteration budget.
956
+ // Disable the multiple iterations if the tiles don't fit in the iteration
957
+ // budget.
961
958
if (total_memory > available_memory_iteration) {
962
959
wait_compute_task_before_read = true ;
963
960
}
964
961
965
- // If a single tile doesn't fit in the available memory, we can't
966
- // proceed.
962
+ // If a single tile doesn't fit in the available memory, we can't proceed.
967
963
if (total_memory > available_memory) {
968
964
throw DenseReaderException (
969
965
" Cannot process a single tile requiring " +
@@ -1007,8 +1003,7 @@ std::vector<ResultTile*> DenseReader::result_tiles_to_load(
1007
1003
const auto & tile_coords = subarray.tile_coords ();
1008
1004
const bool agg_only = name.has_value () && aggregate_only (name.value ());
1009
1005
1010
- // If the result is already loaded in query condition, return the empty
1011
- // list;
1006
+ // If the result is already loaded in query condition, return the empty list;
1012
1007
std::vector<ResultTile*> ret;
1013
1008
if (name.has_value () && condition_names.count (name.value ()) != 0 ) {
1014
1009
return ret;
@@ -1038,8 +1033,8 @@ std::vector<ResultTile*> DenseReader::result_tiles_to_load(
1038
1033
1039
1034
/* *
1040
1035
* Apply the query condition. The computation will be pushed on the compute
1041
- * thread pool in `compute_task`. Callers should wait on this task before
1042
- * using the results of the query condition.
1036
+ * thread pool in `compute_task`. Callers should wait on this task before using
1037
+ * the results of the query condition.
1043
1038
*/
1044
1039
template <class DimType , class OffType >
1045
1040
Status DenseReader::apply_query_condition (
0 commit comments