subroutine distribute_partialmap( pixeltype pixelization, int nmaps, int mapnum, int ncomp, int first_ring, int last_ring, int submap_size, double *local_map,
long int first_pix, long int last_pix, double *submap, int myid, int numprocs, int root, MPI_Comm comm)
Purpose:
The routine distributes part of the full sky map, submap, composed of submap_size consecutive pixels starting from a pixel,
first_pix, for ncomp components and stored initially in the memory of the proc root. The routine is to be called
successively so the full map is distributed over all processors and the result equivalent to a single call of the distribute_map routine.
However it does not require that a sufficient memory
is availabe on the proc root required to store the full map. The distributed submap is placed as a submap with a number mapnum of the
vector, local_map.
To distribute nmaps the sequence of the calls needs to be repeated nmaps times.
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], numbers of a first and last ring which define a sub map (both included) to be stored on a given proc;
- submap_size-- [int], a number of pixels corresponding to a set of rings defined by
first_ring and last_ring above;
- first_pix, last_pix-- [long int (8byte)], a global number of the first pixel and last pixel, respectively, of the partial map submap to be distributed;
- submap-- [double*], a vector of doubles storing a 2dim array of dimensions (0:submap_size-1, 1:ncomp) in the column-wise order. It stores a single
submap, made of ncomp components, of the full sky map from pixel first_pix to last_pix, which is to be distributed over the procs.
It is to be allocated and defined only on the proc root.
- myid-- [int], proc id (0,...,numprocs-1);
- numprocs(*)-- [int], total number of procs used;
- root(*)-- [int], defines a proc root on which the partial map to be distributed
submap 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_map-- [double], a vector of doubles corresponding to a 3dim array of a size (0:map_size-1,1:ncomp,1:nmaps)
stored in the column-wise order and storing the distributed map.
Comments:
On all procs the distributed 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.
|