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

Added log entries for stage start/finish in MAPL.GENERIC #1009

Closed

Conversation

LiamBindle
Copy link
Contributor

@LiamBindle LiamBindle commented Aug 30, 2021

Description

This PR adds logging of the start/finish of gridcomp stages. For example

0000: MAPL.GENERIC: INFO: Started the  'SetServices' stage of the gridded component 'GCHP'
0000: MAPL.GENERIC: INFO: Started the  'SetServices' stage of the gridded component 'GCHPctmEnv'
0000: MAPL.GENERIC: INFO: Finished the 'SetServices' stage of the gridded component 'GCHPctmEnv'
0000: MAPL.GENERIC: INFO: Started the  'SetServices' stage of the gridded component 'GCHPchem'
0000: MAPL.GENERIC: INFO: Finished the 'SetServices' stage of the gridded component 'GCHPchem'
0000: MAPL.GENERIC: INFO: Started the  'SetServices' stage of the gridded component 'DYNAMICS'
0000: MAPL.GENERIC: INFO: Finished the 'SetServices' stage of the gridded component 'DYNAMICS'
0000: MAPL.GENERIC: INFO: Finished the 'SetServices' stage of the gridded component 'GCHP'
0000: MAPL.GENERIC: INFO: Started the  'SetServices' stage of the gridded component 'HIST'
0000: MAPL.GENERIC: INFO: Finished the 'SetServices' stage of the gridded component 'HIST'
0000: MAPL.GENERIC: INFO: Started the  'SetServices' stage of the gridded component 'EXTDATA'
0000: MAPL.GENERIC: INFO: Finished the 'SetServices' stage of the gridded component 'EXTDATA'
0000: MAPL.GENERIC: INFO: Started the  'Initialize' stage of the gridded component 'GCHP'
...

Note that one-time stages like SetServices, Initialize, and Finalize are going to MAPL.GENERIC info, and many-time stages like Run and WriteRestartFile go to debug.

Motivation and Context

I'm working on making it easier to troubleshoot errors in GCHP. Logging the start/end of each stage helps keep track of what is going on. If the model crashes for some reason, the log will show what stage of what component it happened in.

How Has This Been Tested?

I've tested it with GCHP.

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)

(I'm not too sure if this fits into trivial, but that seemed like the best fit to me)

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

@LiamBindle LiamBindle requested a review from a team as a code owner August 30, 2021 23:39
@LiamBindle
Copy link
Contributor Author

Still working on the CLA. The admins sent it to the lawyers today.

Im submitting this PR here and now because I'm working on the GCHP version of this PR (so that we can use it immediately).

@mathomp4 mathomp4 added the 🚫 Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs label Aug 31, 2021
@LiamBindle
Copy link
Contributor Author

Are there any concerns with adding this? Just wondering because I'll move ahead with the GCHP version of it if it looks okay, while we wait for the lawyers.

@tclune
Copy link
Collaborator

tclune commented Sep 1, 2021

I think it is fine in principle. I don't think you need the logical flag though. You can just set the description to the empty string and then overwrite in the cases that you've identified. And then always include the description in the log message. Eliminates the conditionals (big win) and a few other lines of code (small win).

@LiamBindle
Copy link
Contributor Author

Thanks for the suggestion, I'll do that.

@@ -1813,7 +1810,6 @@ subroutine MAPL_GenericWrapper ( GC, IMPORT, EXPORT, CLOCK, RC)
! timers => timers_writereastart
NULLIFY(timers)
sbrtn = 'WriteRestart'
stage_is_one_time = .false.
endif MethodBlock
stage_description = ''''//trim(sbrtn)//''' stage of the gridded component '''//trim(COMP_NAME)//''''
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool. I did not know that triple/quad quotes would do this.

else
call lgr%debug('Started the %a', trim(stage_description))
end if
call lgr%info('Started the %a', trim(stage_description))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
call lgr%info('Started the %a', trim(stage_description))
call lgr%info('Started the %a', stage_description)

else
call lgr%debug('Finished the %a', trim(stage_description))
end if
call lgr%info('Finished the %a', trim(stage_description))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
call lgr%info('Finished the %a', trim(stage_description))
call lgr%info('Finished the %a', stage_description)

@tclune tclune self-requested a review September 1, 2021 17:28
@mathomp4
Copy link
Member

@LiamBindle A big MAPL Generic refactoring just went into develop. As GitHub is informing you, conflicts have happened, though hopefully it's pretty simple to figure out how to transition. If not, @Gvilla1000-nasa can help as he did the refactoring.

LiamBindle added a commit to geoschem/geos-chem that referenced this pull request Oct 14, 2021
@stale
Copy link

stale bot commented Nov 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days, it will be closed. You can add the "long term" tag to prevent the Stale bot from closing this issue.

@stale stale bot added the ❄️ Stale This issue has been marked stale label Nov 12, 2021
@LiamBindle
Copy link
Contributor Author

bump

As of December 1st I'll technically be a private consulatant (still working full-time on GCHP though), so I should be able to sign the CLA then.

@stale stale bot removed the ❄️ Stale This issue has been marked stale label Nov 12, 2021
@tclune
Copy link
Collaborator

tclune commented Nov 12, 2021

The lengths some people will go to just to avoid lawyers. :-)

@stale
Copy link

stale bot commented Jan 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days, it will be closed. You can add the "long term" tag to prevent the Stale bot from closing this issue.

@stale stale bot added the ❄️ Stale This issue has been marked stale label Jan 11, 2022
@mathomp4
Copy link
Member

Un-staling. This is a good PR, just waiting on CLA bits.

@stale stale bot removed the ❄️ Stale This issue has been marked stale label Jan 12, 2022
@mathomp4 mathomp4 added the ⌛ Long Term Long term issues label Jan 12, 2022
@LiamBindle
Copy link
Contributor Author

Similar to #1002, I don't plan on pursuing the CLA. I still think this is a useful capability (already it's helped troubleshoot multiple GCHP issues rapidly), but I think this is the end of the line of this PR.

@mathomp4
Copy link
Member

Closing in favor of #1510

@mathomp4 mathomp4 closed this May 17, 2022
@LiamBindle LiamBindle deleted the feature/log-stage-upstream branch September 7, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌛ Long Term Long term issues 🚫 Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants