queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::Map Class Reference

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

#include <Map.h>

Public Member Functions

Constructor/Destructor methods
 Map (int numGlobalElements, int indexBase, const MpiComm &comm)
 Constructor for a uniform linear distribution of elements. More...
 
 Map (const Map &src)
 Copy constructor. More...
 
 ~Map ()
 Destructor. More...
 
Set methods
Mapoperator= (const Map &rhs)
 Assignment operator. More...
 
Size, dimension and local ID accessor methods
int NumGlobalElements () const
 Returns the total number of elements across all processors. More...
 
int IndexBase () const
 
int NumMyElements () const
 Returns the number of elements owned by the calling processor. More...
 
int MinMyGID () const
 The minimum global index value on the calling processor. More...
 
Miscellaneous methods
const MpiCommComm () const
 Access function for MpiComm communicator. More...
 
const Epetra_Map & epetraMap () const
 Trilinos Epetra_Map: A class for partitioning vectors and matrices. More...
 

Private Member Functions

 Map ()
 Default constructor. Do not call this directly. More...
 
void copy (const Map &src)
 Copies the map. More...
 

Private Attributes

MpiComm m_MpiComm
 This communicator can be queried for processor rank and size information. More...
 
Epetra_Map * m_epetraMap
 Epetra_Map. More...
 
int m_numGlobalElements
 Total number of elements across all processors. More...
 
int m_indexBase
 Base integer value for indexed array references. More...
 
int m_numMyElements
 Number of elements owned by the calling processor. More...
 

Detailed Description

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 Map keeps information that describes this distribution for matrices and vectors. Inspired by Trilinos Epetra_Map class.

Definition at line 49 of file Map.h.

Constructor & Destructor Documentation

QUESO::Map::Map ( int  numGlobalElements,
int  indexBase,
const MpiComm comm 
)

Constructor for a uniform linear distribution of elements.

QUESO::Map::Map ( const Map src)

Copy constructor.

QUESO::Map::~Map ( )

Destructor.

QUESO::Map::Map ( )
private

Default constructor. Do not call this directly.

Definition at line 63 of file Map.C.

References m_epetraMap.

64 {
65 #ifdef QUESO_HAS_TRILINOS
66  delete m_epetraMap;
67  m_epetraMap = NULL;
68 #else
69  // Nothing to do
70 #endif
71 }
Epetra_Map * m_epetraMap
Epetra_Map.
Definition: Map.h:113

Member Function Documentation

const MpiComm & QUESO::Map::Comm ( ) const

Access function for MpiComm communicator.

Definition at line 131 of file Map.C.

References m_MpiComm.

Referenced by QUESO::Matrix::numOfProcsForStorage(), QUESO::Vector::numOfProcsForStorage(), QUESO::GPMSAFactory< V, M >::setUpEmulator(), and QUESO::GslMatrix::transpose().

132 {
133  return m_MpiComm;
134 }
MpiComm m_MpiComm
This communicator can be queried for processor rank and size information.
Definition: Map.h:109
void QUESO::Map::copy ( const Map src)
private

Copies the map.

Definition at line 146 of file Map.C.

References m_epetraMap, m_indexBase, m_MpiComm, m_numGlobalElements, and m_numMyElements.

Referenced by operator=().

147 {
148  m_MpiComm = src.m_MpiComm;
149 #ifdef QUESO_HAS_TRILINOS
150  delete m_epetraMap;
151  m_epetraMap = new Epetra_Map(*src.m_epetraMap);
152 #else
153  m_numGlobalElements = src.m_numGlobalElements;
154  m_indexBase = src.m_indexBase;
155  m_numMyElements = src.m_numMyElements;
156 #endif
157 
158  return;
159 }
Epetra_Map * m_epetraMap
Epetra_Map.
Definition: Map.h:113
int m_numGlobalElements
Total number of elements across all processors.
Definition: Map.h:116
int m_numMyElements
Number of elements owned by the calling processor.
Definition: Map.h:122
MpiComm m_MpiComm
This communicator can be queried for processor rank and size information.
Definition: Map.h:109
int m_indexBase
Base integer value for indexed array references.
Definition: Map.h:119
const Epetra_Map & QUESO::Map::epetraMap ( ) const

Trilinos Epetra_Map: A class for partitioning vectors and matrices.

Definition at line 138 of file Map.C.

References m_epetraMap.

139 {
140  return *m_epetraMap;
141 }
Epetra_Map * m_epetraMap
Epetra_Map.
Definition: Map.h:113
int QUESO::Map::IndexBase ( ) const

Returns the base integer value for indexed array references. The first position in the global processor in my processors.

Definition at line 96 of file Map.C.

References m_epetraMap, and m_indexBase.

97 {
98 #ifdef QUESO_HAS_TRILINOS
99  return m_epetraMap->IndexBase();
100 #else
101  return m_indexBase;
102 #endif
103 }
Epetra_Map * m_epetraMap
Epetra_Map.
Definition: Map.h:113
int m_indexBase
Base integer value for indexed array references.
Definition: Map.h:119
int QUESO::Map::MinMyGID ( ) const

The minimum global index value on the calling processor.

Definition at line 118 of file Map.C.

References m_epetraMap.

119 {
120 #ifdef QUESO_HAS_TRILINOS
121  return m_epetraMap->MinMyGID();
122 #else
123  return 0;
124 #endif
125 }
Epetra_Map * m_epetraMap
Epetra_Map.
Definition: Map.h:113
int QUESO::Map::NumGlobalElements ( ) const

Returns the total number of elements across all processors.

Definition at line 85 of file Map.C.

References m_epetraMap, and m_numGlobalElements.

Referenced by QUESO::ConcatenatedJointPdf< V, M >::distributionVariance(), QUESO::GslVector::GslVector(), QUESO::ConcatenationSubset< V, M >::moments(), QUESO::GslVector::sizeGlobal(), QUESO::TeuchosVector::sizeGlobal(), QUESO::TeuchosMatrix::TeuchosMatrix(), QUESO::TeuchosVector::TeuchosVector(), and QUESO::VectorSpace< V, M >::VectorSpace().

86 {
87 #ifdef QUESO_HAS_TRILINOS
88  return m_epetraMap->NumGlobalElements();
89 #else
90  return m_numGlobalElements;
91 #endif
92 }
Epetra_Map * m_epetraMap
Epetra_Map.
Definition: Map.h:113
int m_numGlobalElements
Total number of elements across all processors.
Definition: Map.h:116
int QUESO::Map::NumMyElements ( ) const

Returns the number of elements owned by the calling processor.

Definition at line 107 of file Map.C.

References m_epetraMap, and m_numMyElements.

Referenced by QUESO::GslVector::GslVector(), QUESO::GslVector::sizeLocal(), QUESO::TeuchosVector::sizeLocal(), and QUESO::TeuchosVector::TeuchosVector().

108 {
109 #ifdef QUESO_HAS_TRILINOS
110  return m_epetraMap->NumMyElements();
111 #else
112  return m_numMyElements;
113 #endif
114 }
Epetra_Map * m_epetraMap
Epetra_Map.
Definition: Map.h:113
int m_numMyElements
Number of elements owned by the calling processor.
Definition: Map.h:122
Map & QUESO::Map::operator= ( const Map rhs)

Assignment operator.

Definition at line 76 of file Map.C.

References copy().

77 {
78  this->copy(rhs);
79  return *this;
80 }
void copy(const Map &src)
Copies the map.
Definition: Map.C:146

Member Data Documentation

Epetra_Map* QUESO::Map::m_epetraMap
private

Epetra_Map.

Definition at line 113 of file Map.h.

Referenced by copy(), epetraMap(), IndexBase(), Map(), MinMyGID(), NumGlobalElements(), and NumMyElements().

int QUESO::Map::m_indexBase
private

Base integer value for indexed array references.

Definition at line 119 of file Map.h.

Referenced by copy(), and IndexBase().

MpiComm QUESO::Map::m_MpiComm
private

This communicator can be queried for processor rank and size information.

Definition at line 109 of file Map.h.

Referenced by Comm(), and copy().

int QUESO::Map::m_numGlobalElements
private

Total number of elements across all processors.

Definition at line 116 of file Map.h.

Referenced by copy(), and NumGlobalElements().

int QUESO::Map::m_numMyElements
private

Number of elements owned by the calling processor.

Definition at line 122 of file Map.h.

Referenced by copy(), and NumMyElements().


The documentation for this class was generated from the following files:

Generated on Tue Jun 5 2018 19:49:10 for queso-0.57.1 by  doxygen 1.8.5