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  include 'mpif.h'
23  logical, intent(in) :: t
24  integer(kind=kint), intent(in) :: i
25  integer(kind=kint) :: ierr
26  iunit = i
27  lout = t
28  call mpi_barrier(mpi_comm_world, ierr)
29  call ptime(epocht)!ELAP
30  end subroutine initelap
31 
32  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33 
34  subroutine elapout(mes)
35  character(*) mes
36  call ptime(curt)
37  if (lout) then
38  write(iunit,'(a, 1f15.5, 3x, a)') '#elap ',curt - epocht, mes
39  ! call flush(iunit)
40  end if
41  return
42  end subroutine elapout
43 
44  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
45 
46  subroutine ptime(cputim)
47  real(kind=kreal) :: cputim
48  !real(kind=kreal) :: cputim,elaptime
49  !real x(2)
50  ! machine dependent cpu time by hour
51  ! cputim=etime(x)
52  ! cputim=x(1)
53  cputim=hecmw_wtime()
54  return
55  end subroutine ptime
56 
57 end module m_elap
58 
59 #endif
m_elap::lout
logical lout
Definition: m_elap.F90:12
hecmw_util::hecmw_wtime
real(kind=kreal) function hecmw_wtime()
Definition: hecmw_util_f.F90:549
m_elap::iunit
integer(kind=kint) iunit
Definition: m_elap.F90:11
m_elap::curt
real(kind=kreal) curt
Definition: m_elap.F90:10
m_elap::elapout
subroutine, public elapout(mes)
Definition: m_elap.F90:35
hecmw_util
I/O and Utility.
Definition: hecmw_util_f.F90:7
m_elap
Definition: m_elap.F90:7
hecmw_util::kreal
integer(kind=4), parameter kreal
Definition: hecmw_util_f.F90:16
m_elap::initelap
subroutine, public initelap(t, i)
Definition: m_elap.F90:22
m_elap::epocht
real(kind=kreal) epocht
Definition: m_elap.F90:10