ProfileReporter.F90 Source File


This file depends on

sourcefile~~profilereporter.f90~~EfferentGraph sourcefile~profilereporter.f90 ProfileReporter.F90 sourcefile~abstractmeternode.f90 AbstractMeterNode.F90 sourcefile~profilereporter.f90->sourcefile~abstractmeternode.f90 sourcefile~baseprofiler.f90 BaseProfiler.F90 sourcefile~profilereporter.f90->sourcefile~baseprofiler.f90 sourcefile~multicolumn.f90 MultiColumn.F90 sourcefile~profilereporter.f90->sourcefile~multicolumn.f90 sourcefile~separatorcolumn.f90 SeparatorColumn.F90 sourcefile~profilereporter.f90->sourcefile~separatorcolumn.f90 sourcefile~textcolumn.f90 TextColumn.F90 sourcefile~profilereporter.f90->sourcefile~textcolumn.f90 sourcefile~textcolumnvector.f90 TextColumnVector.F90 sourcefile~profilereporter.f90->sourcefile~textcolumnvector.f90 sourcefile~abstractmeter.f90 AbstractMeter.F90 sourcefile~abstractmeternode.f90->sourcefile~abstractmeter.f90 sourcefile~baseprofiler.f90->sourcefile~abstractmeternode.f90 sourcefile~baseprofiler.f90->sourcefile~abstractmeter.f90 sourcefile~advancedmeter.f90 AdvancedMeter.F90 sourcefile~baseprofiler.f90->sourcefile~advancedmeter.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~baseprofiler.f90->sourcefile~errorhandling.f90 sourcefile~keywordenforcer.f90 KeywordEnforcer.F90 sourcefile~baseprofiler.f90->sourcefile~keywordenforcer.f90 sourcefile~meternode.f90 MeterNode.F90 sourcefile~baseprofiler.f90->sourcefile~meternode.f90 sourcefile~meternodeptr.f90 MeterNodePtr.F90 sourcefile~baseprofiler.f90->sourcefile~meternodeptr.f90 sourcefile~meternodestack.f90 MeterNodeStack.F90 sourcefile~baseprofiler.f90->sourcefile~meternodestack.f90 sourcefile~multicolumn.f90->sourcefile~abstractmeternode.f90 sourcefile~multicolumn.f90->sourcefile~separatorcolumn.f90 sourcefile~multicolumn.f90->sourcefile~textcolumn.f90 sourcefile~multicolumn.f90->sourcefile~textcolumnvector.f90 sourcefile~separatorcolumn.f90->sourcefile~abstractmeternode.f90 sourcefile~abstractcolumn.f90 AbstractColumn.F90 sourcefile~separatorcolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~simpletextcolumn.f90 SimpleTextColumn.F90 sourcefile~separatorcolumn.f90->sourcefile~simpletextcolumn.f90 sourcefile~textcolumn.f90->sourcefile~abstractmeternode.f90 sourcefile~textcolumnvector.f90->sourcefile~textcolumn.f90 sourcefile~abstractcolumn.f90->sourcefile~abstractmeternode.f90 sourcefile~distributedmeter.f90 DistributedMeter.F90 sourcefile~abstractcolumn.f90->sourcefile~distributedmeter.f90 sourcefile~abstractmeter.f90->sourcefile~errorhandling.f90 sourcefile~advancedmeter.f90->sourcefile~abstractmeter.f90 sourcefile~abstractgauge.f90 AbstractGauge.F90 sourcefile~advancedmeter.f90->sourcefile~abstractgauge.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90 sourcefile~meternode.f90->sourcefile~abstractmeternode.f90 sourcefile~meternode.f90->sourcefile~abstractmeter.f90 sourcefile~meternodevector.f90 MeterNodeVector.F90 sourcefile~meternode.f90->sourcefile~meternodevector.f90 sourcefile~meternodeptr.f90->sourcefile~abstractmeternode.f90 sourcefile~meternodestack.f90->sourcefile~meternodeptr.f90 sourcefile~simpletextcolumn.f90->sourcefile~abstractmeternode.f90 sourcefile~simpletextcolumn.f90->sourcefile~textcolumn.f90 sourcefile~abstractgauge.f90->sourcefile~abstractmeter.f90 sourcefile~distributedmeter.f90->sourcefile~abstractmeter.f90 sourcefile~distributedmeter.f90->sourcefile~advancedmeter.f90 sourcefile~distributedmeter.f90->sourcefile~errorhandling.f90 sourcefile~distributedmeter.f90->sourcefile~abstractgauge.f90 sourcefile~meternodevector.f90->sourcefile~abstractmeternode.f90

Files dependent on this one

sourcefile~~profilereporter.f90~~AfferentGraph sourcefile~profilereporter.f90 ProfileReporter.F90 sourcefile~mapl_profiler.f90~2 MAPL_Profiler.F90 sourcefile~mapl_profiler.f90~2->sourcefile~profilereporter.f90 sourcefile~abstractserver.f90 AbstractServer.F90 sourcefile~abstractserver.f90->sourcefile~mapl_profiler.f90~2 sourcefile~applicationsupport.f90 ApplicationSupport.F90 sourcefile~applicationsupport.f90->sourcefile~mapl_profiler.f90~2 sourcefile~base_base_implementation.f90 Base_Base_implementation.F90 sourcefile~base_base_implementation.f90->sourcefile~mapl_profiler.f90~2 sourcefile~demo.f90 demo.F90 sourcefile~demo.f90->sourcefile~mapl_profiler.f90~2 sourcefile~extdatadrivergridcomp.f90 ExtDataDriverGridComp.F90 sourcefile~extdatadrivergridcomp.f90->sourcefile~mapl_profiler.f90~2 sourcefile~mapl.f90 MAPL.F90 sourcefile~mapl.f90->sourcefile~mapl_profiler.f90~2 sourcefile~mapl_bundleio_test.f90 mapl_bundleio_test.F90 sourcefile~mapl_bundleio_test.f90->sourcefile~mapl_profiler.f90~2 sourcefile~mapl_capgridcomp.f90 MAPL_CapGridComp.F90 sourcefile~mapl_capgridcomp.f90->sourcefile~mapl_profiler.f90~2 sourcefile~mapl_generic.f90~2 MAPL_Generic.F90 sourcefile~mapl_generic.f90~2->sourcefile~mapl_profiler.f90~2 sourcefile~mapl_nuopcwrappermod.f90 MAPL_NUOPCWrapperMod.F90 sourcefile~mapl_nuopcwrappermod.f90->sourcefile~mapl_profiler.f90~2 sourcefile~mapl_verticalmethods.f90 MAPL_VerticalMethods.F90 sourcefile~mapl_verticalmethods.f90->sourcefile~mapl_profiler.f90~2 sourcefile~maplframework.f90 MaplFramework.F90 sourcefile~maplframework.f90->sourcefile~mapl_profiler.f90~2 sourcefile~mpi_demo.f90 mpi_demo.F90 sourcefile~mpi_demo.f90->sourcefile~mapl_profiler.f90~2 sourcefile~mpiserver.f90 MpiServer.F90 sourcefile~mpiserver.f90->sourcefile~mapl_profiler.f90~2 sourcefile~multigroupserver.f90 MultiGroupServer.F90 sourcefile~multigroupserver.f90->sourcefile~mapl_profiler.f90~2 sourcefile~regrid_util.f90 Regrid_Util.F90 sourcefile~regrid_util.f90->sourcefile~mapl_profiler.f90~2 sourcefile~serverthread.f90 ServerThread.F90 sourcefile~serverthread.f90->sourcefile~mapl_profiler.f90~2 sourcefile~test_advancedmeter.pf test_AdvancedMeter.pf sourcefile~test_advancedmeter.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_column.pf test_Column.pf sourcefile~test_column.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_distributedmeter.pf test_DistributedMeter.pf sourcefile~test_distributedmeter.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_exclusivecolumn.pf test_ExclusiveColumn.pf sourcefile~test_exclusivecolumn.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_meternode.pf test_MeterNode.pf sourcefile~test_meternode.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_meternodeiterator.pf test_MeterNodeIterator.pf sourcefile~test_meternodeiterator.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_namecolumn.pf test_NameColumn.pf sourcefile~test_namecolumn.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_percentagecolumn.pf test_PercentageColumn.pf sourcefile~test_percentagecolumn.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_profilereporter.pf test_ProfileReporter.pf sourcefile~test_profilereporter.pf->sourcefile~mapl_profiler.f90~2 sourcefile~test_timeprofiler.pf test_TimeProfiler.pf sourcefile~test_timeprofiler.pf->sourcefile~mapl_profiler.f90~2

Source Code

module MAPL_ProfileReporter
   use MAPL_AbstractMeterNode
   use MAPL_TextColumn
   use MAPL_SeparatorColumn
   use MAPL_TextColumnVector
   use MAPL_MultiColumn
   use MAPL_BaseProfiler
   implicit none
   private

   public :: ProfileReporter

   type, extends(MultiColumn) :: ProfileReporter
      private
   contains
      procedure :: generate_report_profiler
      generic :: generate_report => generate_report_profiler
   end type ProfileReporter


   interface ProfileReporter
      module procedure :: new_ProfileReporter
   end interface ProfileReporter

   
contains

   function new_ProfileReporter(header) result(reporter)
      type(ProfileReporter) :: reporter
      character(*), intent(in) :: header(:)
      reporter%MultiColumn = MultiColumn(header)
   end function new_ProfileReporter


   function generate_report_profiler(this, p) result(report_lines)
      character(:), allocatable :: report_lines(:)
      class (ProfileReporter), target, intent(in) :: this
      class (BaseProfiler), target, intent(in) :: p

      integer :: width, height
      integer :: i
      character(:), allocatable :: rows(:)
      character(:), allocatable :: header(:)
      class (AbstractMeterNode), pointer :: node

      call this%get_header(header)
      node => p%get_root_node()
      call this%get_rows(node, rows)
      width = this%get_width()
      height = size(header) + size(rows)
      
      allocate(character(len=width) :: report_lines(height))
      do i = 1, size(header)
         report_lines(i) = header(i)
      end do
      do i = size(header)+1, height
         report_lines(i) = rows(i - size(header))
      end do

   end function generate_report_profiler
   

   
end module MAPL_ProfileReporter