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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Space Integrals: Electrostatic potentialsimple loop parallelization!$omp parallel do default(shared), private(rp,is,rhet,rhog,fpibg), p, , , p g), reduction(+:eh,ehte,ehti), DO ig = gstart, ngmrp = (0.D0,0.D0)DO is = 1, nsprp = rp + sfac( ig, is ) * rhops( ig, is ) Ionic density (reciprocal space)END DOrhet = rhoeg( ig )Electronic density (reciprocal space)rhog = rhet + rpIF( tscreen ) THENfpibg = fpi / ( g(ig) * tpiba2 ) + screen_coul(ig)ELSEfpibg = fpi / ( g(ig) * tpiba2 )END IFHartree potentialvloc(ig) = vloc(ig) + fpibg * rhogHatree Energyeh = eh + fpibg * rhog * CONJG(rhog)ehte = ehte + fpibg * DBLE(rhet * CONJG(rhet))ehti = ehti + fpibg * DBLE( rp * CONJG(rp))END DOIonic contributionElectronic contribution! IBM xlf compiler does not like name of function used for <strong>OpenMP</strong> reduction29

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

Saved successfully!

Ooh no, something went wrong!