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

Fix for BaseProfiler to match v2.6.4 #764

Closed
wants to merge 1 commit into from

Conversation

mathomp4
Copy link
Member

Description

I believe I found an issue between BaseProfiler in v2.6.4 and in develop.

First in v2.6.4:

      if (this%stack%empty()) then
         block
           use MPI
           integer :: rank, ierror
           call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierror)
           if (rank == 0) then
             _ASSERT(.false., "Timer "//name//' should not start when empty: ')
           end if
         end block
         return
      else
         node => this%stack%back()
         if (.not. node%has_child(name)) then
           m = this%make_meter()
           call node%add_child(name, m) !this%make_meter())
         end if
      endif

now in develop:

      if (this%stack%empty()) this%status = INCORRECTLY_NESTED_METERS
      _ASSERT_RC(.not. this%stack%empty(),"Timer <"//name// "> should not start when empty.",INCORRECTLY_NESTED_METERS)


      node => this%stack%back()
      if (.not. node%has_child(name)) then
         m = this%make_meter()
         call node%add_child(name, m) !this%make_meter())
      end if

The if-block got collapsed. Note, this doesn't seem to fix #762, but I saw it during my code walkthrough.

Related Issue

Motivation and Context

I think it's a bug.

How Has This Been Tested?

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 self-assigned this Mar 19, 2021
@mathomp4
Copy link
Member Author

Per conversation with @tclune, yeah, this isn't a bug fix. Just a "Matt didn't quite understand what was happening" thing.

Still, it passed our CI tests. Which is nice. :)

@mathomp4 mathomp4 closed this Mar 19, 2021
@mathomp4 mathomp4 deleted the bugfix/mathomp4/profiler-fix branch May 20, 2021 17:18
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.

1 participant