48 #include "Epetra_Comm.h"
49 #include "Epetra_BlockMap.h"
50 #include "Epetra_Map.h"
51 #include "Teuchos_ParameterList.hpp"
53 static const std::string
PrintMsg_ =
"(Ifpack_OvPartitioner) ";
112 cout <<
PrintMsg_ <<
"Number of global parts = "
157 std::vector<int> sizes;
164 for (
int i = 0 ; i <
NumMyRows() ; ++i) {
166 cerr <<
"ERROR: Partition[" << i <<
"] = "<<
Partition_[i]
167 <<
", NumLocalParts = " << NumLocalParts_ << endl;
168 cerr <<
"(file = " << __FILE__ <<
", line = "
169 << __LINE__ <<
")" << endl;
181 Parts_[i].resize(sizes[i]);
188 for (
int i = 0 ; i <
NumMyRows() ; ++i) {
190 int count = sizes[part];
201 std::vector<std::vector<int> > tmp;
202 tmp.resize(NumLocalParts_);
209 std::vector<int> Indices;
210 Indices.resize(MaxNumEntries_tmp);
214 for (
int i = 0; i < (int)
Parts_[part].size() ; ++i) {
216 int LRID =
Parts_[part][i];
219 NumIndices, &Indices[0]);
222 for (
int j = 0 ; j < NumIndices ; ++j) {
225 int col = Indices[j];
230 std::vector<int>::iterator
231 where =
find(tmp[part].begin(), tmp[part].
end(), col);
233 if (where == tmp[part].
end()) {
234 tmp[part].push_back(col);
242 Parts_[i].resize(tmp[i].size());
243 for (
int j = 0 ; j < (int)tmp[i].size() ; ++j)
265 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
296 os <<
"================================================================================" << endl;
297 os <<
"Ifpack_OverlappingPartitioner" << endl;
303 os <<
"================================================================================" << endl;
virtual int SetParameters(Teuchos::ParameterList &List)
Sets all the parameters for the partitioner.
virtual ~Ifpack_OverlappingPartitioner()
Destructor.
virtual int Compute()
Computes the partitions. Returns 0 if successful.
virtual int ExtractMyRowCopy(int MyRow, int LenOfIndices, int &NumIndices, int *Indices) const =0
Extracts a copy of input local row.
virtual int NumMyRows() const =0
Returns the number of local rows.
virtual int SetPartitionParameters(Teuchos::ParameterList &List)=0
Sets all the parameters for the partitioner.
int MaxNumEntries() const
Returns the max number of local entries in a row.
Ifpack_OverlappingPartitioner(const Ifpack_Graph *Graph)
Constructor.
int NumMyNonzeros() const
Returns the number of local nonzero elements.
T & get(ParameterList &l, const std::string &name)
int NumMyRows() const
Returns the number of local rows.
std::vector< int > Partition_
Partition_[i] contains the ID of non-overlapping part it belongs to.
int OverlappingLevel_
Overlapping level.
virtual int ComputeOverlappingPartitions()
Computes the partitions. Returns 0 if successful.
virtual int NumMyNonzeros() const =0
Returns the number of local nonzero entries.
virtual bool Filled() const =0
Returns true is graph is filled.
bool IsComputed_
If true, the graph has been successfully partitioned.
virtual long long NumGlobalRows64() const =0
virtual int NumGlobalRows() const =0
Returns the number of global rows.
bool verbose_
If true, information are reported on cout.
virtual const Epetra_Comm & Comm() const =0
Returns the communicator object of the graph.
adjacency_list< vecS, vecS, undirectedS, no_property, property< edge_weight_t, double > > Graph
const Ifpack_Graph * Graph_
Reference to the graph to be partitioned.
int NumLocalParts_
Number of local subgraphs.
virtual int NumProc() const =0
virtual int MaxMyNumEntries() const =0
Returns the maximun number of entries for row.
virtual int ComputePartitions()=0
Computes the partitions. Returns 0 if successful.
int NumLocalParts() const
Returns the number of computed local partitions.
Ifpack_Graph: a pure virtual class that defines graphs for IFPACK.
virtual long long NumGlobalCols64() const =0
virtual std::ostream & Print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
long long NumGlobalRows64() const
const Epetra_Comm & Comm() const
Returns the communicator object of Graph.
std::vector< std::vector< int > > Parts_
Parts_[i][j] is the ID of the j-th row contained in the (overlapping)
#define IFPACK_CHK_ERR(ifpack_err)
static bool find(Parser_dh p, char *option, OptionsNode **ptr)
static const std::string PrintMsg_
int NumGlobalRows() const
Returns the number of global rows.