TABLE OF CONTENTS


ABINIT/m_time [ Modules ]

[ Top ] [ Modules ]

NAME

 m_time

FUNCTION

 This module contains accumulators for the timer.
 and functions to get cpu and wall time.

COPYRIGHT

 Copyright (C) 2009-2018 ABINIT group (MG, XG, MT, TD)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .


m_time/abi_cpu_time [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  abi_cpu_time

FUNCTION

  Timing routine. Returns cpu time in seconds since some arbitrary start.

INPUTS

  (no inputs)

OUTPUT

  cpu_time= cpu time in seconds

NOTES

  For CPU time, contains machine-dependent code (choice will be selected by c preprocessor).
  Note that all supported machines are listed explicitly below; there
  is no "else" which covers "other".  The C preprocessor will place
  a spurious line of code (see below) into the fortran source unless
  preprocessed with -Dflag where flag refers to one of the supported machines.

  WARNING: the following list is no more accurate (YP 20060530)

  Presently supported flags: "ibm", "hp", "P6", "dec_alpha", "sgi", "vpp", "sun", "mac", "nec", "sr8k"
  Previously supported flags:  "ultrix". Might still work !

  Calls machine-dependent "mclock" for "ibm" .
  Calls ANSI C subroutine "cclock" for "hp" and "sgi".
  Calls machine-dependent "etime" for "P6", "mac", "dec_alpha", "sun", "nec" .
  Calls machine-dependent "clock" for "vpp"
  Calls machine-dependent "xclock" for "sr8k"

PARENTS

CHILDREN

SOURCE

337 function abi_cpu_time() result(cpu)
338 
339 
340 !This section has been created automatically by the script Abilint (TD).
341 !Do not modify the following lines by hand.
342 #undef ABI_FUNC
343 #define ABI_FUNC 'abi_cpu_time'
344 !End of the abilint section
345 
346  implicit none
347 
348 !Arguments ------------------------------------
349  real(dp) :: cpu
350 
351 !Local variables-------------------------------
352 #ifdef HAVE_FC_CPUTIME
353  real :: cpu_sp
354 #elif defined FC_IBM
355  integer :: mclock
356 #elif defined FC_SUN
357  real :: tmp(2)
358  real :: etime
359 #elif defined FC_COMPAQ || defined HAVE_OS_MACOSX
360  real :: tmp(2) !real array only needed by etime
361  real(dp) :: etime
362 #else
363  integer :: count_now,count_max,count_rate
364 #endif
365 
366 ! *************************************************************************
367 
368 !Machine-dependent timers
369 #ifdef HAVE_CCLOCK
370  call cclock(cpu)
371 
372 #elif defined HAVE_FC_CPUTIME
373 !This is the F95 standard subroutine.
374  call cpu_time(cpu_sp)
375  cpu = cpu_sp
376 
377 #elif defined FC_IBM
378  cpu = mclock()*0.01d0
379 
380 #elif defined HAVE_OS_MACOSX || defined FC_COMPAQ || defined FC_SUN
381  cpu = etime(tmp)
382 
383 #elif defined FC_FUJITSU
384  call clock(cpu,0,2)
385 
386 #elif defined FC_HITACHI
387  call xclock(cpu,5)
388 
389 #else
390 !This is the Fortran90 standard subroutine, might not always be sufficiently accurate
391  call system_clock(count_now,count_rate,count_max)
392  cpu=dble(count_now)/dble(count_rate)
393 #endif
394 
395 end function abi_cpu_time

m_time/abi_wtime [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  abi_wtime

FUNCTION

  Return wall clock time in seconds since some arbitrary start.
  Call the F90 intrinsic date_and_time .

INPUTS

  (no inputs)

OUTPUT

  wall= wall clock time in seconds

PARENTS

CHILDREN

SOURCE

420 function abi_wtime() result(wall)
421 
422 
423 !This section has been created automatically by the script Abilint (TD).
424 !Do not modify the following lines by hand.
425 #undef ABI_FUNC
426 #define ABI_FUNC 'abi_wtime'
427 !End of the abilint section
428 
429  implicit none
430 
431 !Arguments ------------------------------------
432 !scalars
433  real(dp) :: wall
434 
435 !Local variables-------------------------------
436 !scalars
437 #ifndef HAVE_MPI
438  integer,parameter :: nday(24)=(/31,28,31,30,31,30,31,31,30,31,30,31,&
439 &                                31,28,31,30,31,30,31,31,30,31,30,31/)
440  integer,save :: month_init,month_now,start=1,year_init
441  integer :: months
442  character(len=8)   :: date
443  character(len=10)  :: time
444  character(len=5)   :: zone
445  character(len=500) :: msg
446 !arrays
447  integer :: values(8)
448 #endif
449 
450 ! *************************************************************************
451 
452 #ifndef HAVE_MPI
453 
454 !The following section of code is standard F90, but it is useful only if the intrinsics
455 !date_and_time is accurate at the 0.01 sec level, which is not the case for a P6 with the pghpf compiler ...
456 !Year and month initialisation
457  if(start==1)then
458    start=0
459    call date_and_time(date,time,zone,values)
460    year_init=values(1)
461    month_init=values(2)
462  end if
463 
464 !Uses intrinsic F90 subroutine Date_and_time for
465 !wall clock (not correct when a change of year happen)
466  call date_and_time(date,time,zone,values)
467 
468 !Compute first the number of seconds from the beginning of the month
469  wall=(values(3)*24.0d0+values(5))*3600.0d0+values(6)*60.0d0+values(7)+values(8)*0.001d0
470 
471 !If the month has changed, compute the number of seconds
472 !to be added. This fails if the program ran one year !!
473  month_now=values(2)
474  if(month_now/=month_init)then
475    if(year_init+1==values(1))then
476      month_now=month_now+12
477    end if
478    if(month_now<=month_init)then
479      msg = 'Problem with month and year numbers.'
480      MSG_BUG(msg)
481    end if
482    do months=month_init,month_now-1
483      wall=wall+86400.0d0*nday(months)
484    end do
485  end if
486 
487 !Now take into account bissextile years (I think 2000 is bissextile, but I am not sure ...)
488  if(mod(year_init,4)==0 .and. month_init<=2 .and. month_now>2)   wall=wall+3600.0d0
489  if(mod(values(1),4)==0 .and. month_init<=14 .and. month_now>14) wall=wall+3600.0d0
490 
491 #else
492 !Use the timer provided by MPI1.
493  wall = MPI_WTIME()
494 #endif
495 
496 end function abi_wtime

m_time/asctime [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  asctime

FUNCTION

   Build a 24-character string of the following form: 'Sun Jun 20 23:21:05 1993'.

PARENTS

CHILDREN

SOURCE

104 function asctime()
105 
106 
107 !This section has been created automatically by the script Abilint (TD).
108 !Do not modify the following lines by hand.
109 #undef ABI_FUNC
110 #define ABI_FUNC 'asctime'
111 !End of the abilint section
112 
113  implicit none
114 
115 !Arguments ------------------------------------
116  character(len=24) :: asctime
117 
118 !Local variables-------------------------------
119  integer :: day,dd,ja,jy,jm,jdn,mm,year
120  integer :: values(8)
121  character(len=5) :: strzone
122  character(len=8) :: strdat
123  character(len=10) :: strtime
124  character(len=3),parameter :: day_names(7)=(/'Mon','Tue','Wed','Thu','Fri','Sat','Sun'/)
125  character(len=3),parameter :: month_names(12)=(/'Jan','Feb','Mar','Apr','May','Jun',&
126 &                                                'Jul','Aug','Sep','Oct','Nov','Dec'/)
127 
128 ! *************************************************************************
129 
130 !Get year, month and day
131  call date_and_time(strdat,strtime,strzone,values)
132 
133  year=values(1)
134  mm=values(2)
135  dd=values(3)
136 
137 !Get day of the week
138  if (mm > 2) then
139    jy=year
140    jm=mm+1
141  else
142    jy=year-1
143    jm=mm+13
144  end if
145 
146  jdn=int(365.25d0*jy)+int(30.6001d0*jm)+dd+1720995
147  ja=int(0.01d0*jy)
148  jdn=jdn+2-ja+int(quarter*ja)
149  day=mod(jdn,7)+1
150 
151  ! Build a 24-character string of the following form: 'Sun Jun 20 23:21:05 1993'.
152  write(asctime, '(a,1x,a,1x,i0.2,1x,2(i0.2,a),i0.2,1x,i4)')&
153    day_names(day),month_names(mm),dd,values(5),":",values(6),":",values(7),year
154 
155 end function asctime

m_time/cwtime [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  cwtime

FUNCTION

  Timing routine. Returns cpu and wall clock time in seconds.

INPUTS

  start_or_stop=
    "start" to start the timers
    "stop" to stop the timers and return the final cpu_time and wall_time

OUTPUT

  cpu= cpu time in seconds
  wall= wall clock time in seconds
  gflops = Gigaflops

NOTES

  Example:
  ! Init cpu and wall
  call cwtime(cpu,wall,gflops,"start")

  do_stuff()

  ! stop the counters, return cpu- and wall-time spent in do_stuff()
  call cwtime(cpu,wall,gflops,"stop")

PARENTS

      calc_sigc_me,calc_sigx_me,cchi0,cchi0q0,eph,exc_build_block
      exc_build_ham,lapackprof,m_abilasi,m_bse_io,m_dvdb,m_epjdos
      m_exc_itdiago,m_fft,m_fft_prof,m_fstab,m_gkk,m_gruneisen,m_ifc,m_ioarr
      m_iowf,m_phgamma,m_phonons,m_phpi,m_shirley,m_sigmaph,m_skw,m_wfd,m_wfk
      partial_dos_fractions

CHILDREN

      xpapi_flops

SOURCE

540 subroutine cwtime(cpu,wall,gflops,start_or_stop)
541 
542 
543 !This section has been created automatically by the script Abilint (TD).
544 !Do not modify the following lines by hand.
545 #undef ABI_FUNC
546 #define ABI_FUNC 'cwtime'
547 !End of the abilint section
548 
549  implicit none
550 
551 !Arguments ------------------------------------
552 !scalars
553  real(dp),intent(inout) :: cpu,wall
554  real(dp),intent(out) :: gflops
555  character(len=*),intent(in) :: start_or_stop
556 
557 !Local variables-------------------------------
558 #ifndef HAVE_PAPI
559  logical,parameter :: use_papi=.FALSE.
560 #else
561  logical,parameter :: use_papi=.TRUE.
562 #endif
563  integer(C_INT)  :: check
564  integer(C_LONG_LONG) :: flops
565  real(C_FLOAT) :: real_time,proc_time,mflops
566 
567 ! *************************************************************************
568 
569  SELECT CASE (start_or_stop)
570  CASE ("start")
571  if (use_papi) then
572    call xpapi_flops(real_time,proc_time,flops,mflops,check)
573    cpu = proc_time; wall = real_time; gflops = mflops / 1000
574  else
575    cpu = abi_cpu_time(); wall = abi_wtime(); gflops = -one
576  end if
577 
578  CASE ("stop")
579  if (use_papi) then
580    call xpapi_flops(real_time,proc_time,flops,mflops,check)
581    cpu = proc_time - cpu; wall = real_time - wall; gflops = mflops / 1000
582  else
583    cpu = abi_cpu_time() - cpu; wall = abi_wtime() - wall; gflops = -one
584  end if
585 
586  CASE DEFAULT
587    MSG_ERROR("Wrong option for start_or_stop: "//TRIM(start_or_stop))
588  END SELECT
589 
590 end subroutine cwtime

m_time/sec2str [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  sec2str

FUNCTION

  Convert time data in seconds to string

INPUTS

   time_s=Time in seconds

OUTPUT

   string with time displayed in the form: [days-][hours:][minutes:]seconds

PARENTS

CHILDREN

SOURCE

179 pure function sec2str(time_s) result(str)
180 
181 
182 !This section has been created automatically by the script Abilint (TD).
183 !Do not modify the following lines by hand.
184 #undef ABI_FUNC
185 #define ABI_FUNC 'sec2str'
186 !End of the abilint section
187 
188  implicit none
189 
190 !Arguments ------------------------------------
191 !scalars
192  real(dp),intent(in) :: time_s
193  character(len=500) :: str
194 
195 !Local variables-------------------------------
196  integer :: days,hours,minutes,seconds
197 
198 ! *************************************************************************
199 
200  days    = time_s / 86400
201  hours   = MOD(time_s,86400._dp) / 3600
202  minutes = MOD(time_s,3600._dp) / 60
203  seconds = MOD(time_s,60._dp)
204 
205  if (days>0) then
206    write(str,'(i0,3(a,i0.2))')days,"-",hours,":",minutes,":",seconds
207  else if (hours>0) then
208    write(str,'(i0.2,2(a,i0.2))')hours,":",minutes,":",seconds
209  else if (minutes>0) then
210    write(str,'(i0.2,a,i0.2)')minutes,":",seconds
211  else
212    write(str,'(i0.2,a)')seconds," [s]"
213  end if
214 
215 end function sec2str

m_time/str2sec [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  str2sec

FUNCTION

  Convert a string to time data in seconds. Return negative value if not valid string
  Accepts a string in one the following (SLURM) forms:

     # "days-hours",
     # "days-hours:minutes",
     # "days-hours:minutes:seconds".
     # "minutes",
     # "minutes:seconds",
     # "hours:minutes:seconds",

PARENTS

SOURCE

239 real(dp) pure function str2sec(str) result(time)
240 
241 !Arguments ------------------------------------
242 !scalars
243 
244 !This section has been created automatically by the script Abilint (TD).
245 !Do not modify the following lines by hand.
246 #undef ABI_FUNC
247 #define ABI_FUNC 'str2sec'
248 !End of the abilint section
249 
250  character(len=*),intent(in) :: str
251 
252 !Local variables-------------------------------
253  integer :: days,hours,minutes,seconds,dash,i,j
254 
255 ! *************************************************************************
256 
257  days = 0; hours = 0; minutes = 0; seconds = 0
258  dash = index(str, "-")
259  if (dash /= 0) read(str(:dash-1),*,err=1) days
260 
261  select case (char_count(str, ":"))
262  case (0)
263    if (dash /= 0) then
264      read(str(dash+1:),*,err=1)hours
265    else
266      read(str(dash+1:),*,err=1)minutes
267    end if
268 
269  case (1)
270    i = index(str, ":")
271    if (dash /= 0) then
272      read(str(dash+1:i-1),*,err=1)hours
273      read(str(i+1:),*,err=1)minutes
274    else
275      read(str(:i-1),*,err=1)minutes
276      read(str(i+1:),*,err=1)seconds
277    end if
278 
279  case(2)
280    i = index(str, ":")
281    read(str(dash+1:i-1),*,err=1)hours
282    j = index(str(i+1:), ":") + i
283    read(str(i+1:j-1),*,err=1)minutes
284    read(str(j+1:),*,err=1)seconds
285 
286  case default
287    time = -one; return
288  end select
289 
290  time = 24 * 3600 * days + hours * 3600 + minutes * 60 + seconds
291  return
292 
293 1 time = -one
294 
295 end function str2sec

m_time/timab [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  timab

FUNCTION

  Timing subroutine. Calls machine-dependent "timein" which returns elapsed cpu and wall clock times in sec.
  Depending on value of "option" routine will:

  (0) zero all accumulators
  (1) start with new incremental time slice for accumulator n using explicit call to timein (or PAPI)
  (2) stop time slice; add time to accumulator n also increase by one the counter for this accumulator
  (3) start with new incremental time slice for accumulator n
        using stored values for cpu, wall, and PAPI infos ( ! do not use for stop )
  (4) report time slice for accumlator n (not full time accumlated)
  (5) option to suppress timing (nn should be 0) or reenable it (nn /=0)

  If, on first entry, subroutine is not being initialized, it
  will automatically initialize as well as rezero accumulator n.
  However, initialization SHOULD be done explicitly by the user
  so that it can be done near the top of his/her main routine.

INPUTS

  nn=index of accumulator (distinguish what is being timed); NOT used if option=0
  option=see comment above

OUTPUT

  on option=4 :
    tottim(2,nn)=accumulated time for accumulator nn; otherwise
     tottim is a dummy variable.
    option gives the number of times that the
     accumulator has been incremented

PARENTS

      abinit,afterscfloop,atm2fft,bethe_salpeter,calc_sigc_me,calc_sigx_me
      calcdensph,cchi0,cgq_builder,cgwf,chebfi,cohsex_me,corrmetalwf1,d2frnl
      density_rec,dfpt_cgwf,dfpt_dyfro,dfpt_dyxc1,dfpt_eltfrhar,dfpt_eltfrkin
      dfpt_eltfrloc,dfpt_eltfrxc,dfpt_ewald,dfpt_looppert,dfpt_mkrho
      dfpt_mkvxc,dfpt_mkvxc_noncoll,dfpt_mkvxcstr,dfpt_newvtr,dfpt_nstdy
      dfpt_nstpaw,dfpt_nstwf,dfpt_rhofermi,dfpt_rhotov,dfpt_scfcv,dfpt_vtorho
      dfpt_vtowfk,dfpt_wfkfermi,dfptnl_loop,dielmt,dieltcel,m_dmft
      dotprodm_v,dotprodm_vn,driver,dyson,eig2stern,eig2tot,elt_ewald
      eltxccore,energy,entropyrec,etotfor,exc_build_block,exc_build_ham
      fermisolverec,first_rec,fock2ACE,fock_getghc,forces,forstr,forstrnps
      fourdp,fourwf,fxphas,getgh1c,getghc,getgsc,getngrec,gran_potrec
      green_kernel,gstate,gstateimg,gwls_ComputeCorrelationEnergy
      gwls_DielectricArray,gwls_QR_factorization,gwls_lineqsolver
      gwls_model_polarisability,gwls_polarisability,gwls_sternheimer,hartre
      impurity_solve,initberry,initorbmag,initwf,inkpts,invars2,inwffil
      listkk,lobpcgwf,m_ab7_invars_f90,m_ab7_mixing,m_cgtools,m_dyson_solver
      m_fftcore,m_fftw3,m_fock,m_green,m_haydock,m_hexc,m_invovl,m_iowf
      m_lobpcg,m_lobpcg2,m_lobpcgwf,m_paral_pert,m_sg2002,m_wfutils,m_xg
      m_xgScalapack,mag_constr,mkcore,mkcore_paw,mkcore_wvl,mkffnl
      mklocl_realspace,mklocl_recipspace,mkresi,mkrho,newkpt,newocc,newrho
      newvtr,nhatgrid,nlenergyrec,nonlinear,nonlop,odamix,opernla_ylm
      optics_paw,optics_paw_core,optics_vloc,outkss,outscfcv,pareigocc
      partial_dos_fractions_paw,pawdenpot,pawdfptenergy,pawinit,pawmknhat
      pawmknhat_psipsi,pawmkrho,pawpolev,prep_bandfft_tabs,prep_calc_ucrpa
      prep_fourwf,prep_getghc,prep_nonlop,pspatm,pspheads_comm,pspini
      pw_orthon,rayleigh_ritz,recursion,recursion_nl,respfn,rhotov,rhotoxc
      rwwf,scfcv,screening,setsym,setvtr,sigma,sqnormm_v,status,stress,strhar
      suscep_stat,susk,suskmm,symrhg,symsgcube,tddft,timana,vn_nl_rec,vtorho
      vtorhorec,vtorhotf,vtowfk,wf_mixing,wfconv,wfk_analyze,wfsinp
      wvl_nhatgrid,xcden,xcpot

CHILDREN

      papif_flops,papif_perror,timein

SOURCE

860 subroutine timab(nn,option,tottim)
861 
862 
863 !This section has been created automatically by the script Abilint (TD).
864 !Do not modify the following lines by hand.
865 #undef ABI_FUNC
866 #define ABI_FUNC 'timab'
867 !End of the abilint section
868 
869  implicit none
870 
871 #ifdef HAVE_PAPI
872 #include "f90papi.h"
873 #endif
874 
875 !Arguments ------------------------------------
876 !scalars
877  integer,intent(in) :: nn,option
878 !arrays
879  real(dp),intent(out) :: tottim(2)
880 
881 !Local variables-------------------------------
882 !scalars
883  real(dp),save :: cpu,wall
884  character(len=500) :: message
885 #ifdef HAVE_PAPI
886  integer(C_INT) :: check
887  integer(C_LONG_LONG),save :: flops1
888  real(C_FLOAT),save :: real_time,proc_time
889  real(C_FLOAT) :: mflops1
890  character(len=PAPI_MAX_STR_LEN) :: papi_errstr
891 #endif
892 ! *************************************************************************
893 
894  if (option==5) timopt=nn
895 
896 !If timopt was set to zero by a call with option=5, suppress
897 !all action of this routine (might as well return at this point !)
898  if(timopt/=0 .and. option/=5)then
899    ! Check that nn lies in sensible bounds
900    if (nn<1.or.nn>TIMER_SIZE) then
901      write(message,'(a,i0,a,i0)')'  TIMER_SIZE = ',TIMER_SIZE,' but input nn = ',nn
902      MSG_BUG(message)
903    end if
904 
905 #ifdef HAVE_PAPI
906    ! for all active options for time if papi analysis has been selected.
907    if (option/=3.and.time_get_papiopt()==1) then
908      call PAPIf_flops(real_time, proc_time, flops1, mflops1, check)
909      if (check /= PAPI_OK) then
910        call papif_perror(check,papi_errstr,check)
911        write(std_out,*) 'Problem to initialize papi high level inteface'
912        write(std_out,*) 'Error code', papi_errstr
913      end if
914      if (flops1 < 0) then
915        MSG_WARNING("Number of floating point instruction Overflow")
916        papi_flops(:)=-1
917      end if
918    end if
919 #endif
920 
921    select case (option)
922    case (0)
923      ! Zero out all accumulators of time and init timers
924      acctim(:,:)      = 0.0d0
925      tzero(:,:)       = 0.0d0
926      ncount(:)        = 0
927      papi_flops(:)    = 0
928      papi_acctim(:,:) = 0.
929      papi_accflops(:) = 0.
930      papi_tzero(:,:)  = 0.
931 
932    case (1)
933      ! Initialize timab for nn
934      call timein(cpu,wall)
935      tzero(1,nn)=cpu
936      tzero(2,nn)=wall
937 #ifdef HAVE_PAPI
938      papi_flops(nn)   = flops1       ! Initialize megaflops for nn
939      papi_tzero(1,nn) = proc_time
940      papi_tzero(2,nn) = real_time
941 #endif
942 
943    case (2)
944      ! Accumulate time for nn (also keep the values of cpu, wall, proc_time, real_time, flops1)
945      call timein(cpu,wall)
946      acctim(1,nn)=acctim(1,nn)+cpu -tzero(1,nn)
947      acctim(2,nn)=acctim(2,nn)+wall-tzero(2,nn)
948      ncount(nn)=ncount(nn)+1
949 #ifdef HAVE_PAPI
950      ! accumulate time and flops for nn Difference between 2 calls to Papif_flops
951      papi_acctim(1,nn)=papi_acctim(1,nn)+ proc_time - papi_tzero(1,nn)
952      papi_acctim(2,nn)=papi_acctim(2,nn)+ real_time - papi_tzero(2,nn)
953      papi_accflops(nn)=papi_accflops(nn)+ flops1- papi_flops(nn)
954 #endif
955 
956    case (3)
957      ! Use previously obtained values to initialize timab for nn
958      tzero(1,nn)=cpu
959      tzero(2,nn)=wall
960 #ifdef HAVE_PAPI
961      papi_flops(nn)=flops1
962      papi_tzero(1,nn) = proc_time
963      papi_tzero(2,nn) = real_time
964 #endif
965 
966    case (4)
967      ! Return elapsed time for nn (do not accumulate)
968      call timein(cpu,wall)
969      tottim(1)=cpu-tzero(1,nn)
970      tottim(2)=wall-tzero(2,nn)
971 #ifdef HAVE_PAPI
972      ! return elapsed floating point operationfor nn (do not accumulate)
973      papi_tottim(1,nn)= proc_time - papi_tzero(1,nn)
974      papi_tottim(2,nn)= real_time - papi_tzero(2,nn)
975      papi_totflops(nn)= flops1 - papi_flops(nn)
976 #endif
977 
978    case default
979      write(message,'(a,i10,a)')'  Input option not valid, =',option,'.'
980      MSG_BUG(message)
981    end select
982  end if
983 
984 end subroutine timab

m_time/time_accu [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  time_accu

FUNCTION

  Return the number of times the counter has been called
  and corresponding data for given index

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

671 subroutine time_accu(nn,return_ncount,tottim,totflops,totftimes)
672 
673 
674 !This section has been created automatically by the script Abilint (TD).
675 !Do not modify the following lines by hand.
676 #undef ABI_FUNC
677 #define ABI_FUNC 'time_accu'
678 !End of the abilint section
679 
680  implicit none
681 
682 !Arguments ------------------------------------
683 !scalars
684  integer,intent(in) :: nn
685  integer,intent(out) :: return_ncount
686  real(dp),intent(out) :: totflops
687 !arrays
688  real(dp),intent(out) :: totftimes(2),tottim(2)
689 
690 !Local variables-------------------------------
691 !scalars
692  character(len=500) :: message
693 
694 ! *************************************************************************
695 
696 !Check that nn lies in sensible bounds
697  if (nn<0.or.nn>TIMER_SIZE) then
698    write(message,'(a,i6,a,i8,a)')' dim TIMER_SIZE=',TIMER_SIZE,' but input nn=',nn,'.'
699    MSG_BUG(message)
700  end if
701 
702 !return accumulated time for nn
703  tottim(1)=acctim(1,nn)
704  tottim(2)=acctim(2,nn)
705 
706 !return accumulated number flops for nn
707  totflops = papi_accflops(nn)
708 
709 !return accumulated time for nn evaluated by papi
710  totftimes(1) = papi_acctim(1,nn)
711  totftimes(2) = papi_acctim(2,nn)
712  return_ncount=ncount(nn)
713 
714 end subroutine time_accu

m_time/time_get_papiopt [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  time_get_papiopt

FUNCTION

  Return the value of papiopt

PARENTS

CHILDREN

SOURCE

768 function time_get_papiopt()
769 
770 
771 !This section has been created automatically by the script Abilint (TD).
772 !Do not modify the following lines by hand.
773 #undef ABI_FUNC
774 #define ABI_FUNC 'time_get_papiopt'
775 !End of the abilint section
776 
777  implicit none
778 
779 !Arguments ------------------------------------
780 !scalars
781  integer :: time_get_papiopt
782 
783 ! *************************************************************************
784 
785  time_get_papiopt = papiopt
786 
787 end function time_get_papiopt

m_time/time_set_papiopt [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  time_set_papiopt

FUNCTION

  Set the value of papiopt

PARENTS

      abinit

CHILDREN

SOURCE

731 subroutine time_set_papiopt(opt)
732 
733 
734 !This section has been created automatically by the script Abilint (TD).
735 !Do not modify the following lines by hand.
736 #undef ABI_FUNC
737 #define ABI_FUNC 'time_set_papiopt'
738 !End of the abilint section
739 
740  implicit none
741 
742 !Arguments ------------------------------------
743 !scalars
744  integer,intent(in) :: opt
745 
746 ! *************************************************************************
747 
748  papiopt = opt
749 
750 end subroutine time_set_papiopt

m_time/timein [ Functions ]

[ Top ] [ m_time ] [ Functions ]

NAME

  timein

FUNCTION

  Timing routine. Returns cpu and wall clock time in seconds since some arbitrary start.
  For wall clock time, call the F90 intrinsic date_and_time.

INPUTS

  (no inputs)

OUTPUT

  cpu= cpu time in seconds
  wall= wall clock time in seconds

NOTES

  For CPU time, contains machine-dependent code (choice will be selected
  by C preprocessor, see abi_cpu_time).

TODO

  Should be replaced by cwtime

PARENTS

      abinit,aim,aim_follow,anaddb,bsepostproc,conducti,cpdrv,cut3d,drvaim
      elphon,first_rec,m_exit,mrgddb,mrgscr,multibinit,optic,rsurf,surf,timab

CHILDREN

SOURCE

623 subroutine timein(cpu,wall)
624 
625 
626 !This section has been created automatically by the script Abilint (TD).
627 !Do not modify the following lines by hand.
628 #undef ABI_FUNC
629 #define ABI_FUNC 'timein'
630 !End of the abilint section
631 
632  implicit none
633 
634 !Arguments ------------------------------------
635 !scalars
636  real(dp),intent(out) :: cpu,wall
637 ! *************************************************************************
638 
639  ! CPU time
640  cpu = abi_cpu_time()
641  ! Wall time
642  wall = abi_wtime()
643 
644 end subroutine timein