Commit eead04dc authored by ulrich_y's avatar ulrich_y

iprint for speed test

parent 2c313036
...@@ -539,6 +539,7 @@ CONTAINS ...@@ -539,6 +539,7 @@ CONTAINS
integer i,j, u integer i,j, u
character,parameter :: cr = achar(13) character,parameter :: cr = achar(13)
character(len=*) msg character(len=*) msg
character(len=90) msg2
do j=1,size(args,1) do j=1,size(args,1)
! try function a bunch of times ! try function a bunch of times
call system_clock(cstart, count_rate=count_rate) call system_clock(cstart, count_rate=count_rate)
...@@ -561,11 +562,11 @@ CONTAINS ...@@ -561,11 +562,11 @@ CONTAINS
write(u,*) time write(u,*) time
write( * , 900, advance='no' ) cr, j, size(args,1), msg write(msg2, 900) j, size(args,1), msg
call iprint(msg2,-1)
enddo enddo
print*, write(msg2,901) size(args,1)/ttime(2)/1000., size(args,1)/ttime(1)/1000., int(ttime(2)/ttime(1))
print*,ttime call iprint(msg2,4)
write(*,901) msg, size(args,1)/ttime(2)/1000., size(args,1)/ttime(1)/1000., int(ttime(2)/ttime(1))
! Lets to another, fair comparison ! Lets to another, fair comparison
call system_clock(cstart, count_rate=count_rate) call system_clock(cstart, count_rate=count_rate)
...@@ -582,10 +583,12 @@ CONTAINS ...@@ -582,10 +583,12 @@ CONTAINS
call system_clock(cend, count_rate=count_rate) call system_clock(cend, count_rate=count_rate)
ttime(2) = real(cend-cstart)/real(count_rate,kind=prec) ttime(2) = real(cend-cstart)/real(count_rate,kind=prec)
write(*,901) msg, size(args,1)/ttime(2)/1000., size(args,1)/ttime(1)/1000., int(ttime(2)/ttime(1)) write(msg2,902) msg, size(args,1)/ttime(2)/1000., size(args,1)/ttime(1)/1000., int(ttime(2)/ttime(1))
call iprint(msg2,4)
900 FORMAT(a , 'Function ',i4,'/',i4,' for ',a) 900 FORMAT('Evaluating function ',i4,'/',i4,' for ',a)
901 format('Evaluating ',A,' using GiNaC at ',F9.2,'kG/s and handyG at ',F9.2,'kG/s (',I3,'x)') 901 format(' using GiNaC at ',F9.2,'kG/s and handyG at ',F9.2,'kG/s (',I3,'x)')
902 format('Evaluating ',A,' using GiNaC at ',F9.2,'kG/s and handyG at ',F9.2,'kG/s (',I3,'x)')
end subroutine end subroutine
subroutine do_timing_tests(n) subroutine do_timing_tests(n)
......
...@@ -34,6 +34,8 @@ contains ...@@ -34,6 +34,8 @@ contains
stop 1 stop 1
case(3) case(3)
print*,orange//'[WARN]'//norm//' '//trim(msg) print*,orange//'[WARN]'//norm//' '//trim(msg)
case(4)
print*,orange//'[INFO]'//norm//' '//trim(msg)
case(-1) case(-1)
write(*,'(a)',advance='no')' [ ]'//' '//trim(msg)//cr write(*,'(a)',advance='no')' [ ]'//' '//trim(msg)//cr
end select end select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment