62 #include "../../test/epetra_test_err.h"
69 int main(
int argc,
char *argv[]) {
74 MPI_Init( &argc, &argv );
79 if( argc < 2 || argc > 3 )
81 cout <<
"Usage: " << argv[0] <<
" [-v] base_name \n"
82 <<
"\t{ Files: base_name_matrix contains matrix-market data and \n"
83 <<
"\t base_name_map contains the needed map.\n" << endl;
89 if(argv[loc][0]==
'-' && argv[loc][1]==
'v')
90 { verbose =
true; ++loc; }
98 int MyPID = Comm.
MyPID();
100 bool verbose1 =
false;
101 if(verbose) verbose1 = (MyPID==0);
108 string filename1(argv[loc++]);
109 string filename2 = filename1 +
"_map";
110 filename1 +=
"_matrix";
112 if(verbose1) cout <<
"Reading Epetra_BlockMap from file : " << filename2;
115 if(verbose1) cout <<
" Done." << endl;
117 if(verbose1) cout <<
"Converting Epetra_BlockMap to Epetra_Map ... ";
123 if(verbose1) cout <<
" Done." << endl;
125 if(verbose1) cout <<
"Reading Epetra_CrsMatrix from file : " << filename1;
128 if(verbose1) cout <<
" Done." << endl;
132 if(verbose) cout << Comm << endl << flush;
179 if( verbose ) cout <<
"Parallel Map Coloring 1!\n";
186 if( verbose ) cout <<
"Parallel Map Coloring 2!\n";
207 vector<Epetra_IntVector> & ColIndices = MapColoringIndexTransform( *A );
213 cout <<
"***************************************\n";
214 cout <<
"Column Indexing by Color:\n";
215 cout <<
"***************************************\n";
217 for(
int i = 0; i < NumColors; ++i )
219 cout <<
"COLOR: " << ListOfColors[i] << endl;
220 cout << ColIndices[i];
int NumGlobalElements() const
int MyGlobalElements(int *MyGlobalElementList) const
std::string EpetraExt_Version()
int FillComplete(bool OptimizeDataStorage=true)
int main(int argc, char **argv)
int NumMyElements() const
int MatrixMarketFileToCrsMatrix(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&A)
int * ListOfColors() const
const Epetra_Comm & Comm() const
void printColoring(const Epetra_MapColoring &ColorMap, Epetra_CrsGraph *A, bool verbose)
Map Coloring of independent columns in a Graph.
const Epetra_CrsGraph & Graph() const
int MatrixMarketFileToBlockMap(const char *filename, const Epetra_Comm &comm, Epetra_BlockMap *&map)
Constructs an Epetra_BlockMap object from a Matrix Market format file.