FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
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
7module 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
19contains
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
57end module m_elap
58
59#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:35