[x] Implemented the source code change that satisfies the tests
[x] Documented the feature by providing worked example
[ ] Updated the README or other documentation
[x] Completed the pre-Request checklist below
Change Description
Replaced on-the-fly computing of quadrature in BBMStressUpdate by precomputed values from ParametricMomentumMap.
Required changes:
added the vector iJMwPSI_dam[...] to ParametricMomentumMap. This is (inverse Mass(x_q))^{-1} J(x_q) w(q) * PSI[i] (xq) where x_q is the quadrature point and i is the basis function. iJMwPSI is the same in the DGstress-space, and _dam is in the DGadvection space.
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
[x] The requirements of this pull request are fully captured in an issue or design specification and are linked and summarised in the description of this PR
[x] No new warnings are generated
[x] The documentation has been updated (or an issue has been created to track the corresponding change)
[x] Methods and Tests are commented such that they can be understood without having to obtain additional context
[x] This PR/Issue is labelled as a bug/feature/enhancement/breaking change
[x] File dates have been updated to reflect modification date
[x] This change conforms to the conventions described in the README
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