TABLE OF CONTENTS


ABINIT/time_accu [ Functions ]

[ Top ] [ Functions ]

NAME

  time_accu

FUNCTION

  Timing subroutine.  Calls machine-dependent "timein" which
  returns elapsed cpu and wall clock times in sec.
  Also return the number of times the counter has been called

COPYRIGHT

  Copyright (C) 1998-2018 ABINIT group (DCA, XG, GMR)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .
  For the initials of contributors, see
  ~abinit/doc/developers/contributors.txt .

INPUTS

  nn=index of accumulator (distinguish what is being timed);

OUTPUT

  tottim(2)=accumulated time for accumulator nn
  totftimes(2)=accumulated time for accumulator nn evaluated by papi
  totffops =accumulated number of flops for accumulator nn evaluated by papi
  return_ncount gives the number of times that the accumulator has been incremented

PARENTS

      timana

CHILDREN

SOURCE

35 #if defined HAVE_CONFIG_H
36 #include "config.h"
37 #endif
38 
39 #include "abi_common.h"
40 
41 
42 subroutine time_accu(nn,return_ncount,tottim,totflops,totftimes)
43 
44  use defs_basis
45  use defs_time
46  use m_errors
47  use m_profiling_abi
48 
49 !This section has been created automatically by the script Abilint (TD).
50 !Do not modify the following lines by hand.
51 #undef ABI_FUNC
52 #define ABI_FUNC 'time_accu'
53 !End of the abilint section
54 
55  implicit none
56 
57 !Arguments ------------------------------------
58 !scalars
59  integer,intent(in) :: nn
60  integer,intent(out) :: return_ncount
61  real(dp),intent(out) :: totflops
62 !arrays
63  real(dp),intent(out) :: totftimes(2),tottim(2)
64 
65 !Local variables-------------------------------
66 !scalars
67  character(len=500) :: message
68 
69 ! *************************************************************************
70 
71 !Check that nn lies in sensible bounds
72  if (nn<0.or.nn>mtim) then
73    write(message,'(a,i6,a,i8,a)')' dim mtim=',mtim,' but input nn=',nn,'.'
74    MSG_BUG(message)
75  end if
76 
77 !return accumulated time for nn
78  tottim(1)=acctim(1,nn)
79  tottim(2)=acctim(2,nn)
80 
81 !return accumulated number flops for nn
82  totflops = papi_accflops(nn) 
83 
84 !return accumulated time for nn evaluated by papi
85  totftimes(1) = papi_acctim(1,nn) 
86  totftimes(2) = papi_acctim(2,nn) 
87  return_ncount=ncount(nn)
88 
89 end subroutine time_accu