-
Notifications
You must be signed in to change notification settings - Fork 20
Add tracing instrumentation to nuopc driver #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
@DusanJovic-NOAA CICE has a |
|
@DusanJovic-NOAA Same question as for WW3---could you put this in the wrapper mod and avoid the ifdefs in the cap? |
OK, I tried adding the stub version of the 'ufs_trace_mod' in diff --git a/cicecore/drivers/nuopc/cmeps/cice_wrapper_mod.F90 b/cicecore/drivers/nuopc/cmeps/cice_wrapper_mod.F90
index db0140b..7532791 100644
--- a/cicecore/drivers/nuopc/cmeps/cice_wrapper_mod.F90
+++ b/cicecore/drivers/nuopc/cmeps/cice_wrapper_mod.F90
@@ -101,3 +101,28 @@ end subroutine t_barrierf
#endif
end module cice_wrapper_mod
+
+#ifndef UFS_TRACING
+
+module ufs_trace_mod
+
+ implicit none
+ public ufs_trace_init
+ public ufs_trace
+ public ufs_trace_finalize
+
+contains
+
+ subroutine ufs_trace_init()
+ end subroutine ufs_trace_init
+
+ subroutine ufs_trace(component, routine, ph)
+ character(len=*), intent(in) :: component, routine, ph
+ end subroutine ufs_trace
+
+ subroutine ufs_trace_finalize()
+ end subroutine ufs_trace_finalize
+
+end module ufs_trace_mod
+
+#endif And removed all Compilation, actually linking, fails with "'multiple definition of `ufs_trace_mod._'" error.
As I expected, see my comment in NOAA-EMC/WW3#1494 (comment) |
Instead of adding the stub module in the cap, as I tried above, we could add a wrapper module, as we did in CMEPS. The wrapper module will still have ifdefs, while the cap will just call the wrapper routines without ifdefs. |
For detailed information about submitting Pull Requests (PRs) to the CICE-Consortium,
please refer to: https://github.com/CICE-Consortium/About-Us/wiki/Resource-Index#information-for-developers
PR checklist
Add tracing instrumentation to nuopc driver
ENTER INFORMATION HERE
ENTER INFORMATION HERE
This PR adds calls to ufs tracing routines that will create a trace file which can then be visualized, which is found to be useful in identifying various performance issues.
See ufs-weather-model issue ufs-community/ufs-weather-model#2883
Added calls are not used by default, unless build option (-DUFS_TRACING=ON) is specified when building the ufs-weather-model.