12.07.2015 Views

Hybrid programming with MPI & OpenMP - Prace Training Portal

Hybrid programming with MPI & OpenMP - Prace Training Portal

Hybrid programming with MPI & OpenMP - Prace Training Portal

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Space Integral: Non local energyless simple loop parallelization!$omp parallel default(shared), &!$omp private(is,iv,ijv,isa,ism,ia,inl,jnl,sums,i,iss,sumt), reduction(+:ennl)do is = 1, nspdo iv = 1, nh(is)do jv = iv, nh(is)ijv = (jv-1)*jv/2 + iv!$omp doisa = 0do ism = 1, is - 1isa = isa + na(ism)end do!$omp do!$omp end doend doend doend do!$omp end parallel...do i = 1, ndo ia = 1, na(is)inl = ish(is)+(iv-1)*na(is)+iajnl = ish(is)+(jv-1)*na(is)+iaisa = isa+1sums = 0.d0Larger parallel region to reduceThe fork/join overheadiss = ispin(i)sums(iss) = sums(iss) + f(i) * bec(inl,i) * bec(jnl,i)end dosumt = 0.d0do iss = 1, nspin!$ d ll l rhovan( ijv, isa, iss ) = sums( iss )sumt = sumt + sums( iss )end doif( iv .ne. jv ) sumt = 2.d0 * sumtennl = ennl + sumt * dvan( jv, iv, is)end do!$omp end do30

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!