subroutine distribute_partialalms( int nlmax, int nmmax, int nmaps, int mapnum, int ncomp, int nmvals, int *mvals, int lda,
s2hat_dcomplex *local_alm, int mmin, int mmax, s2hat_dcomplex *alms, int myid, int numprocs, int root, MPI_Comm comm)
Purpose:
Distributes a sub-set of all alms stored in the memory of the proc root over
numprocs procs of the mpi communicator comm.
The input alms subset has to include all modes with m in the range between mmin
and mmax (both inclusive) and for all ncomp components.
The output is stored in local_alm as a mapnum set
(out of nmaps which will be eventually stored in the distributed form).
For each value of mapnum the routine has to be called multiple times so all entries of local_alm are
defined at the end (an prior to any transform routine calls).
Moreover, such a sequence needs to be called nmaps
times with mapnum changing from 1 to nmaps in order to fully define the vector local_alm.
complete set of alms is at the end distributed.
Note that apart of alms all the other parameters have to be defined and allocated as if the entire
set of alms was to be distributed in a step, e.g., via a call to distribute_alms.
Has to be called by all procs. Blocking.
Parameter description:
input:
- nlmax(*)-- [int], maximum value of l considered (included);
- nmmax(*)-- [int], maximum value of m considered (included);
- mapnum-- [int], a number of a current map (set of alms) which is to be distributed;
- nmaps(*)-- [int], a total number of the alm sets which are to be stored in local_alm;
- ncomp(*)-- [int], a number of components of each set of the alm coefficients (=1,2 or 3);
- nmvals-- [int], a number of m assigned to a given proc;
- mvals-- [int*], a vector of the length nmvals containing
the m values to be processed by a given proc;
- lda(*)-- [int], defines the leading dimension of the alm, local_alm and local_plm matrices. Accepted
values: lda == ncomp or nlmax;
- mmin-- [int)], a minimal value of m stored in alms;
- mmax-- [int], a maximal value of m stored in alms;
- alms-- [s2hat_dcomplex*], a vector of complex numbers storing a 3-dim array of dimensions:
in the column-wise order.
Needs to be allocated and defined only on the proc root storing
all the alm coefficients with m in the range [mmin, mmax], which will be, as a result of the call, distributed.
**Note that this array will be destroyed on the output.**
- myid-- [int], proc id (0,...,numprocs-1);
- numprocs(*)-- [int], total number of procs used;
- root(*)-- [int], defines a proc root on which the full set of alm is stored;
- comm(*)-- [int], an mpi communicator for the numprocs procs.
(*)The value must be the same on all procs of the communicator comm.
output:
- local_alm-- [s2hat_dcomplex], a vector of complex numbers storing a 4dim array of dimensions:
in the column-wise order.
It stores relevant alm coefficients for all m values processed on a given proc and all l
and all ncomp components for each of the nmaps maps which are to be processed simultanously;
For ncomp == 1 the coefficients are those for total intensity only. For ncomp == 3 the
component corresponds to the total intensity, E-mode and B-mode polarizations, respectively;
|