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
379 stars 273 forks source link

Saving a bit more memory in classical calculations #9813

Closed micheles closed 3 months ago

micheles commented 3 months ago

Here is performance.zip on my mini-pc:

# before
| calc_31392, maxmem=15.0 GB | time_sec | memory_mb | counts  |
|----------------------------+----------+-----------+---------|
| total classical            | 9_245    | 78.1016   | 66      |
| get_poes                   | 5_086    | 0.0       | 382_180 |
| computing mean_std         | 1_748    | 0.0       | 7_710   |
| composing pnes             | 1_592    | 0.0       | 382_180 |
| ClassicalCalculator.run    | 601.1    | 118.2188  | 1       |

# after
| calc_31390, maxmem=14.1 GB | time_sec | memory_mb | counts  |
|----------------------------+----------+-----------+---------|
| total classical            | 8_703    | 64.6309   | 66      |
| get_poes                   | 4_859    | 0.0       | 359_960 |
| computing mean_std         | 1_564    | 0.0       | 14_434  |
| composing pnes             | 1_522    | 0.0       | 359_960 |
| ClassicalCalculator.run    | 569.2    | 113.0273  | 1       |

Incidentally, it is 32 seconds faster even if the number of calls to "computing mean_std" doubles. The number of calls to "get_poes" and "composing poes" decreases a bit.