subroutine collect_partialmap( pixeltype pixelization, int nmaps, int mapnum, int ncomp, int first_pix, int last_pix, double *submap,
int first_ring, int last_ring, int submap_size, double *local_map, int myid, int numprocs, int root, MPI_Comm comm)
Purpose:
Collects on a proc root part of a map made of submap_size consecutive pixels starting with pixel
first_pix and including ncomp components, which are initially stored in the distributed form in
local_map as a map number mapnum. Multiple calls of the routine are needed to collect a full map.
Parameters:
input:
- pixelization-- [pixeltype], an S2HAT structure containing the info about the pixelization;
- nmaps-- [int], a total number of maps distributed over procs and stored in local_map;
- mapnum-- [int], a number of a map to be gathered on the proc root on the output;
- ncomp-- [int], a number of components per map(=1,2 or 3);
- first_pix, last_pix-- [long int(8bytes)], a global number of the first and last pixel, respectively, to be collected;
- first_ring, last_ring-- [int], a number of a first and last ring, respectively, which define a distributed 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;
- local_map-- [double*], a vector of doubles storing a 3dim array of a size (0:submap_size-1,1:ncomp,1:nmaps)
in the column-wise order. It contains a subset of nmaps maps each made of ncomp components.
- 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.
output:
- submap-- [double*], a vector of doubles storing a 2dim array of dimensions
(0:last_pix-first_pix, 1:ncomp) in the column-wise order. On the output on the proc root
it contains a subset of a single, complete map, which was stored as a mapnum map in the distributed form.
Comments:
On all the procs the input submaps, local_map, are assumed to be disjoint and composed of complete rings of both northern or southern hemispheres,
with numbers in the range [first_ring, last_ring]. (Though that may lead to some extra memory overhead, especially for the scans confined
fully to one or the other hemisphere, it does not affect the load_balancing and operation count. That may be corrected later.)
|