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

Add Fortran scope/namespace to timer name to match PDT parsers #35

Open
zbeekman opened this issue Feb 1, 2025 · 1 comment
Open

Add Fortran scope/namespace to timer name to match PDT parsers #35

zbeekman opened this issue Feb 1, 2025 · 1 comment

Comments

@zbeekman
Copy link
Member

zbeekman commented Feb 1, 2025

The PDT parsers will emit timer names that reflect the scope of the procedure declaration. For example you might have nested internal procedures within a module or a main program:

program main
  implicit none
  call greet("sam")
contains
  subroutine greet(person)
    character(len=*), intent(in) :: person
    character(len=:), allocatable :: message
    message = get_greeting_for(person)
    print*, trim(message)
  contains
    function get_greeting_for(person)
      character(*), intent(in) :: person
      character(:), allocatable :: get_greeting_for
      associate(msg => "Hello "//trim(person)//"!")
        allocate(get_greeting_for, source=msg)
      end associate
    end function get_greeting_for
  end subroutine greet
end program main

PDT seems to declare timers like main::greet and main::greet::get_greeting_for

@zbeekman
Copy link
Member Author

zbeekman commented Feb 1, 2025

well, recent GFortrans don't support nesting multiple contains statements, so this might not be correct code, but, you will still have internal procedures inside of modules and main programs...

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

No branches or pull requests

1 participant