tem_finalize Subroutine

public subroutine tem_finalize(general)

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

Arguments

Type IntentOptional Attributes Name
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~tem_status_run_terminate tem_status_run_terminate proc~tem_finalize->proc~tem_status_run_terminate proc~tem_gettimername tem_getTimerName proc~tem_finalize->proc~tem_gettimername proc~print_self_status print_self_status proc~tem_finalize->proc~print_self_status proc~tem_abort tem_abort proc~tem_finalize->proc~tem_abort proc~tem_timer_dump_glob tem_timer_dump_glob proc~tem_finalize->proc~tem_timer_dump_glob proc~tem_gettimerval tem_getTimerVal proc~tem_finalize->proc~tem_gettimerval proc~fin_env fin_env proc~tem_finalize->proc~fin_env proc~newunit newunit proc~print_self_status->proc~newunit mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~tem_timer_dumplabeled tem_timer_dumplabeled proc~tem_timer_dump_glob->proc~tem_timer_dumplabeled proc~tem_stoptimer tem_stopTimer proc~tem_gettimerval->proc~tem_stoptimer mpi_finalize mpi_finalize proc~fin_env->mpi_finalize mpi_wtime mpi_wtime proc~tem_stoptimer->mpi_wtime proc~tem_getsumtimerval tem_getSumTimerVal proc~tem_timer_dumplabeled->proc~tem_getsumtimerval proc~tem_getmaxtimerval tem_getMaxTimerVal proc~tem_timer_dumplabeled->proc~tem_getmaxtimerval proc~upper_to_lower upper_to_lower proc~tem_timer_dumplabeled->proc~upper_to_lower interface~positionofval~5 positionofval proc~tem_timer_dumplabeled->interface~positionofval~5 mpi_gather mpi_gather proc~tem_timer_dumplabeled->mpi_gather proc~tem_open tem_open proc~tem_timer_dumplabeled->proc~tem_open proc~tem_getmintimerval tem_getMinTimerVal proc~tem_timer_dumplabeled->proc~tem_getmintimerval proc~tem_getsumtimerval->proc~tem_gettimerval mpi_allreduce mpi_allreduce proc~tem_getsumtimerval->mpi_allreduce proc~tem_getmaxtimerval->proc~tem_gettimerval proc~tem_getmaxtimerval->mpi_allreduce proc~posofval_label posofval_label interface~positionofval~5->proc~posofval_label proc~tem_open->proc~tem_abort proc~tem_open->proc~newunit proc~tem_open->proc~upper_to_lower proc~tem_getmintimerval->proc~tem_gettimerval proc~tem_getmintimerval->mpi_allreduce

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