destroy_time Subroutine

public subroutine destroy_time(control)

Deallocate memory and find simulation time.

Arguments

Type IntentOptional AttributesName
type(controltype), intent(in) :: control

Control parameters


Calls

proc~~destroy_time~~CallsGraph proc~destroy_time destroy_time mpi_gather mpi_gather proc~destroy_time->mpi_gather proc~write_time write_time proc~destroy_time->proc~write_time interface~alloc alloc proc~destroy_time->interface~alloc debugcall debugcall proc~destroy_time->debugcall proc~alloc_rank2_real alloc_rank2_real interface~alloc->proc~alloc_rank2_real proc~alloc_rank4_real alloc_rank4_real interface~alloc->proc~alloc_rank4_real proc~alloc_rank3_real alloc_rank3_real interface~alloc->proc~alloc_rank3_real proc~alloc_rank2_integer alloc_rank2_integer interface~alloc->proc~alloc_rank2_integer proc~alloc_rank1_integer alloc_rank1_integer interface~alloc->proc~alloc_rank1_integer proc~alloc_rank6_real alloc_rank6_real interface~alloc->proc~alloc_rank6_real proc~alloc_rank5_real alloc_rank5_real interface~alloc->proc~alloc_rank5_real proc~alloc_rank3_integer alloc_rank3_integer interface~alloc->proc~alloc_rank3_integer proc~alloc_rank1_real alloc_rank1_real interface~alloc->proc~alloc_rank1_real

Called by

proc~~destroy_time~~CalledByGraph proc~destroy_time destroy_time proc~destroy_solver destroy_solver proc~destroy_solver->proc~destroy_time proc~finish_run finish_run proc~finish_run->proc~destroy_solver program~main main program~main->proc~finish_run proc~abort_run abort_run proc~abort_run->proc~finish_run

Contents

Source Code


Source Code

        subroutine destroy_time(control)
          !< Deallocate memory and find simulation time.
            implicit none
            type(controltype), intent(in) :: control
            !< Control parameters
            real(wp), dimension(:), allocatable :: total_time 
            !< Total time of executation for each block
            integer :: ierr
            !< error variable for mpi communication
            
            DebugCall('deallocate_misc')

            !simlulation clock data
            if(control%process_id==0) write(*, '(A)') '>> TIME <<'
            if(control%process_id==0) write(*, '(A)') "Simulation Clock : "//trim(write_time(sim_clock))
            call alloc(total_time, 1, control%total_process)
            CALL CPU_TIME(t2)
            CALL SYSTEM_CLOCK(COUNT=nb_ticks_final)

            nb_ticks = nb_ticks_final - nb_ticks_initial
            IF (nb_ticks_final < nb_ticks_initial) &
            nb_ticks = nb_ticks + nb_ticks_max
            elapsed_time   = REAL(nb_ticks) / nb_ticks_sec
            cpu_time_elapsed = t2-t1 
            write(*,'(A,I0,A)') 'process: ',control%process_id,&
                                " > SYSTEM clock <: "//trim(write_time(elapsed_time))//&
                                " /-\ CPU time <: "//trim(write_time(cpu_time_elapsed))
            
            !total time including all blocks
            call MPI_GATHER(elapsed_time, 1, MPI_DOUBLE_PRECISION, &
            total_time, 1, MPI_DOUBLE_PRECISION, 0,MPI_COMM_WORLD, ierr)
            if(control%process_id==0) print*, "Total SYSTEM clock: ", trim(write_time(sum(total_time)))
            call MPI_GATHER(cpu_time_elapsed, 1, MPI_DOUBLE_PRECISION, &
            total_time, 1, MPI_DOUBLE_PRECISION, 0,MPI_COMM_WORLD, ierr)
            if(control%process_id==0) print*, "Total CPU time    : ", trim(write_time(sum(total_time)))

        end subroutine destroy_time