test_accumulate Subroutine

public subroutine test_accumulate()

Arguments

None

Calls

proc~~test_accumulate~~CallsGraph proc~test_accumulate test_accumulate assertequal assertequal proc~test_accumulate->assertequal none~accumulate~2 AdvancedMeter%accumulate proc~test_accumulate->none~accumulate~2 none~add_cycle~2 AdvancedMeter%add_cycle proc~test_accumulate->none~add_cycle~2 none~get_num_cycles AdvancedMeter%get_num_cycles proc~test_accumulate->none~get_num_cycles none~get_standard_deviation AdvancedMeter%get_standard_deviation proc~test_accumulate->none~get_standard_deviation none~get_total~2 AdvancedMeter%get_total proc~test_accumulate->none~get_total~2 none~reset~30 AdvancedMeter%reset proc~test_accumulate->none~reset~30 none~get_mean_cycle AdvancedMeter%get_mean_cycle none~add_cycle~2->none~get_mean_cycle none~get_mean_cycle->none~get_num_cycles

Source Code

   subroutine test_accumulate()
      type (AdvancedMeter) :: t, lap

      t = AdvancedMeter(MpiTimerGauge())
      lap = t

      call lap%add_cycle(increment=1._REAL64)
      call lap%add_cycle(increment=3._REAL64)

      ! Copy lap and verify state is as expected
      t = lap
      call lap%reset()
      @assertEqual(4., t%get_total())
      @assertEqual(1., t%get_standard_deviation())

      ! Use lap again and accumulate
      call lap%add_cycle(increment=2._REAL64)
      call lap%add_cycle(increment=4._REAL64)

      call t%accumulate(lap)
      @assertEqual(9., t%get_total())
      @assertEqual(4, t%get_num_cycles())

   end subroutine test_accumulate