45 long long *MyGlobalElements,
long long IndexBase,
Epetra_Comm& Comm,
46 bool DistributedGlobal)
48 int i, ierr=0, forierr = 0;
56 int *MyElementSizeList =
new int[NumMyElements];
61 for (i=0; i<NumMyElements; i++) forierr += MyElementSizeList[i]!=1;
64 delete [] MyElementSizeList;
85 long long MaxMyGID = (Comm.
MyPID()+1)*NumMyElements-1+IndexBase;
86 if (Comm.
MyPID()>2) MaxMyGID+=3;
87 if (!DistributedGlobal) MaxMyGID = NumMyElements-1+IndexBase;
96 long long MinMyGID = Comm.
MyPID()*NumMyElements+IndexBase;
97 if (Comm.
MyPID()>2) MinMyGID+=3;
98 if (!DistributedGlobal) MinMyGID = 0;
101 long long * MyGlobalElements1 =
new long long[NumMyElements];
105 if (MyGlobalElements==0)
107 for (i=0; i<NumMyElements; i++)
108 forierr += MyGlobalElements1[i]!=MinMyGID+i;
112 for (i=0; i<NumMyElements; i++)
113 forierr += MyGlobalElements[i]!=MyGlobalElements1[i];
124 long long MaxMyGID2 = Map.
GID64(Map.
LID(MaxMyGID));
126 int MaxLID2 = Map.
LID(Map.
GID64(MaxLID));
146 int TotalNumEle, NumElePerProc, NumProc = Comm.
NumProc();
149 Comm.
MinAll(&NumMyEle,&MinNumEleOnProc,1);
150 if (MinNumEleOnProc > 5) NumElePerProc = 6;
151 else NumElePerProc = MinNumEleOnProc;
152 if (NumElePerProc > 0) {
153 TotalNumEle = NumElePerProc*NumProc;
154 long long * MyGIDlist =
new long long[NumElePerProc];
155 long long * GIDlist =
new long long[TotalNumEle];
156 int * PIDlist =
new int[TotalNumEle];
157 int * LIDlist =
new int[TotalNumEle];
158 for (i=0; i<NumElePerProc; i++)
159 MyGIDlist[i] = MyGlobalElements1[i];
160 Comm.
GatherAll(MyGIDlist,GIDlist,NumElePerProc);
161 Map.
RemoteIDList(TotalNumEle, GIDlist, PIDlist, LIDlist);
162 int MyPID= Comm.
MyPID();
165 for (i=0; i<TotalNumEle; i++) {
166 if (Map.
MyGID(GIDlist[i])) {
167 forierr += PIDlist[i] != MyPID;
168 forierr += !Map.
MyLID(Map.
LID(GIDlist[i])) || Map.
LID(GIDlist[i]) != LIDlist[i] || Map.
GID64(LIDlist[i]) != GIDlist[i];
171 forierr += PIDlist[i] == MyPID;
182 delete [] MyGlobalElements1;
188 long long * GIDList =
new long long[3];
189 int * PIDList =
new int[3];
190 int * LIDList =
new int[3];
int MinLID() const
The minimum local index value on the calling processor.
int MyGlobalElements(int *MyGlobalElementList) const
Puts list of global elements on this processor into the user-provided array.
Epetra_Map: A class for partitioning vectors and matrices.
bool MyLID(int lid) const
Returns true if the LID passed in belongs to the calling processor in this map, otherwise returns fal...
long long MinMyGID64() const
int MinElementSize() const
Minimum element size across all processors.
bool DistributedGlobal() const
Returns true if map is defined across more than one processor.
bool ConstantElementSize() const
Returns true if map has constant element size.
virtual int GatherAll(double *MyVals, double *AllVals, int Count) const =0
Epetra_Comm All Gather function.
#define EPETRA_TEST_ERR(a, b)
virtual int MinAll(double *PartialMins, double *GlobalMins, int Count) const =0
Epetra_Comm Global Min function.
long long NumGlobalElements64() const
virtual int MyPID() const =0
Return my process ID.
int * ElementSizeList() const
List of the element sizes corresponding to the array MyGlobalElements().
long long MaxAllGID64() const
long long NumGlobalPoints64() const
bool MyGID(int GID_in) const
Returns true if the GID passed in belongs to the calling processor in this map, otherwise returns fal...
Epetra_Comm: The Epetra Communication Abstract Base Class.
long long GID64(int LID) const
int MaxLID() const
The maximum local index value on the calling processor.
int NumMyElements() const
Number of elements on the calling processor.
int ElementSize() const
Returns the size of elements in the map; only valid if map has constant element size.
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
int RemoteIDList(int NumIDs, const int *GIDList, int *PIDList, int *LIDList) const
Returns the processor IDs and corresponding local index value for a given list of global indices...
int LID(int GID) const
Returns local ID of global ID, return -1 if not found on this processor.
long long IndexBase64() const
long long MinAllGID64() const
virtual int NumProc() const =0
Returns total number of processes.
int MaxElementSize() const
Maximum element size across all processors.
int checkmap(Epetra_Map &Map, long long NumGlobalElements, int NumMyElements, long long *MyGlobalElements, long long IndexBase, Epetra_Comm &Comm, bool DistributedGlobal)
long long MaxMyGID64() const
int NumMyPoints() const
Number of local points for this map; equals the sum of all element sizes on the calling processor...
bool LinearMap() const
Returns true if the global ID space is contiguously divided (but not necessarily uniformly) across al...