openmp - Why the parallelized fortran code takes longer to run? -
i have been trying parallelize subroutine of 2d fem code, performs matrix multiplication @ each time step, in order calculate mass, internal forces , gravity @ each integration point. have been trying many options on how reduce running time parallelizing parallelized code takes longer regular one.
can please give me idea why happens in case?
thank
(attached can find subroutine)
subroutine map2nod() !********************************************************************** ! function: internal , external forces, mass @ each nodes !********************************************************************** implicit none integer :: i, iel, id, inod(4), ig, j grvf = 0.d0; inrf = 0.d0; extf = 0.d0; mas = 0.d0 extf(2) = -50 extf(4) = -50 !$omp parallel private(iel,ig,i,id,inod) iel = 1, nel inod(:) = icon(:, iel) ig = 1, 4 = 1, 4 id = (inod(i) - 1) * 2 inrf(id + 1) = inrf(id + 1)+(sigg(1,ig,iel) * b(1,i,iel,ig) + sigg(4,ig,iel) * b(2, i, iel, ig)) * area(iel)/4.d0 inrf(id + 2) = inrf(id + 2)+(sigg(4,ig,iel) * b(1,i,iel,ig) + sigg(2,ig,iel) * b(2, i, iel, ig)) * area(iel)/4.d0 grvf(id + 1) = grvf(id + 1) + area(iel) * matprop(3) * hs(i, iel, ig) * gx /4.d0 grvf(id + 2) = grvf(id + 2) + area(iel) * matprop(3) * hs(i, iel, ig) * gy /4.d0 mas(id + 1) = mas(id + 1) + area(iel) * matprop(3) * hs(i, iel, ig) /4.d0 mas(id + 2) = mas(id + 2) + area(iel) * matprop(3) * hs(i, iel, ig) /4.d0 end enddo !gauss end !nel !$omp end parallel end subroutine map2nod
Comments
Post a Comment