54 #include "Trilinos_Util.h"
68 int main(
int argc,
char *argv[]) {
71 MPI_Init(&argc,&argv);
77 int MyPID = Comm.
MyPID();
80 if (MyPID==0) verbose =
true;
87 if(argc < 2 && verbose) {
88 cerr <<
"Usage: " << argv[0]
89 <<
" HB_filename" << endl;
106 Trilinos_Util_ReadHb2Epetra(argv[1], Comm, readMap, readA, readx, readb, readxexact);
120 x.Export(*readx, exporter,
Add);
121 b.Export(*readb, exporter,
Add);
122 xexact.Export(*readxexact, exporter,
Add);
124 double vectorRedistributeTime = FillTimer.
ElapsedTime();
125 A.Export(*readA, exporter,
Add);
127 double matrixRedistributeTime = FillTimer.
ElapsedTime() - vectorRedistributeTime;
130 double fillCompleteTime = FillTimer.
ElapsedTime() - matrixRedistributeTime;
131 if (Comm.
MyPID()==0) {
132 cout <<
"\n\n****************************************************" << endl;
133 cout <<
"\n Vector redistribute time (sec) = " << vectorRedistributeTime<< endl;
134 cout <<
" Matrix redistribute time (sec) = " << matrixRedistributeTime << endl;
135 cout <<
" Transform to Local time (sec) = " << fillCompleteTime << endl<< endl;
139 readA->
Multiply(
false, *readxexact, tmp1);
143 tmp1.Norm2(&residual);
144 if (verbose) cout <<
"Norm of Ax from file = " << residual << endl;
145 tmp2.Norm2(&residual);
146 if (verbose) cout <<
"Norm of Ax after redistribution = " << residual << endl << endl << endl;
int NumGlobalElements() const
int Multiply(bool TransA, const Epetra_Vector &x, Epetra_Vector &y) const
double ElapsedTime(void) const
std::string EpetraExt_Version()
int FillComplete(bool OptimizeDataStorage=true)
int main(int argc, char **argv)
int RowMatrixToMatrixMarketFile(const char *filename, const Epetra_RowMatrix &A, const char *matrixName, const char *matrixDescription, bool writeHeader)
Writes an Epetra_RowMatrix object to a Matrix Market format file.