Skip to content

Commit

Permalink
Added parameter max_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Sep 19, 2024
1 parent 10faa5a commit 814c61f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions openquake/commonlib/oqvalidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@
Example: *max_aggregations = 200_000*
Default: 100_000
max_blocks:
INTERNAL. Used in classical calculations
max_data_transfer:
INTERNAL. Restrict the maximum data transfer in disaggregation calculations.
Expand Down Expand Up @@ -1065,6 +1068,7 @@ class OqParam(valid.ParamSet):
asset_hazard_distance = valid.Param(valid.floatdict, {'default': 15}) # km
max = valid.Param(valid.boolean, False)
max_aggregations = valid.Param(valid.positivefloat, 1E5)
max_blocks = valid.Param(valid.positiveint, 100)
max_data_transfer = valid.Param(valid.positivefloat, 2E11)
max_gmvs_chunk = valid.Param(valid.positiveint, 100_000) # for 2GB limit
max_potential_gmfs = valid.Param(valid.positiveint, 1E12)
Expand Down
5 changes: 3 additions & 2 deletions openquake/hazardlib/source_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,10 @@ def split(self, cmakers, sitecol, max_weight, num_chunks=1, tiling=False):
max(hint, splits), oq.max_sites_disagg))
else:
blocks = list(general.split_in_blocks(
sg, min(hint, 100), lambda s: s.weight))
sg, min(hint, oq.max_blocks), lambda s: s.weight))
tilegetters = list(sitecol.split(
int(G * mb_per_gsim / max_mb * hint / 100), oq.max_sites_disagg))
int(G * mb_per_gsim / max_mb * hint / oq.max_blocks),
oq.max_sites_disagg))
self.splits.append(splits)
cmaker.tiling = tiling
cmaker.gsims = list(cmaker.gsims) # save data transfer
Expand Down

0 comments on commit 814c61f

Please sign in to comment.