59 RestrictedCrsMatrixWrapper::RestrictedCrsMatrixWrapper()
60 : proc_is_active(true),
61 subcomm_is_set(false),
62 MPI_SubComm_(MPI_COMM_NULL),
72 RestrictedCrsMatrixWrapper::~RestrictedCrsMatrixWrapper() {
75 delete RestrictedComm_;
80 int RestrictedCrsMatrixWrapper::SetMPISubComm(MPI_Comm MPI_SubComm){
82 MPI_SubComm_=MPI_SubComm;
delete RestrictedComm_; subcomm_is_set=
true;
89 template<
typename int_type>
92 input_matrix_=input_matrix;
98 if(!InComm || !InRowMap || !InColMap)
return (-1);
107 else color=MPI_UNDEFINED;
108 MPI_Comm_split(InComm->
Comm(),color,InComm->
MyPID(),&MPI_SubComm_);
113 if (input_matrix->
NumMyRows() && MPI_SubComm_ == MPI_COMM_NULL)
118 if(MPI_SubComm_ == MPI_COMM_NULL) proc_is_active=
false;
119 else proc_is_active=
true;
125 int_type* RowMapGlobalElements = 0;
127 int_type* ColMapGlobalElements = 0;
132 (int_type) InRowMap->
IndexBase64(),*RestrictedComm_);
134 (int_type) InColMap->
IndexBase64(),*RestrictedComm_);
141 for(
int i=0;i<input_matrix_->NumMyRows();i++) {
142 input_matrix_->ExtractMyRowView(i,Nr,values,colind);
143 restricted_matrix_->InsertMyValues(i,Nr,values,colind);
145 restricted_matrix_->FillComplete();
153 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
155 return Trestrict_comm<int>(input_matrix);
159 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
161 return Trestrict_comm<long long>(input_matrix);
165 throw "EpetraExt::Trestrict_comm: ERROR, GlobalIndices type unknown.";
bool GlobalIndicesLongLong() const
long long IndexBase64() const
long long NumGlobalElements64() const
bool GlobalIndicesInt() const
const Epetra_Map & RowMap() const
int NumMyElements() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
int MyGlobalElementsPtr(int *&MyGlobalElementList) const