Next: collect_partialmap    Up: Gather/scatter routines    Previous: distribute_partialalms


collect_map

subroutine collect_map( pixeltype pixelization, int nmaps, int mapnum, int ncomp, double *map, int first_ring, int last_ring, int map_size, double *local_map, int myid, int numprocs, int root, MPI_Comm comm)

Purpose:

Collects on a proc root a single map of ncomp components, which is initially stored in the distributed form in local_map as a map number mapnum. A single map is collected in a single call of the routine.

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_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;

map_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 double storing a 3dim array of a size (0:map_size-1,1:ncomp,1:nmaps) containing the ncomp component maps in the distributed form;

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:
map-- [double*], a vector of doubles storing a 2dim array of dimensions (0:npixall-1, 1:ncomp) in the column-wise order. On the output it contains a single, complete mapnum map of ncomp components on the proc root.
Comments:

  • On the proc root the full-size map will be always assembled. Its rings which have not be computed by any of the procs will have a zero value and may need to be post-processed prior to a further use. (Note for example that the partially oserved rings are computed in full by the routines.)
  • 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.)



  • Next: collect_partialmap    Up: Gather/scatter routines    Previous: distribute_partialalms

    radek stompor 2009-10-15