test_percent_inclusive Subroutine

public subroutine test_percent_inclusive()

Uses

  • proc~~test_percent_inclusive~~UsesGraph proc~test_percent_inclusive test_percent_inclusive iso_fortran_env iso_fortran_env proc~test_percent_inclusive->iso_fortran_env

Arguments

None

Calls

proc~~test_percent_inclusive~~CallsGraph proc~test_percent_inclusive test_percent_inclusive add_cycle add_cycle proc~test_percent_inclusive->add_cycle assertequal assertequal proc~test_percent_inclusive->assertequal at at proc~test_percent_inclusive->at none~add_child~4 MeterNode%add_child proc~test_percent_inclusive->none~add_child~4 none~get_child~16 MeterNode%get_child proc~test_percent_inclusive->none~get_child~16 none~get_meter~2 MeterNode%get_meter proc~test_percent_inclusive->none~get_meter~2 none~get_rows~5 PercentageColumn%get_rows proc~test_percent_inclusive->none~get_rows~5 none~find_child MeterNode%find_child none~add_child~4->none~find_child none~get_depth~2 MeterNode%get_depth none~add_child~4->none~get_depth~2 none~push_back~29 MeterNodeVector%push_back none~add_child~4->none~push_back~29 none~at~135 MeterNodeVector%at none~get_child~16->none~at~135 none~get_child~16->none~find_child none~get_rows~5->at get_rows get_rows none~get_rows~5->get_rows push_back push_back none~get_rows~5->push_back none~at_32~25 MeterNodeVector%at_32 none~at~135->none~at_32~25 none~find_child->none~at~135 none~capacity~169 MeterNodeVector%capacity none~push_back~29->none~capacity~169 none~resize~58 MeterNodeVector%resize none~push_back~29->none~resize~58 none~at_size_kind~29 MeterNodeVector%at_size_kind none~at_32~25->none~at_size_kind~29 none~resize_32~25 MeterNodeVector%resize_32 none~resize~58->none~resize_32~25

Source Code

   subroutine test_percent_inclusive()
      use, intrinsic :: iso_fortran_env, only: REAL64
      type (PercentageColumn) :: c
      type (MeterNode), target :: node
      class (AbstractMeterNode), pointer :: child
      class (AbstractMeter), pointer :: t
      type(UnlimitedVector), target :: v
      integer :: i
      integer :: expected(2)
      class(*), pointer :: q

      node = MeterNode('foo', AdvancedMeter(MpiTimerGauge()))
      t => node%get_meter()
      call t%add_cycle(10.0_REAL64)

      call node%add_child('a', AdvancedMeter(MpiTimerGauge()))
      child => node%get_child('a')
      t => child%get_meter()
      call t%add_cycle(5.0_REAL64)

      c = PercentageColumn(InclusiveColumn(),'MAX')

      v = c%get_rows(node)
      expected = [100.,50.]
      do i = 1, 2
         q => v%at(i)
         select type (q)
         type is (real(kind=REAL64))
            @assertEqual(expected(i), q)
         end select
      end do

   end subroutine test_percent_inclusive