| 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 | |
| | 7 | This 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 | |
| | 20 | then, 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 | |
| | 27 | and in '''wclock_off''': |
| | 28 | |
| | 29 | {{{ |
| | 30 | IF (thread_count.eq.NSUB) THEN |
| | 31 | thread_count=0 |
| | 32 | ... |
| | 33 | END IF |
| | 34 | }}} |
| | 35 | |
| | 36 | I also improved the time profile report in nested grid applications. |
| | 37 | |
| | 38 | Many thanks to Kate Hedstrom for reminding me about this problem. |