next up previous
Next: [edit] Troubleshooting (PWscf) Up: User's Guide for Quantum-ESPRESSO Previous: [edit] Using CP

Subsections

[edit] Performance issues (PWscf)

[edit] CPU time requirements

The following holds for code pw.x and for non-US PPs. For US PPs there are additional terms to be calculated, that may add from a few percent up to 30-40% to execution time. For phonon calculations, each of the 3Nat modes requires a CPU time of the same order of that required by a self-consistent calculation in the same system. For cp.x, the required CPU time of each time step is in the order of the time Th + Torth + Tsub defined below.

The computer time required for the self-consistent solution at fixed ionic positions, Tscf , is:

Tscf = NiterTiter + Tinit

where Niter = niter = number of self-consistency iterations, Titer = CPU time for a single iteration, Tinit = initialization time for a single iteration. Usually Tinit < < NiterTiter .

The time required for a single self-consistency iteration Titer is:

Titer = NkTdiag + Trho + Tscf

where Nk = number of k-points, Tdiag = CPU time per hamiltonian iterative diagonalization, Trho = CPU time for charge density calculation, Tscf = CPU time for Hartree and exchange-correlation potential calculation.

The time for a Hamiltonian iterative diagonalization Tdiag is:

Tdiag = NhTh + Torth + Tsub

where Nh = number of H ψ products needed by iterative diagonalization, Th = CPU time per H ψ product, Torth = CPU time for orthonormalization, Tsub = CPU time for subspace diagonalization.

The time Th required for a H ψ product is

Th = a1MN + a2MN1N2N3log(N1N2N3) + a3MPN.

The first term comes from the kinetic term and is usually much smaller than the others. The second and third terms come respectively from local and nonlocal potential. a1,a2,a3 are prefactors, M = number of valence bands, N = number of plane waves (basis set dimension), N1,N2,N3 = dimensions of the FFT grid for wavefunctions (N1N2N3 ∼ 8N ), P = number of projectors for PPs (summed on all atoms, on all values of the angular momentum l, and m = 1, . . . , 2l + 1)

The time Torth required by orthonormalization is

and the time Tsub required by subspace diagonalization is

where b1 and b2 are prefactors, Mx = number of trial wavefunctions (this will vary between M and a few times M , depending on the algorithm).

The time Trho for the calculation of charge density from wavefunctions is

Trho = c1MNr1Nr2Nr3log(Nr1Nr2Nr3) + c2MNr1Nr2Nr3 + Tus

where c1,c2,c3 are prefactors, Nr1,Nr2,Nr3 = dimensions of the FFT grid for charge density (Nr1Nr2Nr3∼ 8Ng , where Ng = number of G-vectors for the charge density), and Tus = CPU time required by ultrasoft contribution (if any).

The time Tscf for calculation of potential from charge density is

Tscf = d2Nr1Nr2Nr3 + d3Nr1Nr2Nr3log(Nr1Nr2Nr3)

where d1,d2 are prefactors.

[edit] Memory requirements

A typical self-consistency or molecular-dynamics run requires a maximum memory in the order of O double precision complex numbers, where

O = mMN + PN + pN1N2N3 + qNr1Nr2Nr3

with m, p, q = small factors; all other variables have the same meaning as above. Note that if the Γ-point only (q = 0) is used to sample the Brillouin Zone, the value of N will be cut into half.

The memory required by the phonon code follows the same patterns, with somewhat larger factors m, p, q .

[edit] File space requirements

A typical pw.x run will require an amount of temporary disk space in the order of O double precision complex numbers:

O = NkMN + qNr1Nr2Nr3

where q = 2 · mixing ndim (number of iterations used in self-consistency, default value = 8) if disk io is set to ’high’ or not specified; q = 0 if disk io=’low’ or ’minimal’.

[edit] Parallelization issues

pw.x and cp.x can run in principle on any number of processors. The effectiveness of parallelization is ultimately judged by the scaling, i.e. how the time needed to perform a job scales with the number of processors, and depends upon:

  1. the size and type of the system under study;
  2. the judicious choice of the various levels of parallelization (detailed in the Running on parallel machines sections);
  3. the availability of fast interprocess communications (or lack thereof).

Ideally one would like to have linear scaling, i.e. for Np processors. In addition, one would like to have linear scaling of the RAM per processor: , so that large-memory systems fit into the RAM of each processor.

As a general rule, image parallelization:

  1. may give good scaling, but the slowest image will determine the overall performances (load balancing may be a problem);
  2. requires very little communications (suitable for ethernet communications);
  3. does not reduce the required memory per processor (unsuitable for large-memory jobs).

Parallelization on k-points:

  1. guarantees (almost) linear scaling if the number of k-points is a multiple of the number of pools;
  2. requires little communications (suitable for ethernet communications);
  3. does not reduce the required memory per processor (unsuitable for large-memory jobs).

Parallelization on plane-waves:

  1. yields good to very good scaling, especially if the number of processors in a pool is a divisor of N3 and Nr3 (the dimensions along the z-axis of the FFT grids, which may coincide);
  2. requires heavy communications (suitable for Gigabit ethernet up to 4, 8 CPUs at most, specialized communication hardware needed for 8 or more processors );
  3. yields almost linear reduction of memory per processor with the number of processors in the pool.

A note on scaling: optimal serial performances are achieved when the data are as much as possible kept into the cache. As a side effect, plane-wave parallelization may yield superlinear (better than linear) scaling, thanks to the increase in serial speed coming from the reduction of data size (makingit easier for the machine to keep data in the cache).

For each system there is an optimal range of number of processors on which to run the job. A too large number of processors will yield performance degradation. If the size of pools is especially delicate: Np should not exceed by much N3 and Nr3. For large jobs, it is convenient to further subdivide a pool of processors into task groups. The 3D FFT grid is parallelized using ation of the 3D FFT when the number of processors exceeds the number of FFT planes, data can be redistributed to "task groups" so that each group can process several wavefunctions at the same time.

The optimal number of processors for the ortho (cp.x) or ndiag (pw.x) parallelization, taking care of linear algebra operations involving matrices, is automatically chosen by the code.

Actual parallel performances will also depend a lot on the available software (MPI libraries) and on the available communication hardware. For Beowulf-style machines (clusters of PC) the newest version 1.1 and later of the OpenMPI libraries (http://www.openmpi.org/) seems to yield better performances than other implementations (info by Kostantin Kudin). Note however that you need a decent communication hardware (at least Gigabit ethernet) in order to have acceptable performances with PW parallelization. Do not expect good scaling with cheap hardware: plane-wave calculations are by no means an “embarrassing parallel” problem.

Also note that multiprocessor motherboards for Intel Pentium CPUs typically have just one memory bus for all processors. This dramatically slows down any code doing massive access to memory (as most codes in the Quantum-ESPRESSO package do) that runs on processors of the same motherboard.


next up previous
Next: [edit] Troubleshooting (PWscf) Up: User's Guide for Quantum-ESPRESSO Previous: [edit] Using CP
Paolo Giannozzi 2008-07-01