subroutine distribute_mask( pixelization, nmasks, masknum, ncomp, first_ring, last_ring, mask_size, local_mask, mask, myid, numprocs, root, comm)
Purpose:
The routine distributes a full sky mask mask 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_mask as a masknum mask. To distribute nmasks
the routines needs to be called nmasks times, however in this way it does not require storing all the nmasks
full sky masks in the memory of the single proc root prior to the distribution.
The mask is assumed to be a vector of 0 and 1 integers delineating the observed patch of the sky. For the float-valued map-like
objects (windows, apodization) use distribute_map.
To be called by all procs of the communicator comm. Blocking.
Parameters:
input:
- pixelization(*)-- [pixeltype], an S2HAT structure containing the info about the pixelization;
- masknum(*)-- [integer(4b)], a current number of a mask which is being now distributed;
- nmasks(*)-- [integer(4b)], a total number of masks to be distributed and later processed;
- ncomp(*)-- [integer(4b)], a number of components of the masks to be distributed (=1,2,3);
- first_ring, last_ring-- [integer(4b)], a number of a first and last ring which define a distibuted map (both included)
to be stored on a given proc;
- mask_size-- [integer(4b)], a number of pixels corresponding to a set of rings defined by
first_ring and last_ring above;
- mask-- [real(dp)], an allocated pointer to a 2dim array of dimensions (0:npixall-1, 1:ncomp) storing a single
full sky mask 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 mask
mask 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_mask-- [integer(4b)], an allocated pointer of a 3dim array of a size (0:mask_size-1,1:ncomp,1:nmasks)
storing the distributed mask.
Comments:
On the proc root a full sky mask 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-mask, local_mask, is made of complete rings of both northern and southern hemispheres with numbers falling between
first_ring and the last_ring, inclusive.
|