diff --git a/openquake/commonlib/calc.py b/openquake/commonlib/calc.py index c202c60faa8c..97f9dccdd487 100644 --- a/openquake/commonlib/calc.py +++ b/openquake/commonlib/calc.py @@ -397,8 +397,11 @@ 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 @@ -406,7 +409,6 @@ def starmap_from_gmfs(task_func, oq, dstore, mon): 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: