Changes between Initial Version and Version 1 of Ticket #682


Ignore:
Timestamp:
08/25/15 20:00:31 (9 years ago)
Author:
arango
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #682

    • Property Reporter changed from kate to arango
    • Property ResolutionFixed
    • Property Status newclosed
    • Property Summary profile reportProfile Report
    • Property Type bugdefect
  • Ticket #682 – Description

    initial v1  
    1 The profile report I used to get has gone away unless I make this change:
     1The routines '''wclock_on''' and '''wclock_off''' (t'''imers.F''') fail to report the profile timings in distributed-memory applications (MPI).  This has been broken for awhile since the OpenMP directives were re-worked (see src:ticket:552). In that update the '''numthreads''' was modified in MPI to have the number of distributed nodes:
    22
    33{{{
    4 --- ../roms/trunk/ROMS/Utility/timers.F   2015-03-26 10:56:13.819755622 -0800
    5 +++ ROMS/Utility/timers.F   2015-06-25 10:04:26.946864845 -0800
    6 @@ -176,7 +176,7 @@
    7              END DO
    8            END IF
    9          END DO
    10 -        IF (thread_count.eq.numthreads) THEN
    11 +!        IF (thread_count.eq.numthreads) THEN
    12            thread_count=0
    13  #ifdef DISTRIBUTE
    14            op_handle(0:Nregion)='SUM'
    15 @@ -269,7 +302,7 @@
    16    60      FORMAT (/,' All percentages are with respect to total time =',&
    17       &            5x,f12.3)
    18  #endif
    19 -        END IF
    20 +!        END IF
    21  !$OMP END CRITICAL (FINALIZE_WCLOCK)
    22        END IF
    23        RETURN
    24 }}}There's probably a better fix if you want to keep OpenMP.
     4      CALL mpi_comm_size (OCN_COMM_WORLD, numthreads, MyError)
     5}}}
     6
     7This affected the logic in '''wclock_on''' and '''wclock_off''' in MPI applications, which needs '''numthreads = 1'''.  To correct this problem, both routines were modified to have:
     8
     9{{{
     10!
     11!  Set number of subdivisions, same as for global reductions.
     12!
     13#ifdef MPI
     14      NSUB=1
     15#else
     16      NSUB=numthreads
     17#endif
     18}}}
     19
     20then, we use '''NSUB''' instead of '''numthreads''' in the conditional statement in '''wclock_on''':
     21
     22{{{
     23       IF (thread_count.eq.NSUB) thread_count=0
     24}}}
     25
     26
     27and in '''wclock_off''':
     28
     29{{{
     30        IF (thread_count.eq.NSUB) THEN
     31          thread_count=0
     32          ...
     33        END IF
     34}}}
     35
     36I also improved the time profile report in nested grid applications.
     37
     38Many thanks to Kate Hedstrom for reminding me about this problem.