next up previous contents
Next: 7 Troubleshooting Up: 6 Performance issues (PWscf) Previous: 6.3 File space requirements Contents

6.4 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:

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

As a general rule, image parallelization:

  • may give good scaling, but the slowest image will determine the overall performances (''load balancing'' may be a problem);
  • requires very little communications (suitable for ethernet communications);
  • does not reduce the required memory per processor (unsuitable for large-memory jobs).
Parallelization on k-points:
  • guarantees (almost) linear scaling if the number of k-points is a multiple of the number of pools;
  • requires little communications (suitable for ethernet communications);
  • does not reduce the required memory per processor (unsuitable for large-memory jobs).
Parallelization on plane-waves:
  • 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);
  • requires heavy communications (suitable for Gigabit ethernet up to 4, 8 CPUs at most, specialized communication hardware needed for 8 or more processors );
  • 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 (making it 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''. 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 M x M 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 distribution do) that runs on processors of the same motherboard.


next up previous contents
Next: 7 Troubleshooting Up: 6 Performance issues (PWscf) Previous: 6.3 File space requirements Contents
Paolo Giannozzi 2009-10-01