[Pw_forum] inter_pool_comm

Gabriele Sclauzero sclauzer at sissa.it
Wed Aug 12 10:18:14 CEST 2009


Dear Dmitry,

Dmitry Korotin wrote:
> Dear QE developers,
> could anyone explain to me in a few words a difference between
> inter_pool_comm and intra_pool_comm variables. I am not really

These variables specify a so-called MPI communicator.
Very briefly, they define a subset of mpi processes among which the MPI communication will 
take place.
If you have no pools, at the basic level you have only parallelization over G vectors 
(plane-waves) and you need to call mp_sum with inter_pool_comm as communicator (which will 
coincide with the full set of mpi processes if no other parallelization schemes are 
active) every time you are summing over G vectors (or real space grid).

If you use more than one pool, when you sum over k-points you have to take into account 
that each pool is working on a subset of all k-points, therefore you have to collect the 
partial results from each pool.
This is done by calling mp_sum with inter_pool_comm as communicator.

Summarizing, after a summation over G vectors, call:
         CALL mp_sum ( ???, intra_pool_comm )
and after a summation over k-points call
         CALL mp_sum ( ???, inter_pool_comm )
where in place of ??? you put the name of the variable in which you accumulate the partial 
result.
BTW, for those not familiar with italian/latin, intra means "within", inter means "among", 
more or less.


> familiar with MPI, but I need to sum some variable over k-points.
> Should I use mp_sum(variable_name,inter_pool_comm) or
> mp_sum(variable_name,intra_pool_comm)?
> 
> Does mp_sum take into account k-point weights? (As I understood from

No, I think it's a general purpose interface for mpi reduce subroutines. You have include 
weights explicitly before summing.

> the source this routine is used for summation over k-points?)

Not only, also G-vectors or other things, depending on the value of the communicator.

As a simple example, take a look at PW/new_ns.f90, which computes what written on the top 
comment lines. There is a summation over G vectors (written as a scalar product of two 
wavefunctions)
proj (i, ibnd) = ZDOTC (npw, swfcatom (1, i), 1, evc (1, ibnd), 1)
which needs
         CALL mp_sum ( proj, intra_pool_comm )
and after the summation over k-points you find:
   CALL mp_sum( nr, inter_pool_comm )

> 
> Thank you in advance.

HTH

GS


-- 


o ------------------------------------------------ o
| Gabriele Sclauzero, PhD Student                  |
| c/o:   SISSA & CNR-INFM Democritos,              |
|        via Beirut 2-4, 34014 Trieste (Italy)     |
| email: sclauzer at sissa.it                         |
| phone: +39 040 3787 511                          |
| skype: gurlonotturno                             |
o ------------------------------------------------ o


More information about the Pw_forum mailing list