Changeset 5116 for LMDZ6/branches/Amaury_dev/libf/dyn3dmem/times.F90
- Timestamp:
- Jul 24, 2024, 2:54:37 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3dmem/times.F90
r5113 r5116 13 13 integer, parameter :: suspended = 3 14 14 15 integer:: max_size15 INTEGER :: max_size 16 16 real, allocatable, dimension(:,:,:) :: timer_table 17 17 real, allocatable, dimension(:,:,:) :: timer_table_sqr … … 50 50 SUBROUTINE start_timer(no_timer) 51 51 IMPLICIT NONE 52 integer :: no_timer 53 54 if (AllTimer_IsActive) then 55 56 if (timer_state(no_timer)/=stopped) then 52 INTEGER :: no_timer 53 54 if (AllTimer_IsActive) THEN 55 if (timer_state(no_timer)/=stopped) THEN 57 56 CALL abort_gcm("times","start_timer :: timer is already running or suspended",1) 58 57 else … … 69 68 SUBROUTINE suspend_timer(no_timer) 70 69 IMPLICIT NONE 71 integer:: no_timer70 INTEGER :: no_timer 72 71 73 if (AllTimer_IsActive) then74 if (timer_state(no_timer)/=running) then72 if (AllTimer_IsActive) THEN 73 if (timer_state(no_timer)/=running) THEN 75 74 CALL abort_gcm("times","suspend_timer :: timer is not running",1) 76 75 else … … 86 85 SUBROUTINE resume_timer(no_timer) 87 86 IMPLICIT NONE 88 integer:: no_timer87 INTEGER :: no_timer 89 88 90 if (AllTimer_IsActive) then91 if (timer_state(no_timer)/=suspended) then89 if (AllTimer_IsActive) THEN 90 if (timer_state(no_timer)/=suspended) THEN 92 91 CALL abort_gcm("times","resume_timer :: timer is not suspended",1) 93 92 else … … 103 102 USE parallel_lmdz 104 103 IMPLICIT NONE 105 integer :: no_timer 106 integer :: N 107 real :: V,V2 108 109 if (AllTimer_IsActive) then 110 111 if (timer_state(no_timer)/=running) then 104 INTEGER :: no_timer 105 INTEGER :: N 106 REAL :: V,V2 107 108 if (AllTimer_IsActive) THEN 109 if (timer_state(no_timer)/=running) THEN 112 110 CALL abort_gcm("times","stop_timer :: timer is not running",1) 113 111 else … … 123 121 timer_iteration(jj_nb,no_timer,mpi_rank)=timer_iteration(jj_nb,no_timer,mpi_rank)+1 124 122 timer_average(jj_nb,no_timer,mpi_rank)=timer_table(jj_nb,no_timer,mpi_rank)/timer_iteration(jj_nb,no_timer,mpi_rank) 125 if (timer_iteration(jj_nb,no_timer,mpi_rank)>=2) then123 if (timer_iteration(jj_nb,no_timer,mpi_rank)>=2) THEN 126 124 N=timer_iteration(jj_nb,no_timer,mpi_rank) 127 125 V2=timer_table_sqr(jj_nb,no_timer,mpi_rank) … … 140 138 IMPLICIT NONE 141 139 142 integer:: ierr143 integer:: data_size140 INTEGER :: ierr 141 INTEGER :: data_size 144 142 real, allocatable,dimension(:,:) :: tmp_table 145 143 146 144 IF (using_mpi) THEN 147 145 148 if (AllTimer_IsActive) then 149 150 146 if (AllTimer_IsActive) THEN 151 147 allocate(tmp_table(max_size,nb_timer)) 152 148 … … 169 165 USE lmdz_mpi 170 166 IMPLICIT NONE 171 integer:: ierr172 integer:: data_size167 INTEGER :: ierr 168 INTEGER :: data_size 173 169 real, allocatable,dimension(:,:),target :: tmp_table 174 170 integer, allocatable,dimension(:,:),target :: tmp_iter 175 integer:: istats171 INTEGER :: istats 176 172 177 173 IF (using_mpi) THEN 178 174 179 if (AllTimer_IsActive) then 180 175 if (AllTimer_IsActive) THEN 181 176 allocate(tmp_table(max_size,nb_timer)) 182 177 allocate(tmp_iter(max_size,nb_timer)) … … 199 194 SUBROUTINE InitTime 200 195 IMPLICIT NONE 201 integer:: count,count_rate,count_max196 INTEGER :: count,count_rate,count_max 202 197 203 198 AllTimer_IsActive=.TRUE. 204 if (AllTimer_IsActive) then199 if (AllTimer_IsActive) THEN 205 200 CALL system_clock(count,count_rate,count_max) 206 201 CALL cpu_time(Last_cpuCount) … … 212 207 IMPLICIT NONE 213 208 double precision :: DiffTime 214 integer:: count,count_rate,count_max209 INTEGER :: count,count_rate,count_max 215 210 216 211 CALL system_clock(count,count_rate,count_max) 217 if (Count>=Last_Count) then212 if (Count>=Last_Count) THEN 218 213 DiffTime=(1.*(Count-last_Count))/count_rate 219 214 else … … 221 216 endif 222 217 Last_Count=Count 223 end functionDiffTime218 END FUNCTION DiffTime 224 219 225 220 function DiffCpuTime() 226 221 IMPLICIT NONE 227 real:: DiffCpuTime228 real:: Count222 REAL :: DiffCpuTime 223 REAL :: Count 229 224 230 225 CALL cpu_time(Count) 231 226 DiffCpuTime=Count-Last_cpuCount 232 227 Last_cpuCount=Count 233 end functionDiffCpuTime228 END FUNCTION DiffCpuTime 234 229 235 230 end module times
Note: See TracChangeset
for help on using the changeset viewer.