54 #include "../epetra_test_err.h"
59 int main(
int argc,
char *argv[])
67 MPI_Init(&argc,&argv);
70 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
83 if (argc>1)
if (argv[1][0]==
'-' && argv[1][1]==
'v') verbose =
true;
85 int verbose_int = verbose ? 1 : 0;
87 verbose = verbose_int==1 ?
true :
false;
96 int MyPID = Comm.
MyPID();
99 if(verbose && MyPID==0)
102 if (verbose) cout <<
"Processor "<<MyPID<<
" of "<< NumProc
103 <<
" is alive."<<endl;
108 if(verbose && rank!=0) verbose =
false;
110 int NumMyEquations = 1;
111 long long NumGlobalEquations = NumProc;
114 long long* MyGlobalElementsLL =
new long long[NumMyEquations];
116 MyGlobalElementsLL[0] = 2000000000+MyPID;
120 Epetra_Map MapLL(NumGlobalEquations, NumMyEquations, MyGlobalElementsLL, 0, Comm);
128 int* NumNzLL =
new int[NumMyEquations];
132 int* MyIntGlobalElementsLL =
new int[NumMyEquations];
133 MyIntGlobalElementsLL[0] = 20000+MyPID;
142 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
159 int* MyGlobalElementsInt =
new int[NumMyEquations];
161 MyGlobalElementsInt[0] = 2000+MyPID;
166 int* NumNzInt =
new int[NumMyEquations];
170 long long* MyLLGlobalElementsInt =
new long long[NumMyEquations];
171 MyLLGlobalElementsInt[0] = 2000000000+MyPID;
173 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
176 Epetra_Map MapInt(NumGlobalEquations, NumMyEquations, MyGlobalElementsInt, 0LL, Comm);
188 A_Int.InsertGlobalValues(MyLLGlobalElementsInt[0], 1, &one, MyLLGlobalElementsInt+0);
193 EPETRA_TEST_ERR(!(A_Int.InsertGlobalValues(MyGlobalElementsInt[0], 1, &one, MyGlobalElementsInt+0)==0),ierr);
199 delete [] MyGlobalElementsLL;
201 delete [] MyIntGlobalElementsLL;
202 delete [] MyGlobalElementsInt;
204 delete [] MyLLGlobalElementsInt;
Epetra_Map: A class for partitioning vectors and matrices.
bool GlobalIndicesLongLong() const
Returns true if map create with long long NumGlobalElements.
#define EPETRA_TEST_ERR(a, b)
virtual int InsertGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
Insert a list of elements in a given global row of the matrix.
static void SetTracebackMode(int TracebackModeValue)
Set the value of the Epetra_Object error traceback report mode.
bool GlobalIndicesInt() const
Returns true if map create with int NumGlobalElements.
int MyPID() const
Return my process ID.
Epetra_MpiComm: The Epetra MPI Communication Class.
std::string Epetra_Version()
bool IndicesAreLocal() const
If matrix indices has been transformed to local, this query returns true, otherwise it returns false...
int FillComplete(bool OptimizeDataStorage=true)
Signal that data entry is complete. Perform transformations to local index space. ...
int NumProc() const
Returns total number of processes (always returns 1 for SerialComm).
Epetra_SerialComm: The Epetra Serial Communication Class.
bool IndicesAreGlobal() const
If matrix indices has not been transformed to local, this query returns true, otherwise it returns fa...
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
int main(int argc, char *argv[])
int Broadcast(double *MyVals, int Count, int Root) const
Epetra_SerialComm Broadcast function.