test_simple_report_timer_b Subroutine

public subroutine test_simple_report_timer_b()

Arguments

None

Calls

proc~~test_simple_report_timer_b~~CallsGraph proc~test_simple_report_timer_b test_simple_report_timer_b assertequal assertequal proc~test_simple_report_timer_b->assertequal none~add_column MultiColumn%add_column proc~test_simple_report_timer_b->none~add_column none~finalize~14 BaseProfiler%finalize proc~test_simple_report_timer_b->none~finalize~14 none~generate_report ProfileReporter%generate_report proc~test_simple_report_timer_b->none~generate_report none~start~83 TimeProfiler%start proc~test_simple_report_timer_b->none~start~83 get_num_rows_header get_num_rows_header none~add_column->get_num_rows_header none~get_num_rows_separator TextColumn%get_num_rows_separator none~add_column->none~get_num_rows_separator none~get_width TextColumn%get_width none~add_column->none~get_width none~push_back TextColumnVector%push_back none~add_column->none~push_back none~set_width TextColumn%set_width none~add_column->none~set_width none~finalize~3 AbstractMeter%finalize none~finalize~14->none~finalize~3 none~get_meter MeterNode%get_meter none~finalize~14->none~get_meter none~pop_back~41 MeterNodeStack%pop_back none~finalize~14->none~pop_back~41 none~generate_report_profiler ProfileReporter%generate_report_profiler none~generate_report->none~generate_report_profiler none~start_self BaseProfiler%start_self none~start~83->none~start_self mpi_op_free mpi_op_free none~finalize~3->mpi_op_free mpi_type_free mpi_type_free none~finalize~3->mpi_type_free proc~mapl_verify MAPL_Verify none~finalize~3->proc~mapl_verify none~generate_report_profiler->none~get_width none~get_header~4 MultiColumn%get_header none~generate_report_profiler->none~get_header~4 none~get_root_node BaseProfiler%get_root_node none~generate_report_profiler->none~get_root_node none~get_rows~6 MultiColumn%get_rows none~generate_report_profiler->none~get_rows~6 none~capacity TextColumnVector%capacity none~push_back->none~capacity none~resize~2 TextColumnVector%resize none~push_back->none~resize~2 interface~mapl_assert MAPL_Assert none~start_self->interface~mapl_assert none~get_name~5 MeterNode%get_name none~start_self->none~get_name~5 none~start~47 BaseProfiler%start none~start_self->none~start~47 proc~mapl_return MAPL_Return none~start_self->proc~mapl_return

Source Code

   subroutine test_simple_report_timer_b()
      type (TimeProfiler), target :: prof
      type (ProfileReporter) :: reporter
      
      character(:), allocatable :: report_lines(:)

      prof = TimeProfiler('top')   ! timer 1
      call prof%start()
      call prof%start('timer_1') ! 2
      call prof%start('timer_1a')! 3
      call prof%stop('timer_1a')
      call prof%start('timer_1b') ! 4
      call prof%start('timer_1b1') ! 5
      call prof%stop('timer_1b1')
      call prof%stop('timer_1b')
      call prof%stop('timer_1')
      call prof%start('timer_2') ! 6
      call prof%start('timer_2b')! 7
      call prof%stop('timer_2b')
      call prof%stop('timer_2')

      call prof%start('timer_1') ! 2
      call prof%start('timer_1a')! 3
      call prof%stop('timer_1a')
      call prof%stop('timer_1')

      call prof%start('timer_2') ! 6
      call prof%stop('timer_2')
      call prof%start('timer_2') ! 6
      call prof%stop('timer_2')

      call prof%finalize()


      reporter = ProfileReporter(empty)
      call reporter%add_column(NameColumn(20))
      call reporter%add_column(FormattedTextColumn('# cycles','(i8.0)', 8, NumCyclesColumn()))
      call reporter%add_column(FormattedTextColumn('T(incl)','(f15.6)', 15, InclusiveColumn()))
      report_lines = reporter%generate_report(prof)

      @assertEqual(1 + 7, size(report_lines))
      @assertEqual(20 + 1 + 8 + 1 + 15, len(report_lines(1)))

      @assertEqual('Name                 # cycles', report_lines(1)(1:29))
      @assertEqual('top                         1', report_lines(2)(1:29))
      @assertEqual('--timer_1                   2', report_lines(3)(1:29))
      @assertEqual('----timer_1a                2', report_lines(4)(1:29))
      @assertEqual('----timer_1b                1', report_lines(5)(1:29))
      @assertEqual('------timer_1b1             1', report_lines(6)(1:29))
      @assertEqual('--timer_2                   3', report_lines(7)(1:29))
      @assertEqual('----timer_2b                1', report_lines(8)(1:29))

   end subroutine test_simple_report_timer_b