Changeset 700 for codes/icosagcm
- Timestamp:
- 05/24/18 14:56:55 (6 years ago)
- Location:
- codes/icosagcm/devel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/Python/src/unstructured.pyx
r699 r700 69 69 kernels.import_funs([ 70 70 ['dynamico_setup_xios',None], 71 ['dynamico_print_trace',None], 71 72 ['dynamico_xios_set_timestep',c_double], 72 73 ['dynamico_xios_update_calendar',c_int], -
codes/icosagcm/devel/src/unstructured/data_unstructured.F90
r699 r700 26 26 ! circulation is positive when going from down to up 27 27 28 TIME, PARAMETER :: print_trace_interval = 1. 28 29 TIME, BIND(C) :: elapsed 29 30 NUM, BIND(C) :: g, ptop, cpp, cppv, Rd, Rv, preff, Treff, pbot, Phi_bot, rho_bot … … 38 39 INTEGER, PARAMETER :: id_dev1=1, id_dev2=2, & 39 40 id_pvort_only=3, id_slow_hydro=4, id_fast=5, id_coriolis=6, id_theta=7, id_geopot=8, id_vert=9, & 40 id_solver=10, id_slow_NH=11, id_NH_geopot=12, id_vert_NH=13, id_update=14, nb_routines=1441 id_solver=10, id_slow_NH=11, id_NH_geopot=12, id_vert_NH=13, id_update=14, id_halo=15, nb_routines=15 41 42 TIME, PRIVATE :: start_time, time_spent(nb_routines) ! time spent in each kernel 42 43 INTEGER, PRIVATE :: current_id, nb_calls(nb_routines) … … 45 46 (/'dev1 ', 'dev2 ', & 46 47 'pvort_only', 'slow_hydro', 'fast ', 'coriolis ', 'theta ', 'geopot ', 'vert ', & 47 'solver ', 'slow_NH ', 'NH_geopot ', 'vert_NH ', 'update ' /)48 'solver ', 'slow_NH ', 'NH_geopot ', 'vert_NH ', 'update ', 'halo_xchg ' /) 48 49 49 50 INTEGER, PARAMETER ::transfer_primal=1, transfer_edge=2, transfer_dual=3, transfer_max=3 … … 69 70 END SUBROUTINE init_trace 70 71 71 SUBROUTINE print_trace ()72 SUBROUTINE print_trace_() BIND(C, name='dynamico_print_trace') 72 73 INTEGER :: id 73 74 TIME :: total_spent 74 !$OMP MASTER75 total_spent=SUM(time_spent) 75 76 IF(dynamico_mpi_rank==0) THEN 76 total_spent=SUM(time_spent) 77 IF(total_spent>1.) THEN 78 PRINT *, '========================= Performance metrics =========================' 79 PRINT *, 'Total time spent in instrumented code (seconds) :', total_spent 80 PRINT *, 'Name, #calls, %time, microsec/call, MB/sec' 81 DO id=1,nb_routines 82 IF(nb_calls(id)>0) PRINT *, id_name(id), nb_calls(id), INT(100.*time_spent(id)/total_spent), & 83 INT(1e6*time_spent(id)/nb_calls(id)), INT(1e-6*bytes(id)/time_spent(id)) 84 END DO 77 PRINT *, '========================= Performance metrics =========================' 78 PRINT *, 'Total time spent in instrumented code (seconds) :', total_spent 79 PRINT *, 'Name, #calls, %time, microsec/call, MB/sec' 80 DO id=1,nb_routines 81 IF(nb_calls(id)>0) PRINT *, id_name(id), nb_calls(id), INT(100.*time_spent(id)/total_spent), & 82 INT(1e6*time_spent(id)/nb_calls(id)), INT(1e-6*bytes(id)/time_spent(id)) 83 END DO 84 END IF 85 END SUBROUTINE print_trace_ 86 87 SUBROUTINE print_trace() 88 !$OMP MASTER 89 IF(SUM(time_spent)>print_trace_interval) THEN 90 CALL print_trace_ 85 91 CALL init_trace() 86 92 END IF 87 END IF88 93 !$OMP END MASTER 89 94 END SUBROUTINE print_trace -
codes/icosagcm/devel/src/unstructured/transfer_unstructured.F90
r688 r700 76 76 INTEGER :: llbuf, num, i, istart, ireq, ierr 77 77 IF(.NOT. transfer_initialized) RETURN 78 CALL enter_trace(id_halo, 0) 78 79 halo => send_info(index) 79 80 buf => halo%buf2 … … 109 110 110 111 CALL copy_out(SIZE(data,1), SIZE(data,2), SIZE(buf,1), SIZE(buf,2), halo%cells, data, buf) 112 CALL enter_trace(id_halo, 0) 111 113 END SUBROUTINE update_halo 112 114
Note: See TracChangeset
for help on using the changeset viewer.