From 080d077a18c25b370d780a13190b2baeb35566b1 Mon Sep 17 00:00:00 2001 From: gabrielkheisa Date: Mon, 14 Nov 2022 18:24:44 +0700 Subject: [PATCH] fix program --- tugas3.f90 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tugas3.f90 b/tugas3.f90 index 1c3ecad..72f4c23 100644 --- a/tugas3.f90 +++ b/tugas3.f90 @@ -3,16 +3,16 @@ use omp_lib implicit real(8)(a-h,o-z) parameter (n=4096) - real(8) a(n,n),c(n,n) + real(8) a(n,n), c(n,n) real(4) b(n,n) real*8 t1, t2 a=0.0d0 call random_number(b) call random_number(c) - write(6,50) 'Matrix Size = ', n + write(6,50) ' Matrix Size = ', n 50 format(1x,a,i5) t1 = omp_get_wtime() - !$OMP parallel do + !$OMP PARALLEL DO do j=1,n do k=1,n do i=1,n @@ -20,9 +20,10 @@ use omp_lib end do end do end do + !$OMP END PARALLEL DO t2 = omp_get_wtime() - !$OMP end parallel do - write(6,60) 'Execution Time = ', t2-t1, ' sec','A(n,n) = ',a(n,n) + write(6, 60) ' Execution Time = ',t2-t1,' sec',' A(n,n) = ',a(n,n) 60 format(1x,a,f10.3,a,1x,a,d24.15) stop + end \ No newline at end of file