GlobalProfilers.F90 Source File


This file depends on

sourcefile~~globalprofilers.f90~~EfferentGraph sourcefile~globalprofilers.f90 GlobalProfilers.F90 sourcefile~abstractgauge.f90 AbstractGauge.F90 sourcefile~globalprofilers.f90->sourcefile~abstractgauge.f90 sourcefile~distributedprofiler.f90 DistributedProfiler.F90 sourcefile~globalprofilers.f90->sourcefile~distributedprofiler.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~globalprofilers.f90->sourcefile~errorhandling.f90 sourcefile~keywordenforcer.f90 KeywordEnforcer.F90 sourcefile~globalprofilers.f90->sourcefile~keywordenforcer.f90 sourcefile~mallocgauge.f90 MallocGauge.F90 sourcefile~globalprofilers.f90->sourcefile~mallocgauge.f90 sourcefile~mpitimergauge.f90 MpiTimerGauge.F90 sourcefile~globalprofilers.f90->sourcefile~mpitimergauge.f90 sourcefile~stubprofiler.f90 StubProfiler.F90 sourcefile~globalprofilers.f90->sourcefile~stubprofiler.f90 sourcefile~abstractmeter.f90 AbstractMeter.F90 sourcefile~abstractgauge.f90->sourcefile~abstractmeter.f90 sourcefile~distributedprofiler.f90->sourcefile~abstractgauge.f90 sourcefile~distributedprofiler.f90->sourcefile~mpitimergauge.f90 sourcefile~distributedprofiler.f90->sourcefile~abstractmeter.f90 sourcefile~abstractmeternode.f90 AbstractMeterNode.F90 sourcefile~distributedprofiler.f90->sourcefile~abstractmeternode.f90 sourcefile~advancedmeter.f90 AdvancedMeter.F90 sourcefile~distributedprofiler.f90->sourcefile~advancedmeter.f90 sourcefile~baseprofiler.f90 BaseProfiler.F90 sourcefile~distributedprofiler.f90->sourcefile~baseprofiler.f90 sourcefile~distributedmeter.f90 DistributedMeter.F90 sourcefile~distributedprofiler.f90->sourcefile~distributedmeter.f90 sourcefile~meternode.f90 MeterNode.F90 sourcefile~distributedprofiler.f90->sourcefile~meternode.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90 sourcefile~mallocgauge.f90->sourcefile~abstractgauge.f90 sourcefile~mpitimergauge.f90->sourcefile~abstractgauge.f90 sourcefile~stubprofiler.f90->sourcefile~distributedprofiler.f90 sourcefile~stubprofiler.f90->sourcefile~errorhandling.f90 sourcefile~stubprofiler.f90->sourcefile~keywordenforcer.f90 sourcefile~stubprofiler.f90->sourcefile~abstractmeter.f90 sourcefile~stubprofiler.f90->sourcefile~abstractmeternode.f90 sourcefile~stubprofiler.f90->sourcefile~advancedmeter.f90 sourcefile~stubprofiler.f90->sourcefile~baseprofiler.f90 sourcefile~stubprofiler.f90->sourcefile~meternode.f90 sourcefile~nullgauge.f90 NullGauge.F90 sourcefile~stubprofiler.f90->sourcefile~nullgauge.f90 sourcefile~abstractmeter.f90->sourcefile~errorhandling.f90 sourcefile~abstractmeternode.f90->sourcefile~abstractmeter.f90 sourcefile~advancedmeter.f90->sourcefile~abstractgauge.f90 sourcefile~advancedmeter.f90->sourcefile~abstractmeter.f90 sourcefile~baseprofiler.f90->sourcefile~errorhandling.f90 sourcefile~baseprofiler.f90->sourcefile~keywordenforcer.f90 sourcefile~baseprofiler.f90->sourcefile~abstractmeter.f90 sourcefile~baseprofiler.f90->sourcefile~abstractmeternode.f90 sourcefile~baseprofiler.f90->sourcefile~advancedmeter.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~distributedmeter.f90->sourcefile~abstractgauge.f90 sourcefile~distributedmeter.f90->sourcefile~errorhandling.f90 sourcefile~distributedmeter.f90->sourcefile~abstractmeter.f90 sourcefile~distributedmeter.f90->sourcefile~advancedmeter.f90 sourcefile~meternode.f90->sourcefile~abstractmeter.f90 sourcefile~meternode.f90->sourcefile~abstractmeternode.f90 sourcefile~meternodevector.f90 MeterNodeVector.F90 sourcefile~meternode.f90->sourcefile~meternodevector.f90 sourcefile~nullgauge.f90->sourcefile~abstractgauge.f90 sourcefile~meternodeptr.f90->sourcefile~abstractmeternode.f90 sourcefile~meternodestack.f90->sourcefile~meternodeptr.f90 sourcefile~meternodevector.f90->sourcefile~abstractmeternode.f90

Files dependent on this one

sourcefile~~globalprofilers.f90~~AfferentGraph sourcefile~globalprofilers.f90 GlobalProfilers.F90 sourcefile~mapl_profiler.f90~2 MAPL_Profiler.F90 sourcefile~mapl_profiler.f90~2->sourcefile~globalprofilers.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

#include "MAPL_ErrLog.h"

!#include "unused_dummy.H"
module mapl_GlobalProfilers
   use mapl_AbstractGauge
   use mapl_DistributedProfiler
   use mapl_StubProfiler
   use mapl_KeywordEnforcerMod
   use mapl_ErrorHandlingMod
   use mapl_MpiTimerGauge
   use mapl_MallocGauge
   implicit none
   private
   

   public :: get_global_time_profiler
   public :: get_global_memory_profiler

   public :: initialize_global_time_profiler
   public :: initialize_global_memory_profiler

   class(DistributedProfiler), allocatable, target, save :: global_time_profiler
   class(DistributedProfiler), allocatable, target, save :: global_memory_profiler

contains

   function get_global_time_profiler() result(time_profiler)
      class(DistributedProfiler), pointer :: time_profiler
      time_profiler => global_time_profiler
   end function get_global_time_profiler

   function get_global_memory_profiler() result(memory_profiler)
      class(DistributedProfiler), pointer :: memory_profiler
      memory_profiler => global_memory_profiler
   end function get_global_memory_profiler

   subroutine initialize_global_time_profiler(name, unusable, comm, enabled, rc)
      character(*), intent(in) :: name
      class(KeywordEnforcer), optional, intent(in) :: unusable
      integer, optional, intent(in) :: comm
      logical, optional, intent(in) :: enabled
      integer, optional, intent(out) :: rc

      integer :: status

      call initialize_global_profiler(global_time_profiler, MpiTimerGauge(), name, comm=comm, enabled=enabled, _RC)

      _RETURN(_SUCCESS)
      _UNUSED_DUMMY(unusable)
   end subroutine initialize_global_time_profiler

   subroutine initialize_global_memory_profiler(name, unusable, comm, enabled, rc)
      character(*), intent(in) :: name
      class(KeywordEnforcer), optional, intent(in) :: unusable
      integer, optional, intent(in) :: comm
      logical, optional, intent(in) :: enabled
      integer, optional, intent(out) :: rc

      integer :: status

      call initialize_global_profiler(global_memory_profiler, MallocGauge(), name, comm=comm, enabled=enabled, _RC)

      _RETURN(_SUCCESS)
      _UNUSED_DUMMY(unusable)
   end subroutine initialize_global_memory_profiler


   subroutine initialize_global_profiler(profiler, gauge, name, unusable, comm, enabled, rc)
      class(DistributedProfiler), allocatable, intent(inout) :: profiler
      class(AbstractGauge), intent(in) :: gauge
      character(*), intent(in) :: name
      class(KeywordEnforcer), optional, intent(in) :: unusable
      integer, optional, intent(in) :: comm
      logical, optional, intent(in) :: enabled
      integer, optional, intent(out) :: rc

      logical :: enabled_
      integer :: status

      enabled_ = .false.
      if (present(enabled)) enabled_ = enabled

      if (enabled_) then
!!$         profiler = DistributedProfiler(name, gauge, comm=comm)
         ! Compiler workaround for ifort 2021.3
         allocate(profiler, source=DistributedProfiler(name, gauge, comm=comm))
      else
!!$         profiler = StubProfiler(name)
         ! Compiler workaround for ifort 2021.3
         allocate(profiler, source=StubProfiler(name))
      end if
      call profiler%start(_RC)

      _RETURN(_SUCCESS)
      _UNUSED_DUMMY(unusable)
   end subroutine initialize_global_profiler

end module MAPL_GlobalProfilers