12.07.2015 Views

Ab initio molecular dynamics: Theory and Implementation

Ab initio molecular dynamics: Theory and Implementation

Ab initio molecular dynamics: Theory and Implementation

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.

ENDCALL ParallelFFT3D("INV",scr1,scr2)scr2(1:N p x,1:N y ,1:N z ) = scr2(1:N p x,1:N y ,1:N z ) * && vpot(1:N p x ,1:N y,1:N z )CALL ParallelFFT3D("FW",scr1,scr2)FOR j=1:N p PWFP = scr1(ipg(1,i),mapxy(ipg(2,i),ipg(3,i))) && + scr1(img(1,i),mapxy(img(2,i),img(3,i)))FM = scr1(ipg(1,i),mapxy(ipg(2,i),ipg(3,i))) && - scr1(img(1,i),mapxy(img(2,i),img(3,i)))fc(j,i) = f(i) * CMPLX[REAL[FP],IMAG[FM]]fc(j,i+1) = f(i+1) * CMPLX[IMAG[FP],-REAL[FM]]ENDENDThe parallel Fourier transform routine can be built from a multiple one-dimensionalFourier transform <strong>and</strong> a parallel matrix transpose. As mentioned above, only onedimension of the real space grid is distributed in the CPMD code. This allows tocombine the transforms in y <strong>and</strong> z direction to a series of two-dimensional transforms.The h<strong>and</strong>ling of the plane waves in Fourier space breaks the symmetry <strong>and</strong>two different transpose routines are needed, depending on the direction. All thecommunication is done in the routine ParallelTranspose. This routine consistsof a part where the coefficients are gathered into matrix form, the parallel matrixtranspose, <strong>and</strong> a final part where the coefficients are put back according to themapping used.MODULE ParallelFFT3D(tag,a,b)IF (tag == "INV") THENCALL MLTFFT1D(a)CALL ParallelTranspose("INV",b,a)CALL MLTFFT2D(b)ELSECALL MLTFFT2D(b)CALL ParallelTranspose("FW",b,a)CALL MLTFFT1D(a)END IFAll other parts of the program use the same patterns for the parallelization as theones shown in this section.3.9.4 LimitationsTwo types of limitations can be encountered when trying to run a parallel code on acomputer. Increasing the number of processors working on a problem will no longerlead to a faster calculation or the memory available is not sufficient to perform acalculation, independently on the number of processors available. The first type of89

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

Saved successfully!

Ooh no, something went wrong!