SCALE-RM
Data Types | Functions/Subroutines
scale_prof Module Reference

module profiler More...

Functions/Subroutines

subroutine, public prof_setup
 
subroutine, public prof_finalize
 
subroutine, public prof_setprefx (prefxname)
 
subroutine, public prof_rapstart (rapname_base, level, disable_barrier)
 Start raptime. More...
 
subroutine, public prof_rapend (rapname_base, level, disable_barrier)
 Save raptime. More...
 
subroutine, public prof_rapreport
 Report raptime. More...
 
integer function get_grpid (rapname)
 Get group ID. More...
 

Detailed Description

module profiler

Description
Time counter & FLOP counter(PAPI) toolbox
Author
Team SCALE
NAMELIST
  • PARAM_PROF
    nametypedefault valuecomment
    PROF_RAP_LEVEL integer 2
    PROF_MPI_BARRIER logical .false.

History Output
No history output

Function/Subroutine Documentation

◆ prof_setup()

subroutine, public scale_prof::prof_setup

Definition at line 107 of file scale_prof.F90.

107  use scale_prc, only: &
108  prc_abort
109  implicit none
110 
111  namelist / param_prof / &
112  prof_rap_level, &
113  prof_mpi_barrier
114 
115  integer :: ierr
116 
117  log_newline
118  log_info("PROF_setup",*) 'Setup'
119 
120  !--- read namelist
121  rewind(io_fid_conf)
122  read(io_fid_conf,nml=param_prof,iostat=ierr)
123  if( ierr < 0 ) then !--- missing
124  log_info("PROF_setup",*) 'Not found namelist. Default used.'
125  elseif( ierr > 0 ) then !--- fatal error
126  log_error("PROF_setup",*) 'Not appropriate names in namelist PARAM_PROF. Check!'
127  call prc_abort
128  endif
129  log_nml(param_prof)
130 
131  log_newline
132  log_info("PROF_setup",*) 'Rap output level = ', prof_rap_level
133  log_info("PROF_setup",*) 'Add MPI_barrier in every rap? = ', prof_mpi_barrier
134 
135  prof_prefix = ''
136 
137  return

References scale_io::io_fid_conf, and scale_prc::prc_abort().

Referenced by mod_rm_driver::rm_driver(), mod_rm_prep::rm_prep(), and scale::scale_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prof_finalize()

subroutine, public scale_prof::prof_finalize

Definition at line 141 of file scale_prof.F90.

141 
142  prof_rap_level = 2
143  prof_mpi_barrier = .false.
144 #ifdef PAPI
145  prof_papi_flops = 0
146  prof_papi_real_time = 0.0
147  prof_papi_proc_time = 0.0
148  prof_papi_mflops = 0.0
149 #endif
150 
151  prof_rapnmax = 0
152  prof_grpnmax = 0
153 
154  return

Referenced by mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

Here is the caller graph for this function:

◆ prof_setprefx()

subroutine, public scale_prof::prof_setprefx ( character(len=*), intent(in)  prefxname)
Parameters
[in]prefxnameprefix

Definition at line 160 of file scale_prof.F90.

160  implicit none
161 
162  character(len=*), intent(in) :: prefxname
163 
164  !---------------------------------------------------------------------------
165 
166  prof_prefix = prefxname
167 
168  return

Referenced by mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

Here is the caller graph for this function:

◆ prof_rapstart()

subroutine, public scale_prof::prof_rapstart ( character(len=*), intent(in)  rapname_base,
integer, intent(in), optional  level,
logical, intent(in), optional  disable_barrier 
)

Start raptime.

Parameters
[in]rapname_basename of item
[in]levellevel of item
[in]disable_barrierdisable barrier if .true.

Definition at line 174 of file scale_prof.F90.

174  use scale_prc, only: &
175  prc_mpibarrier, &
177  implicit none
178 
179  character(len=*), intent(in) :: rapname_base
180  integer, intent(in), optional :: level
181  logical, intent(in), optional :: disable_barrier
182 
183  character(len=H_SHORT) :: rapname
184 
185  integer :: id
186  integer :: level_
187  integer :: tn
188  integer :: i
189  logical :: disable_barrier_
190  !$ integer :: omp_get_thread_num
191  !---------------------------------------------------------------------------
192 
193  tn = 0
194  !$ tn = omp_get_thread_num()
195  if ( tn > 0 ) return
196 
197  if ( present(level) ) then
198  level_ = level
199  else
200  level_ = prof_default_rap_level
201  endif
202 
203  if ( present(disable_barrier) ) then
204  disable_barrier_ = disable_barrier
205  else
206  disable_barrier_ = .false.
207  endif
208 
209  if( level_ > prof_rap_level ) return
210 
211  if ( len_trim(prof_prefix) > 0 ) then
212  rapname = trim(prof_prefix)//" "//trim(rapname_base)
213  else
214  rapname = rapname_base
215  end if
216 
217  id = get_rapid( rapname, level_ )
218 
219  prof_rapcnt(id) = prof_rapcnt(id) + 1
220 
221  if ( prof_rapcnt(id) > 1 ) return
222 
223  if ( ( .not. disable_barrier_ ) .and. prof_mpi_barrier ) call prc_mpibarrier
224 
225  prof_raptstr(id) = prc_mpitime()
226  prof_rapnstr(id) = prof_rapnstr(id) + 1
227 
228  !LOG_INFO("PROF_rapstart",'(1x,A,I8)') rapname, PROF_rapnstr(id)
229  !call flush(IO_FID_LOG)
230 
231 #ifdef FAPP
232  i = index(rapname," ")
233  if ( i == 0 .or. i > len_trim(rapname)) then
234  call fapp_start( rapname, id, level_ )
235  else
236  call fapp_start( rapname(1:i-1)//"_"//trim(rapname(i+1:)), id, level_ )
237  end if
238 #endif
239 
240  return

References scale_prc::prc_mpibarrier(), and scale_prc::prc_mpitime().

Referenced by mod_atmos_driver::atmos_driver_calc_tendency(), mod_atmos_driver::atmos_driver_calc_tendency_from_sflux(), mod_atmos_driver::atmos_driver_setup(), mod_atmos_driver::atmos_driver_update(), scale_atmos_dyn::atmos_dyn(), scale_atmos_dyn_common::atmos_dyn_divergence(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_apply_numfilter(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_numfilter_flux(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_numfilter_flux_q(), scale_atmos_dyn_tinteg_large_rk3::atmos_dyn_tinteg_large_rk3(), scale_atmos_dyn_tinteg_short_rk11s8o::atmos_dyn_tinteg_short_rk11s8o(), scale_atmos_dyn_tinteg_short_rk3::atmos_dyn_tinteg_short_rk3(), scale_atmos_dyn_tinteg_short_rk4::atmos_dyn_tinteg_short_rk4(), scale_atmos_dyn_tinteg_short_rk7s6o::atmos_dyn_tinteg_short_rk7s6o(), scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), scale_atmos_dyn_tstep_short_fvm_hevi::atmos_dyn_tstep_short_fvm_hevi(), scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_negative_fixer(), scale_atmos_phy_cp_kf::atmos_phy_cp_kf_tendency(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_electric_field(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_neutralization_f2013(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_neutralization_mg2001(), mod_atmos_phy_mp_driver::atmos_phy_mp_driver_calc_tendency(), scale_atmos_phy_mp_kessler::atmos_phy_mp_kessler_adjustment(), scale_atmos_phy_mp_common::atmos_phy_mp_negative_fixer(), scale_atmos_phy_mp_common::atmos_phy_mp_saturation_adjustment_3d(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_crg_qtrc2qhyd(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_tendency(), scale_atmos_phy_mp_tomita08::atmos_phy_mp_tomita08_adjustment(), scale_atmos_phy_rd_mstrnx::atmos_phy_rd_mstrnx_flux(), mod_atmos_driver::atmos_surface_get(), mod_atmos_driver::atmos_surface_set(), mod_atmos_vars::atmos_vars_calc_diagnostics(), mod_atmos_vars::atmos_vars_history(), mod_atmos_vars::atmos_vars_history_setpres(), mod_atmos_vars::atmos_vars_restart_check(), mod_atmos_vars::atmos_vars_restart_close(), mod_atmos_vars::atmos_vars_restart_create(), mod_atmos_vars::atmos_vars_restart_def_var(), mod_atmos_vars::atmos_vars_restart_enddef(), mod_atmos_vars::atmos_vars_restart_open(), mod_atmos_vars::atmos_vars_restart_read(), mod_atmos_vars::atmos_vars_restart_write(), scale_debug::check(), scale_comm_cartesc_nest::comm_cartesc_nest_nestdown_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_nestdown_send(), scale_comm_cartesc_nest::comm_cartesc_nest_recvwait_issue_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_recvwait_issue_send(), scale_comm_cartesc_nest::comm_cartesc_nest_test_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_test_send(), scale_comm_icoa::comm_data_transfer_dp(), scale_comm_icoa::comm_data_transfer_nopl(), scale_comm_icoa::comm_data_transfer_sp(), scale_comm_icoa::comm_var_dp(), scale_comm_icoa::comm_var_sp(), mod_da_driver::da_driver_update(), scale_file::file_add_associatedvariable(), scale_file_cartesc::file_cartesc_close(), scale_file_cartesc::file_cartesc_create(), scale_file_cartesc::file_cartesc_def_var(), scale_file_cartesc::file_cartesc_enddef(), scale_file_cartesc::file_cartesc_flush(), scale_file_cartesc::file_cartesc_open(), scale_file_cartesc::file_cartesc_put_globalattributes(), scale_file_cartesc::file_cartesc_read_1d(), scale_file_cartesc::file_cartesc_read_auto_2d(), scale_file_cartesc::file_cartesc_read_auto_3d(), scale_file_cartesc::file_cartesc_read_var_2d(), scale_file_cartesc::file_cartesc_read_var_3d(), scale_file_cartesc::file_cartesc_read_var_4d(), scale_file_cartesc::file_cartesc_write_var_1d(), scale_file_cartesc::file_cartesc_write_var_2d(), scale_file_cartesc::file_cartesc_write_var_3d(), scale_file_cartesc::file_cartesc_write_var_3d_t(), scale_file_cartesc::file_cartesc_write_var_4d(), scale_file::file_create(), scale_file::file_def_axis(), scale_file::file_get_dimlength(), scale_file_history_cartesc::file_history_cartesc_truncate_3d(), scale_file_history::file_history_in_0d(), scale_file_history::file_history_in_1d(), scale_file_history::file_history_in_2d(), scale_file_history::file_history_in_3d(), scale_file_history::file_history_reg(), scale_file_history::file_history_write(), scale_file::file_set_option(), scale_interp::interp_factor2d_linear_latlon(), scale_interp::interp_factor2d_linear_xy(), scale_interp::interp_factor2d_weight(), scale_interp::interp_factor3d_linear_latlon(), scale_interp::interp_factor3d_linear_xy(), scale_interp::interp_factor3d_weight(), scale_interp::interp_interp2d(), scale_interp::interp_interp3d(), scale_interp_vert::interp_vert_z2xi(), mod_land_driver::land_driver_calc_tendency(), mod_land_driver::land_driver_update(), mod_land_driver::land_surface_get(), mod_land_driver::land_surface_set(), mod_land_vars::land_vars_history(), mod_land_vars::land_vars_restart_close(), mod_land_vars::land_vars_restart_create(), mod_land_vars::land_vars_restart_def_var(), mod_land_vars::land_vars_restart_enddef(), mod_land_vars::land_vars_restart_open(), mod_land_vars::land_vars_restart_read(), mod_land_vars::land_vars_restart_write(), mod_mkinit::mkinit(), scale_monitor::monitor_put_2d(), scale_monitor::monitor_put_3d(), scale_monitor::monitor_reg(), scale_monitor::monitor_write(), mod_ocean_driver::ocean_driver_calc_tendency(), mod_ocean_driver::ocean_driver_update(), mod_ocean_driver::ocean_surface_get(), mod_ocean_driver::ocean_surface_set(), mod_ocean_vars::ocean_vars_history(), mod_ocean_vars::ocean_vars_restart_close(), mod_ocean_vars::ocean_vars_restart_create(), mod_ocean_vars::ocean_vars_restart_def_var(), mod_ocean_vars::ocean_vars_restart_enddef(), mod_ocean_vars::ocean_vars_restart_open(), mod_ocean_vars::ocean_vars_restart_read(), mod_ocean_vars::ocean_vars_restart_write(), mod_mkinit::read_sounding(), mod_realinput::realinput_surface(), mod_rm_driver::restart_read(), mod_rm_driver::rm_driver(), mod_rm_prep::rm_prep(), scale::scale_init(), scale_statistics::statistics_detail_2d(), scale_statistics::statistics_detail_3d(), scale_statistics::statistics_horizontal_max_2d(), scale_statistics::statistics_horizontal_max_3d(), scale_statistics::statistics_horizontal_mean_2d(), scale_statistics::statistics_horizontal_mean_3d(), scale_statistics::statistics_horizontal_min_2d(), scale_statistics::statistics_horizontal_min_3d(), scale_statistics::statistics_total_2d(), scale_statistics::statistics_total_3d(), mod_urban_driver::urban_driver_calc_tendency(), mod_urban_driver::urban_driver_update(), mod_urban_driver::urban_surface_get(), mod_urban_driver::urban_surface_set(), mod_urban_vars::urban_vars_history(), mod_urban_vars::urban_vars_restart_close(), mod_urban_vars::urban_vars_restart_create(), mod_urban_vars::urban_vars_restart_def_var(), mod_urban_vars::urban_vars_restart_enddef(), mod_urban_vars::urban_vars_restart_open(), mod_urban_vars::urban_vars_restart_read(), mod_urban_vars::urban_vars_restart_write(), scale_debug::valcheck_1d(), scale_debug::valcheck_2d(), and scale_debug::valcheck_3d().

Here is the call graph for this function:

◆ prof_rapend()

subroutine, public scale_prof::prof_rapend ( character(len=*), intent(in)  rapname_base,
integer, intent(in), optional  level,
logical, intent(in), optional  disable_barrier 
)

Save raptime.

Parameters
[in]rapname_basename of item
[in]levellevel of item
[in]disable_barrierdisable barrier if .true.

Definition at line 246 of file scale_prof.F90.

246  use scale_prc, only: &
247  prc_mpibarrier, &
249  implicit none
250 
251  character(len=*), intent(in) :: rapname_base
252  integer, intent(in), optional :: level
253  logical, intent(in), optional :: disable_barrier
254 
255  character(len=H_SHORT) :: rapname
256 
257  integer :: id
258  integer :: level_
259  integer :: tn
260  integer :: i
261  logical :: disable_barrier_
262  !$ integer :: omp_get_thread_num
263  !---------------------------------------------------------------------------
264 
265  tn = 0
266  !$ tn = omp_get_thread_num()
267  if ( tn > 0 ) return
268 
269  if ( present(level) ) then
270  if( level > prof_rap_level ) return
271  endif
272 
273  if ( len_trim(prof_prefix) > 0 ) then
274  rapname = trim(prof_prefix)//" "//trim(rapname_base)
275  else
276  rapname = rapname_base
277  end if
278 
279  if ( present(disable_barrier) ) then
280  disable_barrier_ = disable_barrier
281  else
282  disable_barrier_ = .false.
283  endif
284 
285 
286  level_ = -1
287  id = get_rapid( rapname, level_ )
288 
289  if( level_ > prof_rap_level ) return
290 
291  prof_rapcnt(id) = prof_rapcnt(id) - 1
292 
293  if ( prof_rapcnt(id) > 0 ) return
294 
295 #ifdef FAPP
296  i = index(rapname," ")
297  if ( i == 0 .or. i > len_trim(rapname)) then
298  call fapp_stop( rapname, id, level_ )
299  else
300  call fapp_stop( rapname(1:i-1)//"_"//trim(rapname(i+1:)), id, level_ )
301  end if
302 #endif
303 
304  prof_rapttot(id) = prof_rapttot(id) + ( prc_mpitime()-prof_raptstr(id) )
305  prof_rapnend(id) = prof_rapnend(id) + 1
306 
307  if ( ( .not. disable_barrier_ ) .and. prof_mpi_barrier ) call prc_mpibarrier
308 
309  return

References scale_prc::prc_mpibarrier(), and scale_prc::prc_mpitime().

Referenced by mod_atmos_driver::atmos_driver_calc_tendency(), mod_atmos_driver::atmos_driver_calc_tendency_from_sflux(), mod_atmos_driver::atmos_driver_setup(), mod_atmos_driver::atmos_driver_update(), scale_atmos_dyn::atmos_dyn(), scale_atmos_dyn_common::atmos_dyn_divergence(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_apply_numfilter(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_numfilter_flux(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_numfilter_flux_q(), scale_atmos_dyn_tinteg_large_rk3::atmos_dyn_tinteg_large_rk3(), scale_atmos_dyn_tinteg_short_rk11s8o::atmos_dyn_tinteg_short_rk11s8o(), scale_atmos_dyn_tinteg_short_rk3::atmos_dyn_tinteg_short_rk3(), scale_atmos_dyn_tinteg_short_rk4::atmos_dyn_tinteg_short_rk4(), scale_atmos_dyn_tinteg_short_rk7s6o::atmos_dyn_tinteg_short_rk7s6o(), scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), scale_atmos_dyn_tstep_short_fvm_hevi::atmos_dyn_tstep_short_fvm_hevi(), scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_negative_fixer(), scale_atmos_phy_cp_kf::atmos_phy_cp_kf_tendency(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_electric_field(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_neutralization_f2013(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_neutralization_mg2001(), mod_atmos_phy_mp_driver::atmos_phy_mp_driver_calc_tendency(), scale_atmos_phy_mp_kessler::atmos_phy_mp_kessler_adjustment(), scale_atmos_phy_mp_common::atmos_phy_mp_negative_fixer(), scale_atmos_phy_mp_common::atmos_phy_mp_saturation_adjustment_3d(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_crg_qtrc2qhyd(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_tendency(), scale_atmos_phy_mp_tomita08::atmos_phy_mp_tomita08_adjustment(), scale_atmos_phy_rd_mstrnx::atmos_phy_rd_mstrnx_flux(), mod_atmos_driver::atmos_surface_get(), mod_atmos_driver::atmos_surface_set(), mod_atmos_vars::atmos_vars_calc_diagnostics(), mod_atmos_vars::atmos_vars_history(), mod_atmos_vars::atmos_vars_history_setpres(), mod_atmos_vars::atmos_vars_restart_check(), mod_atmos_vars::atmos_vars_restart_close(), mod_atmos_vars::atmos_vars_restart_create(), mod_atmos_vars::atmos_vars_restart_def_var(), mod_atmos_vars::atmos_vars_restart_enddef(), mod_atmos_vars::atmos_vars_restart_open(), mod_atmos_vars::atmos_vars_restart_read(), mod_atmos_vars::atmos_vars_restart_write(), scale_debug::check(), scale_comm_cartesc_nest::comm_cartesc_nest_nestdown_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_nestdown_send(), scale_comm_cartesc_nest::comm_cartesc_nest_recvwait_issue_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_recvwait_issue_send(), scale_comm_cartesc_nest::comm_cartesc_nest_test_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_test_send(), scale_comm_icoa::comm_data_transfer_dp(), scale_comm_icoa::comm_data_transfer_nopl(), scale_comm_icoa::comm_data_transfer_sp(), scale_comm_icoa::comm_var_dp(), scale_comm_icoa::comm_var_sp(), mod_da_driver::da_driver_update(), scale_file::file_add_associatedvariable(), scale_file_cartesc::file_cartesc_close(), scale_file_cartesc::file_cartesc_create(), scale_file_cartesc::file_cartesc_def_var(), scale_file_cartesc::file_cartesc_enddef(), scale_file_cartesc::file_cartesc_flush(), scale_file_cartesc::file_cartesc_open(), scale_file_cartesc::file_cartesc_put_globalattributes(), scale_file_cartesc::file_cartesc_read_1d(), scale_file_cartesc::file_cartesc_read_auto_2d(), scale_file_cartesc::file_cartesc_read_auto_3d(), scale_file_cartesc::file_cartesc_read_var_2d(), scale_file_cartesc::file_cartesc_read_var_3d(), scale_file_cartesc::file_cartesc_read_var_4d(), scale_file_cartesc::file_cartesc_write_var_1d(), scale_file_cartesc::file_cartesc_write_var_2d(), scale_file_cartesc::file_cartesc_write_var_3d(), scale_file_cartesc::file_cartesc_write_var_3d_t(), scale_file_cartesc::file_cartesc_write_var_4d(), scale_file::file_create(), scale_file::file_def_axis(), scale_file::file_get_dimlength(), scale_file_history_cartesc::file_history_cartesc_truncate_3d(), scale_file_history::file_history_in_0d(), scale_file_history::file_history_in_1d(), scale_file_history::file_history_in_2d(), scale_file_history::file_history_in_3d(), scale_file_history::file_history_reg(), scale_file_history::file_history_write(), scale_file::file_set_option(), scale_interp::interp_factor2d_linear_latlon(), scale_interp::interp_factor2d_linear_xy(), scale_interp::interp_factor2d_weight(), scale_interp::interp_factor3d_linear_latlon(), scale_interp::interp_factor3d_linear_xy(), scale_interp::interp_factor3d_weight(), scale_interp::interp_interp2d(), scale_interp::interp_interp3d(), scale_interp_vert::interp_vert_z2xi(), mod_land_driver::land_driver_calc_tendency(), mod_land_driver::land_driver_update(), mod_land_driver::land_surface_get(), mod_land_driver::land_surface_set(), mod_land_vars::land_vars_history(), mod_land_vars::land_vars_restart_close(), mod_land_vars::land_vars_restart_create(), mod_land_vars::land_vars_restart_def_var(), mod_land_vars::land_vars_restart_enddef(), mod_land_vars::land_vars_restart_open(), mod_land_vars::land_vars_restart_read(), mod_land_vars::land_vars_restart_write(), mod_mkinit::mkinit(), scale_monitor::monitor_put_2d(), scale_monitor::monitor_put_3d(), scale_monitor::monitor_reg(), scale_monitor::monitor_write(), mod_ocean_driver::ocean_driver_calc_tendency(), mod_ocean_driver::ocean_driver_update(), mod_ocean_driver::ocean_surface_get(), mod_ocean_driver::ocean_surface_set(), mod_ocean_vars::ocean_vars_history(), mod_ocean_vars::ocean_vars_restart_close(), mod_ocean_vars::ocean_vars_restart_create(), mod_ocean_vars::ocean_vars_restart_def_var(), mod_ocean_vars::ocean_vars_restart_enddef(), mod_ocean_vars::ocean_vars_restart_open(), mod_ocean_vars::ocean_vars_restart_read(), mod_ocean_vars::ocean_vars_restart_write(), mod_mkinit::read_sounding(), mod_realinput::realinput_surface(), mod_rm_driver::restart_read(), mod_rm_driver::rm_driver(), mod_rm_prep::rm_prep(), scale::scale_finalize(), scale_statistics::statistics_detail_2d(), scale_statistics::statistics_detail_3d(), scale_statistics::statistics_horizontal_max_2d(), scale_statistics::statistics_horizontal_max_3d(), scale_statistics::statistics_horizontal_mean_2d(), scale_statistics::statistics_horizontal_mean_3d(), scale_statistics::statistics_horizontal_min_2d(), scale_statistics::statistics_horizontal_min_3d(), scale_statistics::statistics_total_2d(), scale_statistics::statistics_total_3d(), mod_urban_driver::urban_driver_calc_tendency(), mod_urban_driver::urban_driver_update(), mod_urban_driver::urban_surface_get(), mod_urban_driver::urban_surface_set(), mod_urban_vars::urban_vars_history(), mod_urban_vars::urban_vars_restart_close(), mod_urban_vars::urban_vars_restart_create(), mod_urban_vars::urban_vars_restart_def_var(), mod_urban_vars::urban_vars_restart_enddef(), mod_urban_vars::urban_vars_restart_open(), mod_urban_vars::urban_vars_restart_read(), mod_urban_vars::urban_vars_restart_write(), scale_debug::valcheck_1d(), scale_debug::valcheck_2d(), and scale_debug::valcheck_3d().

Here is the call graph for this function:

◆ prof_rapreport()

subroutine, public scale_prof::prof_rapreport

Report raptime.

Definition at line 315 of file scale_prof.F90.

315  use scale_prc, only: &
316  prc_mpitimestat, &
317  prc_timereorder, &
319  implicit none
320 
321  real(DP) :: avgvar(PROF_rapnlimit)
322  real(DP) :: maxvar(PROF_rapnlimit)
323  real(DP) :: minvar(PROF_rapnlimit)
324  integer :: maxidx(PROF_rapnlimit)
325  integer :: minidx(PROF_rapnlimit)
326 
327  integer :: idx(PROF_rapnlimit)
328  integer :: cnt
329 
330  integer :: id, gid
331  integer :: fid
332  integer :: i, j
333  !---------------------------------------------------------------------------
334 
335  do id = 1, prof_rapnmax
336  if ( prof_rapnstr(id) /= prof_rapnend(id) ) then
337  log_warn("PROF_rapreport",*) 'Mismatch Report',id,prof_rapname(id),prof_rapnstr(id),prof_rapnend(id)
338  endif
339  enddo
340 
341  log_newline
342  log_info("PROF_rapreport",'(1x,A,I2,A)') 'Computational Time Report (Rap level = ', prof_rap_level, ')'
343 
344  if ( io_log_allnode ) then ! report for each node
345 
346  do gid = 1, prof_rapnmax
347  cnt = 0
348  do id = 1, prof_rapnmax
349  if ( prof_raplevel(id) <= prof_rap_level &
350  .AND. prof_grpid(id) == gid ) then
351  cnt = cnt + 1
352  idx(cnt) = id
353  end if
354  end do
355  do j = 1, cnt-1
356  do i = j+1, cnt
357  if ( prof_raplevel(idx(i)) < prof_raplevel(idx(j)) .or. &
358  ( prof_raplevel(idx(i)) == prof_raplevel(idx(j)) &
359  .and. prof_rapname(idx(i)) < prof_rapname(idx(j)) ) ) then
360  id = idx(i)
361  idx(i) = idx(j)
362  idx(j) = id
363  end if
364  end do
365  end do
366  do i = 1, cnt
367  id = idx(i)
368  log_info_cont('(1x,2A,I2,A,F10.3,A,I9)') &
369  prof_rapname(id), ' lev=', prof_raplevel(id), &
370  ': T=',prof_rapttot(id),' N=',prof_rapnstr(id)
371  enddo
372  enddo
373 
374  else
375 
376  ! re-order
377  call prc_timereorder( prof_rapnlimit, prof_rapnmax, prof_rapttot, prof_rapname )
378 
379  call prc_mpitimestat( avgvar(1:prof_rapnmax), &
380  maxvar(1:prof_rapnmax), &
381  minvar(1:prof_rapnmax), &
382  maxidx(1:prof_rapnmax), &
383  minidx(1:prof_rapnmax), &
384  prof_rapttot(1:prof_rapnmax) )
385 
386  fid = -1
387  if ( io_log_suppress ) then ! report to STDOUT
388  if ( prc_ismaster ) then
389  write(*,*) 'INFO [PROF_rapreport] Computational Time Report'
390  fid = io_fid_stdout ! master node
391  endif
392  else
393  if ( io_l ) fid = io_fid_log
394  endif
395 
396  if ( fid > 0 ) then
397  do gid = 1, prof_rapnmax
398  cnt = 0
399  do id = 1, prof_rapnmax
400  if ( prof_raplevel(id) <= prof_rap_level &
401  .AND. prof_grpid(id) == gid ) then
402  cnt = cnt + 1
403  idx(cnt) = id
404  end if
405  end do
406  do j = 1, cnt-1
407  do i = j+1, cnt
408  if ( prof_raplevel(idx(i)) < prof_raplevel(idx(j)) .or. &
409  ( prof_raplevel(idx(i)) == prof_raplevel(idx(j)) &
410  .and. prof_rapname(idx(i)) < prof_rapname(idx(j)) ) ) then
411  id = idx(i)
412  idx(i) = idx(j)
413  idx(j) = id
414  end if
415  end do
416  end do
417  do i = 1, cnt
418  id = idx(i)
419  write(fid,'(1x,2A,I2,A,F10.3,2(A,F10.3,A,I6,A),A,I9)') &
420  prof_rapname(id), ' lev=', prof_raplevel(id), &
421  ': T(avg)=',avgvar(id), &
422  ', T(max)=',maxvar(id),'[',maxidx(id),']', &
423  ', T(min)=',minvar(id),'[',minidx(id),']', &
424  ', N=',prof_rapnstr(id)
425  end do
426  enddo
427  end if
428 
429  endif
430 
431  return

References get_grpid(), scale_io::io_fid_log, scale_io::io_fid_stdout, scale_io::io_l, scale_io::io_log_allnode, scale_io::io_log_suppress, scale_prc::prc_abort(), scale_prc::prc_ismaster, scale_prc::prc_mpitimestat(), scale_prc::prc_nprocs, and scale_prc::prc_timereorder().

Referenced by mod_rm_driver::rm_driver(), mod_rm_prep::rm_prep(), and scale::scale_finalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_grpid()

integer function scale_prof::get_grpid ( character(len=*), intent(in)  rapname)

Get group ID.

Parameters
[in]rapnamename of item

Definition at line 601 of file scale_prof.F90.

601  implicit none
602 
603  character(len=*), intent(in) :: rapname
604 
605  character(len=H_SHORT) :: grpname
606 
607  integer :: gid
608  integer :: idx
609  !---------------------------------------------------------------------------
610 
611  idx = index(rapname," ")
612  if ( idx > 1 ) then
613  grpname = rapname(1:idx-1)
614  else
615  grpname = rapname
616  endif
617 
618  do gid = 1, prof_grpnmax
619  if( grpname == prof_grpname(gid) ) return
620  enddo
621 
622  prof_grpnmax = prof_grpnmax + 1
623  gid = prof_grpnmax
624  prof_grpname(gid) = grpname
625 
626  return

Referenced by prof_rapreport().

Here is the caller graph for this function:
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_prc::prc_mpibarrier
subroutine, public prc_mpibarrier
Barrier MPI.
Definition: scale_prc.F90:828
scale_prc::prc_timereorder
subroutine, public prc_timereorder(rapnlimit, rapnmax, rapttot, rapname)
reorder rap time
Definition: scale_prc.F90:926
scale_prc::prc_mpitimestat
subroutine, public prc_mpitimestat(avgvar, maxvar, minvar, maxidx, minidx, var)
Calc global statistics for timer.
Definition: scale_prc.F90:865
scale_prc::prc_mpitime
real(dp) function, public prc_mpitime()
Get MPI time.
Definition: scale_prc.F90:843
scale_prc::prc_ismaster
logical, public prc_ismaster
master process in local communicator?
Definition: scale_prc.F90:92