tem_finalize Subroutine

public subroutine tem_finalize(general)

Finalize the environment, should be the very last call in the program.

Arguments

Type IntentOptional AttributesName
type(tem_general_type), intent(in) :: general

encapsulates global parameters which are common for all solvers


Calls

proc~~tem_finalize~~CallsGraph proc~tem_finalize tem_finalize proc~fin_env fin_env proc~tem_finalize->proc~fin_env proc~tem_timer_dump_glob tem_timer_dump_glob proc~tem_finalize->proc~tem_timer_dump_glob proc~tem_gettimername tem_getTimerName proc~tem_finalize->proc~tem_gettimername proc~tem_status_run_terminate tem_status_run_terminate proc~tem_finalize->proc~tem_status_run_terminate proc~tem_abort tem_abort proc~tem_finalize->proc~tem_abort proc~tem_gettimerval tem_getTimerVal proc~tem_finalize->proc~tem_gettimerval proc~print_self_status print_self_status proc~tem_finalize->proc~print_self_status mpi_finalize mpi_finalize proc~fin_env->mpi_finalize proc~tem_timer_dumplabeled tem_timer_dumplabeled proc~tem_timer_dump_glob->proc~tem_timer_dumplabeled mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~tem_stoptimer tem_stopTimer proc~tem_gettimerval->proc~tem_stoptimer proc~newunit newunit proc~print_self_status->proc~newunit proc~tem_timer_dumplabeled->proc~newunit proc~tem_getmaxtimerval tem_getMaxTimerVal proc~tem_timer_dumplabeled->proc~tem_getmaxtimerval interface~positionofval~5 positionofval proc~tem_timer_dumplabeled->interface~positionofval~5 mpi_gather mpi_gather proc~tem_timer_dumplabeled->mpi_gather proc~upper_to_lower upper_to_lower proc~tem_timer_dumplabeled->proc~upper_to_lower proc~tem_getsumtimerval tem_getSumTimerVal proc~tem_timer_dumplabeled->proc~tem_getsumtimerval proc~tem_getmintimerval tem_getMinTimerVal proc~tem_timer_dumplabeled->proc~tem_getmintimerval mpi_wtime mpi_wtime proc~tem_stoptimer->mpi_wtime proc~tem_getmaxtimerval->proc~tem_gettimerval mpi_allreduce mpi_allreduce proc~tem_getmaxtimerval->mpi_allreduce proc~posofval_label posofval_label interface~positionofval~5->proc~posofval_label proc~tem_getsumtimerval->proc~tem_gettimerval proc~tem_getsumtimerval->mpi_allreduce proc~tem_getmintimerval->proc~tem_gettimerval proc~tem_getmintimerval->mpi_allreduce

Called by

proc~~tem_finalize~~CalledByGraph proc~tem_finalize tem_finalize proc~check_serial_singlelevel_facedesc check_serial_singlelevel_faceDesc proc~check_serial_singlelevel_facedesc->proc~tem_finalize program~bin_search_test bin_search_test program~bin_search_test->proc~tem_finalize program~tem_face_test~2 tem_face_test program~tem_face_test~2->proc~check_serial_singlelevel_facedesc

Contents

Source Code


Source Code

  subroutine tem_finalize(general)
    ! ----------------------------------------------------------------------
    !> encapsulates global parameters which are common for all solvers
    type(tem_general_type), intent(in) :: general
    ! ----------------------------------------------------------------------
    character(len=labelLen) :: timerName
    real(kind=rk) :: timerValue
    ! ----------------------------------------------------------------------

    if ( tem_status_run_terminate(general%simControl%status) ) then
      call tem_abort()
    end if

    call tem_timer_dump_glob( comm   = general%proc%comm,     &
      &                       myrank = general%proc%rank,     &
      &                       nProcs = general%proc%comm_size )

    if ( general%proc%isRoot ) then
      if ( printRuntimeInfo ) call print_self_status()

      timerName  = tem_getTimerName(timerHandle = general%solver%timerHandle )
      timerValue = tem_getTimerVal( timerHandle = general%solver%timerHandle )

      write(logUnit(1),*)
      write(logUnit(1),"(A,F10.2,A)") " Done with " // trim(timerName) &
        &                             // " in ", timerValue, ' s'
    end if

    ! finialize mpi
    call fin_env()

  end subroutine tem_finalize