|
EpetraExt Development
|
00001 //@HEADER 00002 /* 00003 ************************************************************************ 00004 00005 EpetraExt: Extended Linear Algebra Services Package 00006 Copyright (2001) Sandia Corporation 00007 00008 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00009 license for use of this work by or on behalf of the U.S. Government. 00010 00011 This library is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU Lesser General Public License as 00013 published by the Free Software Foundation; either version 2.1 of the 00014 License, or (at your option) any later version. 00015 00016 This library is distributed in the hope that it will be useful, but 00017 WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 Lesser General Public License for more details. 00020 00021 You should have received a copy of the GNU Lesser General Public 00022 License along with this library; if not, write to the Free Software 00023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00024 USA 00025 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00026 00027 ************************************************************************ 00028 */ 00029 //@HEADER 00030 00031 #ifndef EPETRAEXT_MULTICOMM_H 00032 #define EPETRAEXT_MULTICOMM_H 00033 00034 #include "EpetraExt_ConfigDefs.h" 00035 #include "Epetra_Comm.h" 00036 #include "Teuchos_RCP.hpp" 00037 00042 00052 namespace EpetraExt { 00053 00054 class MultiComm: public Epetra_Comm { 00055 public: 00056 00057 MultiComm(Teuchos::RCP<Epetra_Comm> epetra_comm) : myComm(epetra_comm) {}; 00058 00060 virtual ~MultiComm() {}; 00062 00064 virtual Epetra_Comm& SubDomainComm() const = 0; 00065 00067 virtual int NumSubDomains() const {return numSubDomains;} 00068 00070 virtual int SubDomainRank() const {return subDomainRank;} 00071 00073 virtual int NumTimeStepsOnDomain() const {return numTimeStepsOnDomain;} 00074 virtual int FirstTimeStepOnDomain() const {return firstTimeStepOnDomain;} 00075 00077 virtual int NumTimeSteps() const {return numTimeSteps;} 00078 00080 // be set later than the MultiLevel parallelism is set up. 00081 virtual void ResetNumTimeSteps(int numTimeSteps) = 0; 00082 00084 // This avoids diamond inheritance for MultiMpiComm 00085 virtual Epetra_Comm * Clone() const { return myComm->Clone(); }; 00086 virtual void Barrier() const { myComm->Barrier(); }; 00087 virtual int Broadcast(double * MyVals, int Count, int Root) const 00088 { return myComm->Broadcast( MyVals, Count, Root); }; 00089 virtual int Broadcast(int * MyVals, int Count, int Root) const 00090 { return myComm->Broadcast( MyVals, Count, Root); }; 00091 virtual int Broadcast(long * MyVals, int Count, int Root) const 00092 { return myComm->Broadcast( MyVals, Count, Root); }; 00093 virtual int Broadcast(char * MyVals, int Count, int Root) const 00094 { return myComm->Broadcast( MyVals, Count, Root); }; 00095 virtual int GatherAll(double * MyVals, double * AllVals, int Count) const 00096 { return myComm->GatherAll( MyVals, AllVals, Count); }; 00097 virtual int GatherAll(int * MyVals, int * AllVals, int Count) const 00098 { return myComm->GatherAll( MyVals, AllVals, Count); }; 00099 virtual int GatherAll(long * MyVals, long * AllVals, int Count) const 00100 { return myComm->GatherAll( MyVals, AllVals, Count); }; 00101 virtual int SumAll(double * PartialSums, double * GlobalSums, int Count) const 00102 { return myComm->SumAll( PartialSums, GlobalSums, Count); }; 00103 virtual int SumAll(int * PartialSums, int * GlobalSums, int Count) const 00104 { return myComm->SumAll( PartialSums, GlobalSums, Count); }; 00105 virtual int SumAll(long * PartialSums, long * GlobalSums, int Count) const 00106 { return myComm->SumAll( PartialSums, GlobalSums, Count); }; 00107 virtual int MaxAll(double * PartialMaxs, double * GlobalMaxs, int Count) const 00108 { return myComm->MaxAll( PartialMaxs, GlobalMaxs, Count); }; 00109 virtual int MaxAll(int * PartialMaxs, int * GlobalMaxs, int Count) const 00110 { return myComm->MaxAll( PartialMaxs, GlobalMaxs, Count); }; 00111 virtual int MaxAll(long * PartialMaxs, long * GlobalMaxs, int Count) const 00112 { return myComm->MaxAll( PartialMaxs, GlobalMaxs, Count); }; 00113 virtual int MinAll(double * PartialMins, double * GlobalMins, int Count) const 00114 { return myComm->MinAll( PartialMins, GlobalMins, Count); }; 00115 virtual int MinAll(int * PartialMins, int * GlobalMins, int Count) const 00116 { return myComm->MinAll( PartialMins, GlobalMins, Count); }; 00117 virtual int MinAll(long * PartialMins, long * GlobalMins, int Count)const 00118 { return myComm->MinAll( PartialMins, GlobalMins, Count); }; 00119 virtual int ScanSum(double * MyVals, double * ScanSums, int Count)const 00120 { return myComm->ScanSum( MyVals, ScanSums, Count); }; 00121 virtual int ScanSum(int * MyVals, int * ScanSums, int Count) const 00122 { return myComm->ScanSum(MyVals, ScanSums, Count); }; 00123 virtual int ScanSum(long * MyVals, long * ScanSums, int Count) const 00124 { return myComm->ScanSum(MyVals, ScanSums, Count); }; 00125 virtual int MyPID() const { return myComm->MyPID(); }; 00126 virtual int NumProc() const { return myComm->NumProc(); }; 00127 virtual Epetra_Distributor * CreateDistributor() const { return myComm->CreateDistributor(); }; 00128 virtual Epetra_Directory * CreateDirectory(const Epetra_BlockMap & Map) const 00129 { return myComm->CreateDirectory(Map); }; 00130 virtual void PrintInfo(ostream & os) const { myComm->PrintInfo( os); }; 00131 00132 protected: 00133 00134 Teuchos::RCP<Epetra_Comm> myComm; 00135 //Epetra_Comm* subComm; //Needs concrete implementation 00136 int numSubDomains; 00137 int subDomainRank; 00138 int numTimeSteps; 00139 int numTimeStepsOnDomain; 00140 int firstTimeStepOnDomain; 00141 00142 }; 00143 00144 } //namespace EpetraExt 00145 00146 #endif /* EPETRAEXT_MULTICOMM_H */ 00147 00148 00149
1.7.4