Changeset 699 for codes/icosagcm


Ignore:
Timestamp:
05/18/18 12:31:45 (6 years ago)
Author:
dubos
Message:

devel/unstructured : PRINT perf only if MPI master

Location:
codes/icosagcm/devel
Files:
2 edited

Legend:

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

    r689 r699  
    8989    c_int,'llm','nqdyn','primal_num','max_primal_deg', 
    9090    'dual_num','max_dual_deg','edge_num','max_trisk_deg', 
    91     'caldyn_thermo','caldyn_eta','nb_threads', 
     91    'caldyn_thermo','caldyn_eta','nb_threads','dynamico_mpi_rank', 
    9292    c_double,'elapsed', 
    9393    c_num, 'g', 'ptop', 'cpp', 'cppv', 
  • codes/icosagcm/devel/src/unstructured/data_unstructured.F90

    r695 r699  
    3434  NUM2(:,:), ALLOCATABLE          :: Riv2, wee, ap,bp, mass_bl, mass_dak, mass_dbk 
    3535 
    36   INTEGER(C_INT), BIND(C) :: comm_icosa 
     36  INTEGER(C_INT), BIND(C) :: comm_icosa, dynamico_mpi_rank=0 
    3737 
    3838  INTEGER, PARAMETER :: id_dev1=1, id_dev2=2, & 
     
    7373    TIME :: total_spent 
    7474    !$OMP MASTER 
    75     total_spent=SUM(time_spent) 
    76     IF(total_spent>1.) THEN 
    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        CALL init_trace() 
     75    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 
     85          CALL init_trace() 
     86       END IF 
    8587    END IF 
    8688    !$OMP END MASTER 
Note: See TracChangeset for help on using the changeset viewer.