Skip to content

Commit

Permalink
resources: Update ROI (#54)
Browse files Browse the repository at this point in the history
- workbegin now is called after timer_start
- workend is called before timer_end
  • Loading branch information
Harshil2107 authored Oct 7, 2024
1 parent 6853781 commit 3c7c110
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 44 deletions.
9 changes: 5 additions & 4 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/BT/bt.f90
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ program BT
call timer_clear(i)
end do

call timer_start(1)

#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif

call timer_start(1)

do step = 1, niter

if (mod(step, 20) .eq. 0 .or. &
Expand All @@ -165,12 +165,13 @@ program BT

end do

call timer_stop(1)

#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif

call timer_stop(1)


tmax = timer_read(1)
call verify(niter, class, verified)

Expand Down
8 changes: 5 additions & 3 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/CG/cg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ program cg
write (*, 2000) timer_read(T_init)
2000 format(' Initialization time = ',f15.3,' seconds')

call timer_start( T_bench )

#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif
call timer_start( T_bench )

!---------------------------------------------------------------------
!---->
Expand Down Expand Up @@ -341,12 +342,13 @@ program cg

enddo ! end of main iter inv pow meth

call timer_stop( T_bench )

#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif

call timer_stop( T_bench )


!---------------------------------------------------------------------
! End of timed section
!---------------------------------------------------------------------
Expand Down
8 changes: 5 additions & 3 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/EP/ep.f90
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ program EMBAR
if (timers_enabled) call timer_clear(3)
!$omp end parallel

call timer_start(1)

#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif
call timer_start(1)

t1 = a
call vranlc(0, t1, a, x)
Expand Down Expand Up @@ -218,12 +219,13 @@ program EMBAR
gc = gc + q(i)
160 continue

call timer_stop(1)

#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif

call timer_stop(1)


tm = timer_read(1)
call verify(m, sx, sy, gc, verified, classv)

Expand Down
9 changes: 6 additions & 3 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/FT/ft.f90
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ program ft
do i = 1, t_max
call timer_clear(i)
end do

call timer_start(T_total)

#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif

call timer_start(T_total)
if (timers_enabled) call timer_start(T_setup)

call compute_indexmap(twiddle, dims(1), dims(2), dims(3))
Expand Down Expand Up @@ -133,12 +135,13 @@ program ft

call verify(nx, ny, nz, niter, verified, class)

call timer_stop(t_total)

#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif

call timer_stop(t_total)


total_time = timer_read(t_total)
if( total_time .ne. 0. ) then
mflops = 1.0d-6*ntotal_f * &
Expand Down
12 changes: 6 additions & 6 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/IS/is.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,12 +957,12 @@ int main( int argc, char **argv )

if( CLASS != 'S' ) printf( "\n iteration\n" );

#ifdef M5_ANNOTATION
m5_work_begin_interface_();
#endif
/* Start timer */
timer_start( 0 );

#ifdef M5_ANNOTATION
m5_work_begin_interface_();
#endif

/* This is the main iteration */
for( iteration=1; iteration<=MAX_ITERATIONS; iteration++ )
Expand All @@ -971,13 +971,13 @@ int main( int argc, char **argv )
rank( iteration );
}

#ifdef M5_ANNOTATION
m5_work_end_interface_();
#endif

/* End of timing, obtain maximum time of all processors */
timer_stop( 0 );

#ifdef M5_ANNOTATION
m5_work_end_interface_();
#endif

timecounter = timer_read( 0 );
/* This tests that keys are in sequence: sorting of last ranked key seq
Expand Down
10 changes: 6 additions & 4 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/LU/ssor.f90
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ subroutine ssor(niter)
call timer_clear(i)
end do


call timer_start(1)

if (niter > 1) then
#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif
endif

call timer_start(1)

!---------------------------------------------------------------------
! the timestep loop
!---------------------------------------------------------------------
Expand Down Expand Up @@ -244,14 +245,15 @@ subroutine ssor(niter)

end do
900 continue

call timer_stop(1)

if (niter > 1) then
#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif
endif

call timer_stop(1)

maxtime= timer_read(1)


Expand Down
14 changes: 9 additions & 5 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/LU/ssor_doac.f90
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ subroutine ssor(niter)
call timer_clear(i)
end do


call timer_start(1)
if (niter > 1) then
#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif

call timer_start(1)

endif
!---------------------------------------------------------------------
! the timestep loop
!---------------------------------------------------------------------
Expand Down Expand Up @@ -231,12 +232,15 @@ subroutine ssor(niter)

end do
900 continue

call timer_stop(1)

if (niter > 1) then
#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif
endif

call timer_stop(1)


maxtime= timer_read(1)

Expand Down
15 changes: 10 additions & 5 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/LU/ssor_hp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ subroutine ssor(niter)
call timer_clear(i)
end do

#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif

call timer_start(1)

if (niter > 1) then
#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif
endif
!---------------------------------------------------------------------
! the timestep loop
!---------------------------------------------------------------------
Expand Down Expand Up @@ -232,11 +234,14 @@ subroutine ssor(niter)
end do
900 continue

call timer_stop(1)

if (niter > 1) then
#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif
endif

call timer_stop(1)


maxtime= timer_read(1)

Expand Down
10 changes: 6 additions & 4 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/MG/mg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,13 @@ program mg
call timer_clear(i)
end do


call timer_start(T_bench)

#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif

call timer_start(T_bench)

if (timeron) call timer_start(T_resid2)
call resid(u,v,r,n1,n2,n3,a,k)
if (timeron) call timer_stop(T_resid2)
Expand All @@ -264,12 +265,13 @@ program mg

call norm2u3(r,n1,n2,n3,rnm2,rnmu,nx(lt),ny(lt),nz(lt))

call timer_stop(T_bench)

#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif

call timer_stop(T_bench)


t = timer_read(T_bench)

verified = .FALSE.
Expand Down
10 changes: 6 additions & 4 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/SP/sp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,13 @@ program SP
call timer_clear(i)
end do


call timer_start(1)

#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif

call timer_start(1)

do step = 1, niter

if (mod(step, 20) .eq. 0 .or. step .eq. 1) then
Expand All @@ -167,12 +168,13 @@ program SP

end do

call timer_stop(1)

#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif

call timer_stop(1)


tmax = timer_read(1)
call verify(niter, class, verified)

Expand Down
10 changes: 7 additions & 3 deletions src/npb-24.04-imgs/npb-with-roi/NPB/NPB3.4-OMP/UA/ua.f90
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,13 @@ program ua
do i = 1, t_last
if (i.ne.t_init) call timer_clear(i)
end do

call timer_start(1)

#ifdef M5_ANNOTATION
call m5_work_begin_interface
#endif
call timer_start(1)

endif

!.......advance the convection step
Expand Down Expand Up @@ -241,12 +244,13 @@ program ua
nelt_tot = nelt_tot + dble(nelt)
end do

call timer_stop(1)

#ifdef M5_ANNOTATION
call m5_work_end_interface
#endif

call timer_stop(1)


tmax = timer_read(1)
call verify(class, verified)

Expand Down

0 comments on commit 3c7c110

Please sign in to comment.