SURFEX v8.1
General documentation of Surfex
gstats_psut.F90
Go to the documentation of this file.
1 SUBROUTINE gstats_psut
2 
3 ! MEASURE PARALLELL START UP TIME
4 
5 USE parkind1 ,ONLY : jprd, jpim ,jprb
6 
7 USE yomgstats
8 USE yommpi , ONLY : mrealt
9 #ifdef SFX_MPI
10 USE mpl_module
11 #endif
12 
13 IMPLICIT NONE
14 
15 INTEGER(KIND=JPIM) :: ITAG,ILSEND,ILBUF,JROC,IRECV,ISEND
16 REAL(KIND=JPRD) :: ZTBUF(2),ZCLOCK,ZCLOCKB
17 
18 #include "user_clock.h"
19 
20 #ifdef SFX_MPI
21 IF(nproc_stats > 1) THEN
22  CALL user_clock(pelapsed_time=zclockb)
23  CALL mpl_barrier
24  CALL user_clock(pelapsed_time=zclock)
25  itag = jptagstat
26  IF (myproc_stats /= 1) THEN
27  ztbuf(1) = zclockb
28  ztbuf(2) = zclock
29  ilsend = 2
30  isend = 1
31  CALL mpl_send(ztbuf(1:ilsend),kdest=nprcids_stats(isend), &
32  & ktag=itag,cdstring='SUSTATS:')
33  ELSE
34  ilbuf = 2
35  ALLOCATE(time_start(nproc_stats))
36  time_start(1) = zclockb - timelcall(0)
37  DO jroc=2,nproc_stats
38  irecv = jroc
39  CALL mpl_recv(ztbuf(1:ilbuf),ksource=nprcids_stats(irecv), &
40  & ktag=itag,cdstring='SUSTATS:')
41  time_start(jroc) = ztbuf(1) - timelcall(0) -(ztbuf(2)-zclock)
42  ENDDO
43  ENDIF
44 ENDIF
45 #endif
46 
47 END SUBROUTINE gstats_psut
integer(kind=jpim) myproc_stats
Definition: yomgstats.F90:121
integer, parameter jpim
Definition: parkind1.F90:13
integer(kind=jpim), parameter jptagstat
Definition: yomgstats.F90:109
integer, parameter jprd
Definition: parkind1.F90:39
real(kind=jprd), dimension(0:jpmaxstat) timelcall
Definition: yomgstats.F90:96
integer(kind=jpim) nproc_stats
Definition: yomgstats.F90:120
subroutine user_clock(PELAPSED_TIME, PELAPSED_TIME_SINCE, PVECTOR_CP, PTOTAL_CP)
Definition: user_clock.F90:2
integer, parameter jprb
Definition: parkind1.F90:32
integer(kind=jpim), dimension(:), allocatable nprcids_stats
Definition: yomgstats.F90:122
integer(kind=jpim), parameter mrealt
Definition: yommpi.F90:15
subroutine gstats_psut
Definition: gstats_psut.F90:2
Definition: yommpi.F90:1
real(kind=jprd), dimension(:), allocatable time_start
Definition: yomgstats.F90:106