Skip to content
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

Create MAPL.profiler logger #1938

Merged
merged 7 commits into from
Feb 13, 2023
Merged

Conversation

mathomp4
Copy link
Member

Description

This PR creates a new MAPL.profiler logger and moves some current writes to use logger:

  • Model throughput
  • Per-component timers
  • Global timers

For GEOS, this will create pretty much the same log output as long as:

   MAPL.profiler:
       handlers: [console_plain]
       propagate: FALSE
       level: WARNING
       root_level: INFO

is in logging.yaml. As such, an PR will be needed for GEOSgcm_App (see GEOS-ESM/GEOSgcm_App#391)

Related Issue

Closes #1930

Motivation and Context

This will allow users to have most of MAPL at WARNING LEVEL but have the timers always output.

How Has This Been Tested?

Tested with GEOS. Zero-diff.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@mathomp4 mathomp4 added the 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. label Jan 19, 2023
@mathomp4 mathomp4 self-assigned this Jan 19, 2023
@mathomp4 mathomp4 linked an issue Jan 19, 2023 that may be closed by this pull request
@mathomp4
Copy link
Member Author

@tclune Please take a look at this. It was a pretty one-for-one swap of writes to logger. But perhaps I'm now violating how logger should be used with things like logger-on-one-process:

      if (my_rank == 0) then
         report_lines = reporter%generate_report(t_p)
         lgr => logging%get_logger('MAPL.profiler')
         call lgr%info('Report on process: %i0', my_rank)
         do i = 1, size(report_lines)
            call lgr%info('%a', report_lines(i))
         end do
      end if

@mathomp4 mathomp4 marked this pull request as ready for review January 24, 2023 14:00
@mathomp4 mathomp4 requested a review from a team as a code owner January 24, 2023 14:00
Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

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

Ooh nice. I had no idea that this was being worked on!

@mathomp4 mathomp4 merged commit 4e17985 into develop Feb 13, 2023
@mathomp4 mathomp4 deleted the feature/mathomp4/1930-profiler-output branch February 13, 2023 21:15
@lizziel
Copy link
Contributor

lizziel commented Mar 21, 2023

Looks good to me! Thanks for putting this together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: always report model throughput after finalize
3 participants