- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ifort develiper and users,
I have written a fortran code(where four loops are present) in openMP. Here i share the openMP code, where the second loop is parallelized.
first: do i=1,NMAX,1
xmsd_1(i) = 0.0
!$omp parallel default(none) &
!$omp shared (NTMAX,nmol,i,com_xu,P_1,xmsd_1) &
!$omp private(k,m,dx,xmsd,pr_1)
!$omp do reduction(+:xmsd_1)
second: do j=1,NTMAX,1
third : do k =1,nmol,1
pr_1 = 1
fourth : do m=jframe,jframe+iframe,1
pr_1 = pr_1 * P_1(m,k)
end do fourth
if(pr_1 .eq. 1) then
dx = com_xu(k,j+i) - com_xu(k,j)
xmsd = dx*dx
xmsd_1(i) = xmsd_1(i) + xmsd * pr_1
end if
end do third
end do second
!$omp end do
!$omp end parallel
print*, i,xmsd(i)
end do first
My openMP code(where second loop was parallelized) results do not match the serial code results. could you please suggest a solution to this problem?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page