<p><b>ringler@lanl.gov</b> 2010-12-09 11:53:09 -0700 (Thu, 09 Dec 2010)</p><p>add branch for profiling ocean model wall clock time<br>
</p><hr noshade><pre><font color="gray">Copied: branches/ocean_projects/profiling (from rev 636, trunk/mpas)
Modified: branches/ocean_projects/profiling/src/core_ocean/Registry
===================================================================
--- trunk/mpas/src/core_ocean/Registry        2010-12-04 19:42:05 UTC (rev 636)
+++ branches/ocean_projects/profiling/src/core_ocean/Registry        2010-12-09 18:53:09 UTC (rev 637)
@@ -7,6 +7,7 @@
namelist integer sw_model config_ntimesteps 7500
namelist integer sw_model config_output_interval 500
namelist integer sw_model config_stats_interval 100
+namelist integer sw_model config_StdOutDump 1
namelist character io config_input_name grid.nc
namelist character io config_output_name output.nc
namelist character io config_restart_name restart.nc
Modified: branches/ocean_projects/profiling/src/core_ocean/module_mpas_core.F
===================================================================
--- trunk/mpas/src/core_ocean/module_mpas_core.F        2010-12-04 19:42:05 UTC (rev 636)
+++ branches/ocean_projects/profiling/src/core_ocean/module_mpas_core.F        2010-12-09 18:53:09 UTC (rev 637)
@@ -115,7 +115,10 @@
! During integration, time level 1 stores the model state at the beginning of the
! time step, and time level 2 stores the state advanced dt in time by timestep(...)
do itimestep = 1,ntimesteps
- write(0,*) 'Doing timestep ', itimestep
+ if(mod(itimestep,config_StdOutDump).eq.0) then
+ write(0,*) 'Doing timestep ', itimestep
+ call timer_write()
+ endif
call timer_start("time integration")
call mpas_timestep(domain, itimestep, dt)
call timer_stop("time integration")
Modified: branches/ocean_projects/profiling/src/core_ocean/module_time_integration.F
===================================================================
--- trunk/mpas/src/core_ocean/module_time_integration.F        2010-12-04 19:42:05 UTC (rev 636)
+++ branches/ocean_projects/profiling/src/core_ocean/module_time_integration.F        2010-12-09 18:53:09 UTC (rev 637)
@@ -5,6 +5,7 @@
use constants
use dmpar
use vector_reconstruction
+ use timer
contains
@@ -26,6 +27,7 @@
type (dm_info) :: dminfo
type (block_type), pointer :: block
+ call timer_start("timestep_rk4")
if (trim(config_time_integration) == 'RK4') then
call rk4(domain, dt)
else
@@ -34,7 +36,10 @@
write(0,*) 'Currently, only ''RK4'' is supported.'
call dmpar_abort(dminfo)
end if
+ call timer_stop("timestep_rk4")
+
+ call timer_start("timestep_NaNCheck")
block => domain % blocklist
do while (associated(block))
block % state % time_levs(2) % state % xtime % scalar &
@@ -47,6 +52,7 @@
block => block % next
end do
+ call timer_stop("timestep_NaNCheck")
end subroutine timestep
@@ -75,10 +81,12 @@
real (kind=RKIND), dimension(4) :: rk_weights, rk_substep_weights
+ call timer_start("timestep_rk4_allocateState")
block => domain % blocklist
call allocate_state(provis, &
block % mesh % nCells, block % mesh % nEdges, block % mesh % maxEdges, block % mesh % maxEdges2, &
block % mesh % nVertices, block % mesh % vertexDegree, block % mesh % nVertLevels )
+ call timer_stop("timestep_rk4_allocateState")
!
! Initialize time_levs(2) with state at current time
@@ -86,6 +94,7 @@
! Couple tracers time_levs(2) with h in time-levels
! Initialize RK weights
!
+ call timer_start("timestep_rk4_copyState")
block => domain % blocklist
do while (associated(block))
@@ -113,13 +122,17 @@
rk_substep_weights(3) = dt
rk_substep_weights(4) = 0.
+ call timer_stop("timestep_rk4_copyState")
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! BEGIN RK loop
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ call timer_start("timestep_rk4_stage")
do rk_step = 1, 4
+
! --- update halos for diagnostic variables
-
+ call timer_start("timestep_rk4_stage_dmpar1")
block => domain % blocklist
do while (associated(block))
call dmpar_exch_halo_field2dReal(domain % dminfo, provis % pv_edge % array(:,:), &
@@ -137,9 +150,11 @@
block => block % next
end do
+ call timer_stop("timestep_rk4_stage_dmpar1")
! --- compute tendencies
+ call timer_start("timestep_rk4_stage_tendencies")
block => domain % blocklist
do while (associated(block))
call compute_tend(block % tend, provis, block % mesh)
@@ -147,9 +162,10 @@
call enforce_boundaryEdge(block % tend, block % mesh)
block => block % next
end do
+ call timer_stop("timestep_rk4_stage_tendencies")
! --- update halos for prognostic variables
-
+ call timer_start("timestep_rk4_stage_dmpar2")
block => domain % blocklist
do while (associated(block))
call dmpar_exch_halo_field2dReal(domain % dminfo, block % tend % u % array(:,:), &
@@ -163,9 +179,11 @@
block % parinfo % cellsToSend, block % parinfo % cellsToRecv)
block => block % next
end do
+ call timer_stop("timestep_rk4_stage_dmpar2")
! --- compute next substep state
+ call timer_start("timestep_rk4_stage_provis")
if (rk_step < 4) then
block => domain % blocklist
do while (associated(block))
@@ -187,15 +205,17 @@
if (config_test_case == 1) then ! For case 1, wind field should be fixed
provis % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
end if
+ call timer_start("timestep_rk4_stage_provis_diagnostics")
call compute_solve_diagnostics(dt, provis, block % mesh)
+ call timer_stop("timestep_rk4_stage_provis_diagnostics")
block => block % next
end do
end if
+ call timer_stop("timestep_rk4_stage_provis")
-
!--- accumulate update (for RK4)
-
+ call timer_start("timestep_rk4_stage_accumulate")
block => domain % blocklist
do while (associated(block))
block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(2) % state % u % array(:,:) &
@@ -213,8 +233,10 @@
block => block % next
end do
+ call timer_stop("timestep_rk4_stage_accumulate")
end do
+ call timer_stop("timestep_rk4_stage")
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! END RK loop
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
</font>
</pre>