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