Epetra Development
Public Member Functions
Epetra_Map Class Reference

Epetra_Map: A class for partitioning vectors and matrices. More...

#include <Epetra_Map.h>

Inheritance diagram for Epetra_Map:
Inheritance graph
[legend]
Collaboration diagram for Epetra_Map:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Epetra_Map (int NumGlobalElements, int IndexBase, const Epetra_Comm &Comm)
 Epetra_Map constructor for a Epetra-defined uniform linear distribution of elements.
 Epetra_Map (long long NumGlobalElements, int IndexBase, const Epetra_Comm &Comm)
 Epetra_Map (long long NumGlobalElements, long long IndexBase, const Epetra_Comm &Comm)
 Epetra_Map (int NumGlobalElements, int NumMyElements, int IndexBase, const Epetra_Comm &Comm)
 Epetra_Map constructor for a user-defined linear distribution of elements.
 Epetra_Map (long long NumGlobalElements, int NumMyElements, int IndexBase, const Epetra_Comm &Comm)
 Epetra_Map (long long NumGlobalElements, int NumMyElements, long long IndexBase, const Epetra_Comm &Comm)
 Epetra_Map (int NumGlobalElements, int NumMyElements, const int *MyGlobalElements, int IndexBase, const Epetra_Comm &Comm)
 Epetra_Map constructor for a user-defined arbitrary distribution of elements.
 Epetra_Map (long long NumGlobalElements, int NumMyElements, const long long *MyGlobalElements, int IndexBase, const Epetra_Comm &Comm)
 Epetra_Map (long long NumGlobalElements, int NumMyElements, const long long *MyGlobalElements, long long IndexBase, const Epetra_Comm &Comm)
 Epetra_Map (long long NumGlobal_Elements, int NumMy_Elements, const long long *myGlobalElements, int indexBase, const Epetra_Comm &comm, bool UserIsDistributedGlobal, long long UserMinAllGID, long long UserMaxAllGID)
 Epetra_Map constructor for a user-defined arbitrary distribution of elements, where the user provides all the globals.
 Epetra_Map (int NumGlobal_Elements, int NumMy_Elements, const int *myGlobalElements, int indexBase, const Epetra_Comm &comm, bool UserIsDistributedGlobal, int UserMinAllGID, int UserMaxAllGID)
 Epetra_Map (const Epetra_Map &map)
 Epetra_Map copy constructor.
virtual ~Epetra_Map (void)
 Epetra_Map destructor.
Epetra_Mapoperator= (const Epetra_Map &map)
 Assignment Operator.
Epetra_MapRemoveEmptyProcesses () const
 Return a new BlockMap with processes with zero elements removed.
Epetra_MapReplaceCommWithSubset (const Epetra_Comm *Comm) const
 Replace this Map's communicator with a subset communicator.

Detailed Description

Epetra_Map: A class for partitioning vectors and matrices.

It is often the case that multiple matrix and vector objects have an identical distribution of elements on a parallel machine. The Epetra_Map class keep information that describes this distribution for matrices and vectors.

Epetra_Map allows the storage and retrieval of the following information. Depending on the constructor that is used, some of the information is defined by the user and some is determined by the constructor. Once a Epetra_Map is constructed any of the following attributes can be obtained by calling a query function that has the name as the attribute, e.g. to get the value of NumGlobalElements, you can call a function NumGlobalElements(). For attributes that are lists, the query functions return the list values in a user allocated array.

In addition to the information above that is passed in to or created by the Epetra_Map constructor, the following attributes are computed and available via query to the user using the same scheme as above, e.g., use NumGlobalPoints() to get the value of NumGlobalPoints.

The following functions allow boolean tests for certain properties.

Warning:
An Epetra_Comm object is required for all Epetra_Map constructors.
Note:
In the current implementation, Epetra_BlockMap is the base class for Epetra_Map.

Constructor & Destructor Documentation

Epetra_Map::Epetra_Map ( int  NumGlobalElements,
int  IndexBase,
const Epetra_Comm Comm 
)

Epetra_Map constructor for a Epetra-defined uniform linear distribution of elements.

Creates a map that distributes NumGlobalElements elements evenly across all processors in the Epetra_Comm communicator. If NumGlobalElements does not divide exactly into the number of processors, the first processors in the communicator get one extra element until the remainder is gone.

Parameters:
InNumGlobalElements - Number of elements to distribute.
InIndexBase - Minimum index value used for arrays that use this map. Typically 0 for C/C++ and 1 for Fortran.
InComm - Epetra_Comm communicator containing information on the number of processors.
Returns:
Pointer to a Epetra_Map object.
Epetra_Map::Epetra_Map ( int  NumGlobalElements,
int  NumMyElements,
int  IndexBase,
const Epetra_Comm Comm 
)

Epetra_Map constructor for a user-defined linear distribution of elements.

Creates a map that puts NumMyElements on the calling processor. If NumGlobalElements=-1, the number of global elements will be the computed sum of NumMyElements across all processors in the Epetra_Comm communicator.

Parameters:
InNumGlobalElements - Number of elements to distribute. Must be either -1 or equal to the computed sum of NumMyElements across all processors in the Epetra_Comm communicator.
InNumMyElements - Number of elements owned by the calling processor.
InIndexBase - Minimum index value used for arrays that use this map. Typically 0 for C/C++ and 1 for Fortran.
InComm - Epetra_Comm communicator containing information on the number of processors.
Returns:
Pointer to a Epetra_Map object.
Epetra_Map::Epetra_Map ( int  NumGlobalElements,
int  NumMyElements,
const int *  MyGlobalElements,
int  IndexBase,
const Epetra_Comm Comm 
)

Epetra_Map constructor for a user-defined arbitrary distribution of elements.

Creates a map that puts NumMyElements on the calling processor. The indices of the elements are determined from the list MyGlobalElements. If NumGlobalElements=-1, the number of global elements will be the computed sum of NumMyElements across all processors in the Epetra_Comm communicator.

Parameters:
InNumGlobalElements - Number of elements to distribute. Must be either -1 or equal to the computed sum of NumMyElements across all processors in the Epetra_Comm communicator.
InNumMyElements - Number of elements owned by the calling processor.
InMyGlobalElements - Integer array of length NumMyElements. The ith entry contains the global index value of the ith element on this processor. Index values are not required to be contiguous on a processor, or to be within the range of 0 to NumGlobalElements. As long as the index values are consistently defined and used, any set of NumGlobalElements distinct integer values is acceptable.
InIndexBase - Minimum index value used for arrays that use this map. Typically 0 for C/C++ and 1 for Fortran.
InComm - Epetra_Comm communicator containing information on the number of processors.
Returns:
Pointer to a Epetra_Map object.
Epetra_Map::Epetra_Map ( long long  NumGlobal_Elements,
int  NumMy_Elements,
const long long *  myGlobalElements,
int  indexBase,
const Epetra_Comm comm,
bool  UserIsDistributedGlobal,
long long  UserMinAllGID,
long long  UserMaxAllGID 
)

Epetra_Map constructor for a user-defined arbitrary distribution of elements, where the user provides all the globals.

Warning:
This method is intended for expert developer use only, and should never be called by user code.

Member Function Documentation

Epetra_Map* Epetra_Map::RemoveEmptyProcesses ( ) const

Return a new BlockMap with processes with zero elements removed.

Warning:
This method is only for expert users. Understanding how to use this method correctly requires some familiarity with semantics of MPI communicators.
We make no promises of backwards compatibility for this method. It may go away or change at any time.

This method first computes a new communicator, which contains only those processes in this Map's communicator (the "original communicator") that have a nonzero number of elements in this BlockMap (the "original BlockMap"). It then returns a new BlockMap distributed over the new communicator. The new BlockMap represents the same distribution as the original BlockMap, except that processes containing zero elements are not included in the new BlockMap or its communicator. On processes not included in the new BlockMap or communicator, this method returns NULL.

The returned BlockMap always has a distinct communicator from this BlockMap's original communicator. The new communicator contains a subset of processes from the original communicator. Even if the number of processes in the new communicator equals the number of processes in the original communicator, the new communicator is distinct. (In an MPI implementation, the new communicator is created using MPI_Comm_split.)

This method must be called collectively on the original communicator. It leaves the original Map and communicator unchanged.

This method was intended for applications such as algebraic multigrid or other multilevel preconditioners. Construction of each level of the multilevel preconditioner typically requires constructing sparse matrices, which in turn requires all-reduces over all participating processes at that level. Matrix sizes at successively coarser levels shrink geometrically. At the coarsest levels, some processes might be left with zero rows of the matrix, or the multigrid implementation might "rebalance" (redistribute the matrix) and intentionally leave some processes with zero rows. Removing processes with zero rows makes the all-reduces and other communication operations cheaper.

Reimplemented from Epetra_BlockMap.

Epetra_Map* Epetra_Map::ReplaceCommWithSubset ( const Epetra_Comm Comm) const

Replace this Map's communicator with a subset communicator.

Warning:
This method is only for expert users. Understanding how to use this method correctly requires some familiarity with semantics of MPI communicators.
We make no promises of backwards compatibility for this method. It may go away or change at any time.
Precondition:
The input communicator's processes are a subset of this Map's current communicator's processes.
On processes which are not included in the input communicator, the input communicator is null.

This method must be called collectively on the original communicator. It leaves the original BlockMap and communicator unchanged.

Note:
This method differs from removeEmptyProcesses(), in that it does not assume that excluded processes have zero entries. For example, one might wish to remove empty processes from the row Map of a CrsGraph using removeEmptyProcesses(), and then apply the resulting subset communicator to the column, domain, and range Maps of the same graph. For the latter three Maps, one would in general use this method instead of removeEmptyProcesses(), giving the new row Map's communicator to this method.

Reimplemented from Epetra_BlockMap.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator