gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
377 stars 273 forks source link

Scenario calculation (with conditioning_gmf) not working #8915

Closed LanaTodorovic93 closed 1 year ago

LanaTodorovic93 commented 1 year ago

Hi! I am trying to run the scenario using the conditioned GMF calculator on Windows OS, however, the calculation fails on current master (154b59f643f3f53e81b7382fd0a164ac59337129). As per instructions here I am using python 3.10.0. The following error appears (traceback):

Traceback (most recent call last): File "C:\Users\lanat\openquake\Scripts\oq-script.py", line 33, in sys.exit(load_entry_point('openquake.engine', 'console_scripts', 'oq')()) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\commands__main__.py", line 48, in oq sap.run(commands, prog='oq') File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\baselib\sap.py", line 212, in run return _run(parser(funcdict, parserkw), argv) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\baselib\sap.py", line 203, in _run return func(dic) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\commands\engine.py", line 175, in main run_jobs(jobs) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\engine\engine.py", line 413, in run_jobs run_calc(jobctx) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\engine\engine.py", line 285, in run_calc calc.run(shutdown=True) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\calculators\base.py", line 253, in run raise exc from None File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\calculators\base.py", line 242, in run self.result = self.execute() File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\calculators\event_based.py", line 594, in execute acc = smap.reduce(self.agg_dicts) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\baselib\parallel.py", line 865, in reduce return self.submit_all().reduce(agg, acc) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\baselib\parallel.py", line 585, in reduce acc = agg(acc, result) File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\calculators\event_based.py", line 474, in agg_dicts sbe = build_slice_by_event( File "C:\Users\lanat\Desktop\GEM\oq_master\oq-engine\openquake\commonlib\calc.py", line 355, in build_slice_by_event arr = performance.idx_start_stop(eids) File "C:\Users\lanat\openquake\lib\site-packages\numba\core\dispatcher.py", line 703, in _explain_matching_error raise TypeError(msg) TypeError: No matching definition for argument type(s) array(int32, 1d, C)

I am attaching an example.

share_PGA.zip

LanaTodorovic93 commented 1 year ago

The same example successfully completed on OpenQuake version 3.17.2.

CatalinaYepes commented 1 year ago

In addition, the log file displaying the nominal bias is not appearing in the calculation log.

"GSIM: %s, IMT: %s, Nominal bias mean: %.3f, Nominal bias stddev: %.3f"
ptormene commented 1 year ago

I tried to reduce site_model.csv for debugging purposes. Reducing it to 500 lines, the error on Windows does not occur. Reducing it to 1000 lines, it still occurs: site_model.csv

ptormene commented 1 year ago

The missing log line seems to be caused by multiprocessing. Running the calculation with OQ_DISTRIBUTE=no, the log is displayed correctly. Otherwise, all logs of level info are not shown and logs of levels warning or error are displayed without the proper format specified in the engine.

ptormene commented 1 year ago

The difference between Linux and Windows is that at line https://github.com/gem/oq-engine/blob/master/openquake/commonlib/calc.py#L355 on Linux eids.dtype is dtype('int64'), whereas on Windows it is dtype('int32').

CatalinaYepes commented 1 year ago

See here other things to improve in this calculator: https://github.com/gem/oq-engine/issues/8930