15 #ifndef __TPETRA_DISTRIBUTIONMM_HPP
16 #define __TPETRA_DISTRIBUTIONMM_HPP
20 template <
typename gno_t,
typename scalar_t>
21 class DistributionMMFile :
public Distribution<gno_t, scalar_t> {
38 using Distribution<gno_t, scalar_t>::me;
39 using Distribution<gno_t, scalar_t>::np;
40 using Distribution<gno_t, scalar_t>::nrows;
42 DistributionMMFile(
size_t nrows_,
43 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm_,
44 const Teuchos::ParameterList ¶ms)
45 : Distribution<gno_t, scalar_t>(nrows_, comm_, params) {
46 if (me == 0) std::cout <<
"\n MMFile Distribution: "
47 <<
"\n np = " << np << std::endl;
50 inline enum DistributionType DistType() {
return MMFile; }
52 bool Mine(gno_t i, gno_t j) {
53 std::cout <<
"Invalid call to Mine(i,j); "
54 <<
"MMFile-distribution requires use of Mine(i,j,p) providing "
55 <<
"process assignment p." << std::endl;
59 bool Mine(gno_t i, gno_t j,
int oneBasedRank) {
62 if (oneBasedRank < 1 || oneBasedRank > np) {
63 std::cout <<
"Invalid rank " << oneBasedRank
64 <<
" provided in user distribution; "
65 <<
"rank must be in range 1 to " << np << std::endl;
70 if (oneBasedRank - 1 == me && i == j) myVecEntries.insert(i);
72 return (oneBasedRank - 1 == me);
79 inline bool VecMine(gno_t i) {
80 return (myVecEntries.find(i) != myVecEntries.end());
84 std::set<gno_t> myVecEntries;