Skip to content

Commit 095d890

Browse files
committed
Add NVTX ranges for initialization and finalization
1 parent ce5c8af commit 095d890

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/simulation/p_main.fpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,24 @@ program p_main
3838

3939
call system_clock(COUNT=cpu_start, COUNT_RATE=cpu_rate)
4040

41+
call nvtxStartRange("INIT")
42+
4143
!Initialize MPI
44+
call nvtxStartRange("INIT-MPI")
4245
call s_initialize_mpi_domain()
46+
call nvtxEndRange
4347

4448
!Initialize Modules
49+
call nvtxStartRange("INIT-MODULES")
4550
call s_initialize_modules()
51+
call nvtxEndRange
4652

4753
allocate (proc_time(0:num_procs - 1))
4854
allocate (io_proc_time(0:num_procs - 1))
4955

56+
call nvtxStartRange("INIT-GPU-VARS")
5057
call s_initialize_gpu_vars()
58+
call nvtxEndRange
5159

5260
! Setting the time-step iterator to the first time-step
5361
if (cfl_dt) then
@@ -63,6 +71,8 @@ program p_main
6371
finaltime = t_step_stop*dt
6472
end if
6573

74+
call nvtxEndRange ! INIT
75+
6676
call nvtxStartRange("SIMULATION-TIME-MARCH")
6777
! Time-stepping Loop =======================================================
6878
do
@@ -102,6 +112,8 @@ program p_main
102112

103113
deallocate (proc_time, io_proc_time)
104114

115+
call nvtxStartRange("FINALIZE-MODULES")
105116
call s_finalize_modules()
117+
call nvtxEndRange
106118

107119
end program p_main

0 commit comments

Comments
 (0)