This commit is contained in:
gabrielkheisa 2022-11-26 21:36:45 +07:00
parent 71d0f6e0ca
commit 3d34925fa8

View File

@ -40,7 +40,9 @@ C "use portlib" statement on the next line is for Visual fortran
C to use UNIX libraries. Please remove it if your system is UNIX. C to use UNIX libraries. Please remove it if your system is UNIX.
C ------------------- C -------------------
! use portlib ! use portlib
use omp_lib
IMPLICIT REAL*4(a-h,o-z) IMPLICIT REAL*4(a-h,o-z)
real*8 t1,t2
C C
C PARAMETER (mimax=513,mjmax=257,mkmax=257) C PARAMETER (mimax=513,mjmax=257,mkmax=257)
C PARAMETER (mimax=257,mjmax=129,mkmax=129) C PARAMETER (mimax=257,mjmax=129,mkmax=129)
@ -75,12 +77,15 @@ C
write(*,*) ' Measure the performance in 10000 times.' write(*,*) ' Measure the performance in 10000 times.'
C C
cpu0=dtime(time0) cpu0=dtime(time0)
t1=omp_get_wtime()
C C
C Jacobi iteration C Jacobi iteration
call jacobi(nn,gosa) call jacobi(nn,gosa)
C C
cpu1= dtime(time1) cpu1= dtime(time1)
t2=omp_get_wtime()
cpu = cpu1 cpu = cpu1
cpu = t2-t1
flop=real(kmax-2)*real(jmax-2)*real(imax-2)*34.0*real(nn) flop=real(kmax-2)*real(jmax-2)*real(imax-2)*34.0*real(nn)
xmflops2=flop/cpu*1.0e-6 xmflops2=flop/cpu*1.0e-6
write(*,*) ' MFLOPS:',xmflops2,' time(s):',cpu,gosa write(*,*) ' MFLOPS:',xmflops2,' time(s):',cpu,gosa