51 #include "Epetra_MpiComm.h"
52 #include "Epetra_BlockMap.h"
53 #include "Epetra_MultiVector.h"
59 RestrictedMultiVectorWrapper::RestrictedMultiVectorWrapper()
60 : proc_is_active(true),
61 subcomm_is_set(false),
62 MPI_SubComm_(MPI_COMM_NULL),
70 RestrictedMultiVectorWrapper::~RestrictedMultiVectorWrapper() {
72 delete RestrictedComm_;
76 int RestrictedMultiVectorWrapper::SetMPISubComm(MPI_Comm MPI_SubComm){
78 MPI_SubComm_=MPI_SubComm;
delete RestrictedComm_; subcomm_is_set=
true;
86 RestrictedMultiVectorWrapper::
87 restrict_comm (Teuchos::RCP<Epetra_MultiVector> input_mv)
98 if (! InComm || ! InMap) {
102 if (! subcomm_is_set) {
109 color = MPI_UNDEFINED;
112 MPI_Comm_split (InComm->
Comm(), color, InComm->
MyPID(), &MPI_SubComm_);
113 if (err != MPI_SUCCESS) {
120 if (input_mv->MyLength() && MPI_SubComm_ == MPI_COMM_NULL) {
126 if (MPI_SubComm_ == MPI_COMM_NULL) {
127 proc_is_active =
false;
130 proc_is_active =
true;
133 if (proc_is_active) {
135 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
148 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
150 long long Nrows = InMap->NumGlobalElements64 ();
155 InMap->MyGlobalElements64(),
157 InMap->IndexBase64(), *RestrictedComm_);
161 throw "EpetraExt::RestrictedMultiVectorWrapper::restrict_comm ERROR: GlobalIndices type unknown";
166 input_mv_->ExtractView (&A,&LDA);
168 input_mv_->NumVectors ()));
int NumGlobalElements() const
bool GlobalIndicesLongLong() const
int MyGlobalElements(int *MyGlobalElementList) const
bool GlobalIndicesInt() const
int NumMyElements() const
int * ElementSizeList() const