Skip to content

Add tracing instrumentation to nuopc driver#151

Merged
DeniseWorthen merged 16 commits into
NOAA-EMC:emc/developfrom
DusanJovic-NOAA:ufs_tracing
Jan 20, 2026
Merged

Add tracing instrumentation to nuopc driver#151
DeniseWorthen merged 16 commits into
NOAA-EMC:emc/developfrom
DusanJovic-NOAA:ufs_tracing

Conversation

@DusanJovic-NOAA
Copy link
Copy Markdown

Description of changes

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.

No changes in answers are expected.

Specific notes

Contributors other than yourself, if any:

CMEPS Issues Fixed (include github issue #):

Are changes expected to change answers? (specify if bfb, different at roundoff, more substantial)
b4b

Any User Interface Changes (namelist or namelist defaults changes)?
No

Testing performed

Please describe the tests along with the target model and machine(s)
If possible, please also added hashes that were used in the testing

Comment thread mediator/med.F90
Copy link
Copy Markdown

@jedwards4b jedwards4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest that you introduce a new file ufs_trace_wrapper.F90 with ifdef blocks:
#ifdef UFS_TRACE
use ufs_trace_mod, only: ufs_trace
#endif
contains
subroutine ufs_trace_wrapper(a, b, c)
character(len=*), intent(in) :: a, b, c
#ifdef UFS_TRACE
call ufs_trace(a, b, c)
#endif
return
end subroutine
end module

Then call ufs_trace_wrapper in the code instead of having ifdef all over the place.

@DusanJovic-NOAA
Copy link
Copy Markdown
Author

I would suggest that you introduce a new file ufs_trace_wrapper.F90 with ifdef blocks: #ifdef UFS_TRACE use ufs_trace_mod, only: ufs_trace #endif contains subroutine ufs_trace_wrapper(a, b, c) character(len=*), intent(in) :: a, b, c #ifdef UFS_TRACE call ufs_trace(a, b, c) #endif return end subroutine end module

Then call ufs_trace_wrapper in the code instead of having ifdef all over the place.

@jedwards4b Please take a look again. I introduced the wrapper module.

Copy link
Copy Markdown

@jedwards4b jedwards4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMEPS standard requires that you use the only clause with all module use statements.
Otherwise this looks good. Thanks.

Comment thread mediator/med.F90 Outdated
Comment thread mediator/med_phases_history_mod.F90 Outdated
Comment thread mediator/med_phases_ocnalb_mod.F90 Outdated
Comment thread mediator/med_phases_post_atm_mod.F90 Outdated
Comment thread mediator/med_phases_post_ice_mod.F90 Outdated
Comment thread mediator/med_phases_prep_atm_mod.F90 Outdated
Comment thread mediator/med_phases_prep_ice_mod.F90 Outdated
Comment thread mediator/med_phases_prep_ocn_mod.F90 Outdated
Comment thread mediator/med_phases_prep_wav_mod.F90 Outdated
Comment thread mediator/med_phases_restart_mod.F90 Outdated
Copy link
Copy Markdown

@jedwards4b jedwards4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@gspetro-NOAA
Copy link
Copy Markdown

Testing on WM PR 2884 has completed successfully. This PR can be merged.

@DeniseWorthen DeniseWorthen merged commit 5ec03ea into NOAA-EMC:emc/develop Jan 20, 2026
@DusanJovic-NOAA DusanJovic-NOAA deleted the ufs_tracing branch January 21, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants