Changeset 4539
- Timestamp:
- May 18, 2020 2:05:17 PM (5 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/cpulog_mod.f90
r4536 r4539 25 25 ! ----------------- 26 26 ! $Id$ 27 ! code re-structured, 28 ! cpu time per grid point and timestep does not included initialization and spinup any more 29 ! 30 ! 4536 2020-05-17 17:24:13Z raasch 27 31 ! restart I/O transfer speed added 28 32 ! … … 287 291 288 292 ! 289 !-- Compute cpu-times in seconds293 !-- Compute CPU-times in seconds for the global non-overlapping measurements. 290 294 log_point%mtime = log_point%mtime / norm 291 295 log_point%sum = log_point%sum / norm … … 297 301 298 302 ! 299 !-- Collect cpu-times from all PEs and calculate statistics303 !-- Collect CPU-times from all PEs and calculate statistics 300 304 IF ( myid == 0 ) THEN 301 305 ! … … 348 352 349 353 ! 350 !-- Write cpu-times 354 !-- The same procedure again for the special measurements. 355 ! 356 !-- Compute cpu-times in seconds 357 log_point_s%mtime = log_point_s%mtime / norm 358 log_point_s%sum = log_point_s%sum / norm 359 log_point_s%vector = log_point_s%vector / norm 360 WHERE ( log_point_s%counts /= 0 ) 361 log_point_s%mean = log_point_s%sum / log_point_s%counts 362 END WHERE 363 364 ! 365 !-- Collect CPU-times from all PEs and calculate statistics 366 #if defined( __parallel ) 367 ! 368 !-- Set barrier in order to avoid that PE0 receives log_point_s-data 369 !-- while still busy with receiving log_point-data (see above) 370 CALL MPI_BARRIER( comm2d, ierr ) 371 #endif 372 IF ( myid == 0 ) THEN 373 ! 374 !-- Initialize temporary arrays needed for statistics 375 pe_min = log_point_s%sum 376 pe_max = log_point_s%sum ! need to be set in case of 1 PE 377 pe_rms = 0.0_dp 378 379 #if defined( __parallel ) 380 ! 381 !-- Receive data from all PEs 382 DO i = 1, numprocs-1 383 CALL MPI_RECV( pe_tmp(1), SIZE( log_point ), MPI_DOUBLE_PRECISION, MPI_ANY_SOURCE, & 384 MPI_ANY_TAG, comm2d, status, ierr ) 385 sender = status(MPI_SOURCE) 386 pe_log_points(:,sender) = pe_tmp 387 ENDDO 388 pe_log_points(:,0) = log_point_s%sum ! Results from PE0 389 ! 390 !-- Calculate mean of all PEs, store it on log_point_s%sum 391 !-- and find minimum and maximum 392 DO iii = 1, SIZE( log_point ) 393 DO i = 1, numprocs-1 394 log_point_s(iii)%sum = log_point_s(iii)%sum + pe_log_points(iii,i) 395 pe_min(iii) = MIN( pe_min(iii), pe_log_points(iii,i) ) 396 pe_max(iii) = MAX( pe_max(iii), pe_log_points(iii,i) ) 397 ENDDO 398 log_point_s(iii)%sum = log_point_s(iii)%sum / numprocs 399 ! 400 !-- Calculate rms 401 DO i = 0, numprocs-1 402 pe_rms(iii) = pe_rms(iii) + ( pe_log_points(iii,i) - log_point_s(iii)%sum )**2 403 ENDDO 404 pe_rms(iii) = SQRT( pe_rms(iii) / numprocs ) 405 ENDDO 406 ELSE 407 ! 408 !-- Send data to PE0 (pe_max is used as temporary storage to send 409 !-- the data in order to avoid sending the data type log) 410 pe_max = log_point_s%sum 411 CALL MPI_SEND( pe_max(1), SIZE( log_point ), MPI_DOUBLE_PRECISION, 0, 0, comm2d, ierr ) 412 #endif 413 414 ENDIF 415 ! 416 !-- Write CPU-times for the non-overlapping measurements. 351 417 IF ( myid == 0 ) THEN 352 418 ! … … 360 426 361 427 ! 362 !-- Get total time in order to calculate CPU-time per gridpoint and 363 !-- timestep428 !-- Get total time in order to calculate CPU-time per gridpoint and timestep. 429 !-- Time for initialization (2) and spinup (41) are not included here! 364 430 IF ( nr_timesteps_this_run /= 0 ) THEN 365 average_cputime = log_point (1)%sum / REAL( ngp_3d(0), KIND=dp ) /&431 average_cputime = log_point_s(10)%sum / REAL( ngp_3d(0), KIND=dp ) / & 366 432 REAL( nr_timesteps_this_run, KIND=dp ) * 1E6_dp ! in micro-sec 367 433 ELSE … … 399 465 ENDIF 400 466 401 402 ! 403 !-- The same procedure again for the individual measurements. 404 ! 405 !-- Compute cpu-times in seconds 406 log_point_s%mtime = log_point_s%mtime / norm 407 log_point_s%sum = log_point_s%sum / norm 408 log_point_s%vector = log_point_s%vector / norm 409 WHERE ( log_point_s%counts /= 0 ) 410 log_point_s%mean = log_point_s%sum / log_point_s%counts 411 END WHERE 412 413 ! 414 !-- Collect cpu-times from all PEs and calculate statistics 415 #if defined( __parallel ) 416 ! 417 !-- Set barrier in order to avoid that PE0 receives log_point_s-data 418 !-- while still busy with receiving log_point-data (see above) 419 CALL MPI_BARRIER( comm2d, ierr ) 420 #endif 421 IF ( myid == 0 ) THEN 422 ! 423 !-- Initialize temporary arrays needed for statistics 424 pe_min = log_point_s%sum 425 pe_max = log_point_s%sum ! need to be set in case of 1 PE 426 pe_rms = 0.0_dp 427 428 #if defined( __parallel ) 429 ! 430 !-- Receive data from all PEs 431 DO i = 1, numprocs-1 432 CALL MPI_RECV( pe_tmp(1), SIZE( log_point ), MPI_DOUBLE_PRECISION, MPI_ANY_SOURCE, & 433 MPI_ANY_TAG, comm2d, status, ierr ) 434 sender = status(MPI_SOURCE) 435 pe_log_points(:,sender) = pe_tmp 436 ENDDO 437 pe_log_points(:,0) = log_point_s%sum ! Results from PE0 438 ! 439 !-- Calculate mean of all PEs, store it on log_point_s%sum 440 !-- and find minimum and maximum 441 DO iii = 1, SIZE( log_point ) 442 DO i = 1, numprocs-1 443 log_point_s(iii)%sum = log_point_s(iii)%sum + pe_log_points(iii,i) 444 pe_min(iii) = MIN( pe_min(iii), pe_log_points(iii,i) ) 445 pe_max(iii) = MAX( pe_max(iii), pe_log_points(iii,i) ) 446 ENDDO 447 log_point_s(iii)%sum = log_point_s(iii)%sum / numprocs 448 ! 449 !-- Calculate rms 450 DO i = 0, numprocs-1 451 pe_rms(iii) = pe_rms(iii) + ( pe_log_points(iii,i) - log_point_s(iii)%sum )**2 452 ENDDO 453 pe_rms(iii) = SQRT( pe_rms(iii) / numprocs ) 454 ENDDO 455 ELSE 456 ! 457 !-- Send data to PE0 (pe_max is used as temporary storage to send 458 !-- the data in order to avoid sending the data type log) 459 pe_max = log_point_s%sum 460 CALL MPI_SEND( pe_max(1), SIZE( log_point ), MPI_DOUBLE_PRECISION, 0, 0, comm2d, ierr ) 461 #endif 462 463 ENDIF 464 465 ! 466 !-- Write cpu-times 467 ! 468 !-- Write CPU-times for special measurements. 467 469 IF ( myid == 0 ) THEN 468 470 ! -
palm/trunk/SOURCE/palm.f90
r4535 r4539 21 21 ! ----------------- 22 22 ! 23 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! log point name changed 28 ! 29 ! 4535 2020-05-15 12:07:23Z raasch 27 30 ! bugfix for restart data format query 28 31 ! … … 407 410 IF ( write_binary ) THEN 408 411 409 CALL cpu_log( log_point(22), 'wr d_local', 'start' )412 CALL cpu_log( log_point(22), 'write-restart-data', 'start' ) 410 413 411 414 CALL location_message( 'writing restart data', 'start' ) … … 453 456 CALL location_message( 'writing restart data', 'finished' ) 454 457 455 CALL cpu_log( log_point(22), 'wr d_local', 'stop' )458 CALL cpu_log( log_point(22), 'write-restart-data', 'stop' ) 456 459 457 460 ENDIF -
palm/trunk/SOURCE/read_restart_data_mod.f90
r4536 r4539 25 25 ! ----------------- 26 26 ! $Id$ 27 ! location message added 28 ! 29 ! 4536 2020-05-17 17:24:13Z raasch 27 30 ! binary version incremented 28 31 ! … … 1438 1441 ! 1439 1442 !-- Read data from previous model run. 1440 CALL cpu_log( log_point_s(14), 'rrd_local', 'start' ) 1443 CALL cpu_log( log_point_s(14), 'read-restart-data-local', 'start' ) 1444 1445 CALL location_message( 'reading local restart data', 'start' ) 1441 1446 1442 1447 IF ( TRIM( restart_data_format_input ) == 'fortran_binary' ) THEN … … 2482 2487 ENDIF 2483 2488 2489 CALL location_message( 'reading local restart data', 'finished' ) 2484 2490 ! 2485 2491 !-- End of time measuring for reading binary data 2486 CALL cpu_log( log_point_s(14), 'r rd_local', 'stop' )2492 CALL cpu_log( log_point_s(14), 'read-restart-data-local', 'stop' ) 2487 2493 2488 2494 END SUBROUTINE rrd_local -
palm/trunk/SOURCE/restart_data_mpi_io_mod.f90
r4536 r4539 24 24 ! ----------------- 25 25 ! $Id$ 26 ! checks added, if index limits in header are exceeded 27 ! bugfix in rrd_mpi_io_int_2d 28 ! 29 ! 4536 2020-05-17 17:24:13Z raasch 26 30 ! messages and debug output converted to PALM routines 27 31 ! … … 178 182 179 183 INTEGER(KIND=rd_offset_kind) :: header_char_index 180 INTEGER, PARAMETER :: max_nr_ text=128181 CHARACTER(LEN=128), DIMENSION(max_nr_ text) :: text_lines184 INTEGER, PARAMETER :: max_nr_char=128 185 CHARACTER(LEN=128), DIMENSION(max_nr_char) :: text_lines 182 186 183 187 INTEGER(KIND=rd_offset_kind) :: header_real_index … … 186 190 REAL(KIND=wp), DIMENSION(max_nr_real) :: real_values 187 191 188 INTEGER(KIND=rd_offset_kind) :: header_arr _index192 INTEGER(KIND=rd_offset_kind) :: header_array_index 189 193 INTEGER, PARAMETER :: max_nr_arrays=600 190 194 CHARACTER(LEN=32), DIMENSION(max_nr_arrays) :: array_names … … 456 460 header_int_index = 1 457 461 header_char_index = 1 458 header_real_index 459 header_arr _index= 1462 header_real_index = 1 463 header_array_index = 1 460 464 461 465 int_names = ' ' … … 852 856 CALL MPI_FILE_SET_VIEW( fh, array_position, MPI_INTEGER, ft_2di_nb, 'native', & 853 857 MPI_INFO_NULL, ierr ) 854 CALL MPI_FILE_READ_ALL( fh, array_2d , SIZE( array_2d), MPI_INTEGER, status, ierr )858 CALL MPI_FILE_READ_ALL( fh, array_2di, SIZE( array_2di ), MPI_INTEGER, status, ierr ) 855 859 ENDIF 856 860 CALL sm_io%sm_node_barrier() … … 1101 1105 1102 1106 1107 IF ( header_int_index == max_nr_int ) THEN 1108 STOP '+++ maximum number of INTEGER entries in restart file header exceeded' 1109 ENDIF 1110 1103 1111 int_names(header_int_index) = name 1104 1112 int_values(header_int_index) = value … … 1118 1126 1119 1127 1128 IF ( header_real_index == max_nr_real ) THEN 1129 STOP '+++ maximum number of REAL entries in restart file header exceeded' 1130 ENDIF 1131 1120 1132 real_names(header_real_index) = name 1121 1133 real_values(header_real_index) = value … … 1146 1158 1147 1159 1148 array_names(header_arr_index) = name 1149 array_offset(header_arr_index) = array_position 1150 header_arr_index = header_arr_index + 1 1160 IF ( header_array_index == max_nr_arrays ) THEN 1161 STOP '+++ maximum number of 2d/3d-array entries in restart file header exceeded' 1162 ENDIF 1163 1164 array_names(header_array_index) = name 1165 array_offset(header_array_index) = array_position 1166 header_array_index = header_array_index + 1 1151 1167 1152 1168 IF ( include_total_domain_boundaries ) THEN … … 1207 1223 1208 1224 1209 array_names(header_arr_index) = name 1210 array_offset(header_arr_index) = array_position 1211 header_arr_index = header_arr_index + 1 1225 IF ( header_array_index == max_nr_arrays ) THEN 1226 STOP '+++ maximum number of 2d/3d-array entries in restart file header exceeded' 1227 ENDIF 1228 1229 array_names(header_array_index) = name 1230 array_offset(header_array_index) = array_position 1231 header_array_index = header_array_index + 1 1212 1232 1213 1233 IF ( ( nxr-nxl + 1 + 2 * nbgp ) == SIZE( data, 2 ) ) THEN … … 1278 1298 1279 1299 1280 array_names(header_arr_index) = name 1281 array_offset(header_arr_index) = array_position 1282 header_arr_index = header_arr_index + 1 1300 IF ( header_array_index == max_nr_arrays ) THEN 1301 STOP '+++ maximum number of 2d/3d-array entries in restart file header exceeded' 1302 ENDIF 1303 1304 array_names(header_array_index) = name 1305 array_offset(header_array_index) = array_position 1306 header_array_index = header_array_index + 1 1283 1307 1284 1308 IF ( include_total_domain_boundaries ) THEN … … 1347 1371 1348 1372 1349 array_names(header_arr_index) = name 1350 array_offset(header_arr_index) = array_position 1351 header_arr_index = header_arr_index + 1 1373 IF ( header_array_index == max_nr_arrays ) THEN 1374 STOP '+++ maximum number of 2d/3d-array entries in restart file header exceeded' 1375 ENDIF 1376 1377 array_names(header_array_index) = name 1378 array_offset(header_array_index) = array_position 1379 header_array_index = header_array_index + 1 1352 1380 1353 1381 #if defined( __parallel ) … … 1411 1439 1412 1440 1441 IF ( header_char_index == max_nr_char ) THEN 1442 STOP '+++ maximum number of CHARACTER entries in restart file header exceeded' 1443 ENDIF 1444 1413 1445 lo_line = name 1414 1446 lo_line(33:) = text … … 1687 1719 offset = 0 1688 1720 1689 array_names(header_arr_index) = name 1690 array_offset(header_arr_index) = array_position 1691 header_arr_index = header_arr_index + 1 1721 IF ( header_array_index == max_nr_arrays ) THEN 1722 STOP '+++ maximum number of 2d/3d-array entries in restart file header exceeded' 1723 ENDIF 1724 1725 array_names(header_array_index) = name 1726 array_offset(header_array_index) = array_position 1727 header_array_index = header_array_index + 1 1692 1728 1693 1729 ! … … 1822 1858 #endif 1823 1859 1860 IF ( header_array_index == max_nr_arrays ) THEN 1861 STOP '+++ maximum number of 2d/3d-array entries in restart file header exceeded' 1862 ENDIF 1863 1824 1864 offset = 0 1825 array_names(header_arr _index) = name1826 array_offset(header_arr _index) = array_position1827 header_arr _index = header_arr_index + 11865 array_names(header_array_index) = name 1866 array_offset(header_array_index) = array_position 1867 header_array_index = header_array_index + 1 1828 1868 1829 1869 ! … … 2052 2092 ENDIF 2053 2093 ! 2054 !-- In case of 2d-data, name is writ en only once2094 !-- In case of 2d-data, name is written only once 2055 2095 IF ( lo_first_index == 1 ) THEN 2056 array_names(header_arr_index) = name 2057 array_offset(header_arr_index) = array_position 2058 header_arr_index = header_arr_index + 1 2059 ENDIF 2096 2097 IF ( header_array_index == max_nr_arrays ) THEN 2098 STOP '+++ maximum number of 2d/3d-array entries in restart file header exceeded' 2099 ENDIF 2100 2101 array_names(header_array_index) = name 2102 array_offset(header_array_index) = array_position 2103 header_array_index = header_array_index + 1 2104 2105 ENDIF 2106 2060 2107 #if defined( __parallel ) 2061 2108 IF ( sm_io%is_sm_active() ) THEN … … 2155 2202 tgh%nr_char = header_char_index - 1 2156 2203 tgh%nr_real = header_real_index - 1 2157 tgh%nr_arrays = header_arr _index - 12204 tgh%nr_arrays = header_array_index - 1 2158 2205 tgh%total_nx = lb%nx + 1 2159 2206 tgh%total_ny = lb%ny + 1
Note: See TracChangeset
for help on using the changeset viewer.