subroutine distribute_map( pixeltype pixelization, int nmaps, int mapnum, int ncomp, int first_ring, int last_ring, int map_size,
double *local_map, double *map, int myid, int numprocs, int root, MPI_Comm comm)
Purpose:
The routine distributes over all processors of the communicator comm a full sky map map made of
ncomp components stored in the memory of the proc root. The result is stored it in
the distributed form on each proc in a vector local_map as a mapnum map. To distribute nmaps
the routines needs to be called nmaps times with mapnum changing from 0 to nmaps-1, however
in this way it does not require storing all the nmaps full sky maps in the memory of the single root proc
prior to the distribution.
To be called by all procs of the communicator comm. Blocking.
Parameters:
input:
- pixelization(*)-- [pixeltype], an S2HAT structure containing the info about the pixelization;
- mapnum(*)-- [int], a current number of a map which is being now distributed;
- nmaps(*)-- [int], a total number of maps to be distributed and later processed;
- ncomp(*)-- [int], a number of components of the maps to be distributed (=1,2,3);
- first_ring, last_ring-- [int], a number of a first and last ring, respectively,
which define a sub map (both included) to be stored on a given proc;
- map_size-- [int], a number of pixels corresponding to a set of rings defined by
first_ring and last_ring above;
- map-- [double*], a vector of doubles storing a 2dim array of dimensions (0:npixall-1, 1:ncomp) in the column-wise
order. It has to be allocated and defined only on the proc root and contains a single full sky map of ncomp component, which
as a resul of a call to this routne will be distributed over all procs of the communicator comm;
- myid-- [int], proc id (0,...,numprocs-1);
- numprocs(*)-- [int], total number of procs used;
- root(*)-- [int], defines a proc root on which the full map
map is stored;
- comm(*)-- [MPI_Comm], an mpi communicator for the numprocs procs.
(*)The value must be the same on all procs of the communicator comm.
output:
- local_map-- [double*], a vector of doubles storing a 3dim array of a size (0:map_size-1,1:ncomp,1:nmaps)
in the column-wise order. The content of the vector is different on each proc as it contains part of the full map as defined by the
ring numbers first_ring and last_ring.
Comments:
On the proc root a full sky map is always assumed, even if only parts of it (as defined by first_ring and last_ring)
may actually be distributed, as it is the cases for the cut-sky maps.
On all procs the sub-map, local_map, is made of complete rings of both northern and southern hemispheres with numbers falling between
first_ring and the last_ring, inclusive.
|