nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Improve execution speed of BBM stress update #682

Closed einola closed 1 month ago

einola commented 2 months ago

Improve execution speed of BBM stress update

Fixes #539

Task List


Change Description

Replaced on-the-fly computing of quadrature in BBMStressUpdate by precomputed values from ParametricMomentumMap.

Required changes:

This requires adding DGadvection as a template parameter, and hence, several classes with an interface to ParametricMomentumMap had to be touched. We broke compatibility with the old cgParametricMomentum.cpp class. But I think this should be removed anyway as it is replaced by the Kernels.


Test Description

A one-day BBM computation (config_benchmark.cfg with BBM and shortened to 1 day) gives (on 4 threads)

before: ../build/nextsim --config-file config_benchmark-bbm-short.cfg 145,99s user 11,47s system 276% cpu 57,046 total

now: ../build/nextsim --config-file config_benchmark-bbm-short.cfg 56,99s user 9,79s system 195% cpu 34,141 total

34 instead of 57 seconds.


Documentation Impact

N/A


Other Details

The poor parallelization (below 200% CPU util.) is likely due to some inefficiency in passing data. (too many pointers?). @winzerle will investigate.


Pre-Request Checklist