Temporal fix for slow nudging with FMS2 #7
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It has been reported from our seasonal prediction workflow that the current MOM6 nudging cycle is much slower with FMS2:
With FMS1:
With FMS2:
Through deeper investigation, I found that for whatever reason, the
get_external_field_info
function called byhoriz_interp_and_extrap_tracer_fms_id
is significantly slower with FMS2. Since the field name and axes size are static, there is no need to re-fetch all this information for every time step.This PR introduces a new logic
first_time
in theget_external_field_info
function so that it gets axes info only at the first step.Please note that this is just a temporary fix (which is why I chose to merge it to our dev/cefi branch first); we still need to investigate further to determine the root cause of why the
get_external_field_info
function is much slower with FMS2. In the meantime, this PR can make the model run with FMS2 at almost the same speed as with FMS1 (only 0.03% slower in a one-year run, see below profiling).FMS2 with new fix one year run:
FMS1 with new fix one year run:
Once it merges, we can start using the new diag manager and sub-regional output that are offered by FMS2.