54#include "../epetra_test_err.h"
59int 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);
199 delete [] MyGlobalElementsLL;
201 delete [] MyIntGlobalElementsLL;
202 delete [] MyGlobalElementsInt;
204 delete [] MyLLGlobalElementsInt;
std::string Epetra_Version()
bool GlobalIndicesInt() const
Returns true if map create with int NumGlobalElements.
bool GlobalIndicesLongLong() const
Returns true if map create with long long NumGlobalElements.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
int FillComplete(bool OptimizeDataStorage=true)
Signal that data entry is complete. Perform transformations to local index space.
bool IndicesAreLocal() const
If matrix indices has been transformed to local, this query returns true, otherwise it returns false.
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.
bool IndicesAreGlobal() const
If matrix indices has not been transformed to local, this query returns true, otherwise it returns fa...
Epetra_Map: A class for partitioning vectors and matrices.
Epetra_MpiComm: The Epetra MPI Communication Class.
int Broadcast(double *MyVals, int Count, int Root) const
Epetra_MpiComm Broadcast function.
int NumProc() const
Returns total number of processes.
int MyPID() const
Return my process ID.
static void SetTracebackMode(int TracebackModeValue)
Set the value of the Epetra_Object error traceback report mode.
Epetra_SerialComm: The Epetra Serial Communication Class.
#define EPETRA_TEST_ERR(a, b)
int main(int argc, char *argv[])