Changeset 700


Ignore:
Timestamp:
05/24/18 14:56:55 (6 years ago)
Author:
dubos
Message:

devel/unstructured : profile halo exchange & reduce verbosity

Location:
codes/icosagcm/devel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/Python/src/unstructured.pyx

    r699 r700  
    6969kernels.import_funs([ 
    7070                     ['dynamico_setup_xios',None], 
     71                     ['dynamico_print_trace',None], 
    7172                     ['dynamico_xios_set_timestep',c_double], 
    7273                     ['dynamico_xios_update_calendar',c_int], 
  • codes/icosagcm/devel/src/unstructured/data_unstructured.F90

    r699 r700  
    2626  ! circulation is positive when going from down to up 
    2727 
     28  TIME, PARAMETER :: print_trace_interval = 1. 
    2829  TIME, BIND(C) :: elapsed 
    2930  NUM, BIND(C) :: g, ptop, cpp, cppv, Rd, Rv, preff, Treff, pbot, Phi_bot, rho_bot 
     
    3839  INTEGER, PARAMETER :: id_dev1=1, id_dev2=2, & 
    3940       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=14  
     41       id_solver=10, id_slow_NH=11, id_NH_geopot=12, id_vert_NH=13, id_update=14, id_halo=15, nb_routines=15  
    4142  TIME, PRIVATE :: start_time, time_spent(nb_routines) ! time spent in each kernel 
    4243  INTEGER, PRIVATE :: current_id, nb_calls(nb_routines) 
     
    4546       (/'dev1      ', 'dev2      ', & 
    4647       '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 ' /) 
    4849 
    4950  INTEGER, PARAMETER ::transfer_primal=1, transfer_edge=2, transfer_dual=3, transfer_max=3 
     
    6970  END SUBROUTINE init_trace 
    7071 
    71   SUBROUTINE print_trace() 
     72  SUBROUTINE print_trace_() BIND(C, name='dynamico_print_trace') 
    7273    INTEGER :: id 
    7374    TIME :: total_spent 
    74     !$OMP MASTER 
     75    total_spent=SUM(time_spent) 
    7576    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_ 
    8591          CALL init_trace() 
    8692       END IF 
    87     END IF 
    8893    !$OMP END MASTER 
    8994  END SUBROUTINE print_trace 
  • codes/icosagcm/devel/src/unstructured/transfer_unstructured.F90

    r688 r700  
    7676    INTEGER :: llbuf, num, i, istart, ireq, ierr 
    7777    IF(.NOT. transfer_initialized) RETURN 
     78    CALL enter_trace(id_halo, 0) 
    7879    halo => send_info(index) 
    7980    buf => halo%buf2 
     
    109110 
    110111    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) 
    111113  END SUBROUTINE update_halo 
    112114 
Note: See TracChangeset for help on using the changeset viewer.