FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
m_elap.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
5 #ifndef HECMW_SERIAL
6 
7 module m_elap
8  use hecmw_util
9  ! for elaps time
10  real(kind=kreal) :: epocht, curt
11  integer(kind=kint) :: iunit ! output filehandler
12  logical :: lout ! output elaptime or not
13 
14  private
15 
16  public initelap
17  public elapout
18 
19 contains
20 
21  subroutine initelap(t,i)
22  logical, intent(in) :: t
23  integer(kind=kint), intent(in) :: i
24  integer(kind=kint) :: ierr
25  iunit = i
26  lout = t
27  call mpi_barrier(mpi_comm_world, ierr)
28  call ptime(epocht)!ELAP
29  end subroutine initelap
30 
31  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
32 
33  subroutine elapout(mes)
34  character(*) mes
35  call ptime(curt)
36  if (lout) then
37  write(iunit,'(a, 1f15.5, 3x, a)') '#elap ',curt - epocht, mes
38  ! call flush(iunit)
39  end if
40  return
41  end subroutine elapout
42 
43  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
44 
45  subroutine ptime(cputim)
46  real(kind=kreal) :: cputim
47  !real(kind=kreal) :: cputim,elaptime
48  !real x(2)
49  ! machine dependent cpu time by hour
50  ! cputim=etime(x)
51  ! cputim=x(1)
52  cputim=hecmw_wtime()
53  return
54  end subroutine ptime
55 
56 end module m_elap
57 
58 #endif
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=4), parameter kreal
real(kind=kreal) function hecmw_wtime()
Definition: m_elap.F90:7
logical lout
Definition: m_elap.F90:12
subroutine, public initelap(t, i)
Definition: m_elap.F90:22
integer(kind=kint) iunit
Definition: m_elap.F90:11
real(kind=kreal) epocht
Definition: m_elap.F90:10
real(kind=kreal) curt
Definition: m_elap.F90:10
subroutine, public elapout(mes)
Definition: m_elap.F90:34