Q. Show Independent loops in fortran program?
In the subsequent code portion the directives point to the outer two loops are independent. The inner loop allocates elements of A frequently and therefore it is not independent.
!HPF$ INDEPENDENT
do i=1,n1 ! Loop over i independent
!HPF$ INDEPENDENT
do j=1,n2 ! Loop over j independent
do k=1,n3 ! Inner loop not independent
A(i,j) = A(i,j) + B(i,j,k)*C(i,j)
enddo
enddo
enddo