add parallelization line

This commit is contained in:
gabrielkheisa 2022-11-27 13:13:52 +07:00
parent e0cee9b0a0
commit 1f11c63307

11
tugas.f
View File

@ -78,13 +78,11 @@ C
C C
! cpu0=dtime(time0) ! cpu0=dtime(time0)
t1 = omp_get_wtime() t1 = omp_get_wtime()
!$OMP PARALLEL DO
C C
C Jacobi iteration C Jacobi iteration
call jacobi(nn,gosa) call jacobi(nn,gosa)
C C
! cpu1= dtime(time1) ! cpu1= dtime(time1)
!$OMP END PARALLEL DO
t2 = omp_get_wtime() t2 = omp_get_wtime()
! cpu = cpu1 ! cpu = cpu1
cpu = t2-t1 cpu = t2-t1
@ -142,6 +140,7 @@ CC Arrey
CC other constants CC other constants
common /others/ imax,jmax,kmax,omega common /others/ imax,jmax,kmax,omega
C C
!$OMP do
do k=1,mkmax do k=1,mkmax
do j=1,mjmax do j=1,mjmax
do i=1,mimax do i=1,mimax
@ -161,7 +160,10 @@ C
enddo enddo
enddo enddo
enddo enddo
!$OMP end do
C C
!$OMP do
do k=1,kmax do k=1,kmax
do j=1,jmax do j=1,jmax
do i=1,imax do i=1,imax
@ -181,6 +183,7 @@ C
enddo enddo
enddo enddo
enddo enddo
!$OMP end do
C C
return return
end end
@ -208,6 +211,7 @@ C
C C
DO loop=1,nn DO loop=1,nn
gosa=0.0 gosa=0.0
!$OMP do reduction(+:GOSA)
DO K=2,kmax-1 DO K=2,kmax-1
DO J=2,jmax-1 DO J=2,jmax-1
DO I=2,imax-1 DO I=2,imax-1
@ -227,7 +231,9 @@ C
enddo enddo
enddo enddo
enddo enddo
!$OMP end do
C C
!$OMP do
DO K=2,kmax-1 DO K=2,kmax-1
DO J=2,jmax-1 DO J=2,jmax-1
DO I=2,imax-1 DO I=2,imax-1
@ -235,6 +241,7 @@ C
enddo enddo
enddo enddo
enddo enddo
!$OMP end do
C C
enddo enddo
CC End of iteration CC End of iteration