Skip to content

Commit

Permalink
More logging [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Sep 10, 2023
1 parent da37a11 commit f2658a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openquake/commonlib/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,16 +397,18 @@ def starmap_from_gmfs(task_func, oq, dstore, mon):
:param dstore: DataStore instance where the GMFs are stored
:returns: a Starmap object used for event based calculations
"""
data = dstore['gmf_data']
if 'gmf_data' in dstore.parent:
ds = dstore.parent
gb = sum(data[k].nbytes for k in data) / 1024 ** 3
logging.info('There are %.1f GB of GMFs', gb)
else:
ds = dstore
N = ds['sitecol'].sids.max() + 1
if 'site_model' in ds:
N = max(N, len(ds['site_model']))
with mon('computing event impact', measuremem=True):
num_assets = get_counts(dstore['assetcol/array']['site_id'], N)
data = ds['gmf_data']
try:
sbe = data['slice_by_event'][:]
except KeyError:
Expand Down

0 comments on commit f2658a8

Please sign in to comment.