test_trivial Subroutine

public subroutine test_trivial(this)

Arguments

Type IntentOptional Attributes Name
class(MpiTestMethod), intent(inout) :: this

Calls

proc~~test_trivial~~CallsGraph proc~test_trivial test_trivial assertequal assertequal proc~test_trivial->assertequal getmpicommunicator getmpicommunicator proc~test_trivial->getmpicommunicator none~add_cycle~2 AdvancedMeter%add_cycle proc~test_trivial->none~add_cycle~2 none~get_stats_total DistributedMeter%get_stats_total proc~test_trivial->none~get_stats_total none~reduce DistributedMeter%reduce proc~test_trivial->none~reduce none~get_mean_cycle AdvancedMeter%get_mean_cycle none~add_cycle~2->none~get_mean_cycle none~reduce_mpi DistributedMeter%reduce_mpi none~reduce->none~reduce_mpi none~get_num_cycles AdvancedMeter%get_num_cycles none~get_mean_cycle->none~get_num_cycles mpi_comm_rank mpi_comm_rank none~reduce_mpi->mpi_comm_rank mpi_reduce mpi_reduce none~reduce_mpi->mpi_reduce none~get_max_cycle AdvancedMeter%get_max_cycle none~reduce_mpi->none~get_max_cycle none~get_min_cycle AdvancedMeter%get_min_cycle none~reduce_mpi->none~get_min_cycle none~reduce_mpi->none~get_num_cycles none~get_sum_square_deviation AdvancedMeter%get_sum_square_deviation none~reduce_mpi->none~get_sum_square_deviation none~get_total~2 AdvancedMeter%get_total none~reduce_mpi->none~get_total~2 proc~mapl_verify MAPL_Verify none~reduce_mpi->proc~mapl_verify proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_trivial(this)
      class (MpiTestMethod), intent(inout) :: this
 
      type (DistributedMeter) :: distributed
      type (DistributedReal64) :: distributed_total


      distributed = DistributedMeter(MpiTimerGauge())
      call distributed%add_cycle(1.0_REAL64)
      call distributed%reduce(this%getMpiCommunicator(), 0._REAL64)

      distributed_total = distributed%get_stats_total()
      @assertEqual(1.0, distributed_total%total)
      @assertEqual(1.0, distributed_total%min)
      @assertEqual(1.0, distributed_total%max)

      @assertEqual(0, distributed_total%min_pe)
      @assertEqual(0, distributed_total%max_pe)
      @assertEqual(1, distributed_total%num_pes)

   end subroutine test_trivial