subroutine distribute_map( pixelization, nmaps, mapnum, ncomp, first_ring, last_ring, map_size, local_map, map, myid, numprocs, root, comm)
Purpose:
The routine distributes a full sky map map of ncomp components stored in the memory of the proc root
over all processors. 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, however in this way it does not require storing all the nmaps
full sky maps in the memory of the single proc root 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(*)-- [integer(4b)], a current number of a map which is being now distributed;
- nmaps(*)-- [integer(4b)], a total number of maps to be distributed and later processed;
- ncomp(*)-- [integer(4b)], a number of components of the maps to be distributed (=1,2,3);
- first_ring, last_ring-- [integer(4b)], 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-- [integer(4b)], a number of pixels corresponding to a set of rings defined by
first_ring and last_ring above;
- map-- [real(dp)], an allocated pointer to a 2dim array of dimensions (0:npixall-1, 1:ncomp) storing a single
full sky map on the proc root and which is to be distributed;
- myid-- [integer(4b)], proc id (0,...,numprocs-1);
- numprocs(*)-- [integer(4b)], total number of procs used;
- root(*)-- [integer(4b)], defines a proc root on which the full map
map is stored;
- comm(*)-- [integer(4b)], an mpi communicator for the numprocs procs.
(*)The value must be the same on all procs of the communicator comm.
output:
- local_map-- [real(dp)], an allocated pointer of a 3dim array of a size (0:map_size-1,1:ncomp,1:nmaps)
storing the distributed map.
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.
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.
|