EpetraExt Development
EpetraExt_MultiSerialComm.h
Go to the documentation of this file.
00001 //@HEADER
00002 // ***********************************************************************
00003 //
00004 //     EpetraExt: Epetra Extended - Linear Algebra Services Package
00005 //                 Copyright (2011) Sandia Corporation
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00038 //
00039 // ***********************************************************************
00040 //@HEADER
00041 
00042 #ifndef EPETRAEXT_MULTISERIALCOMM_H
00043 #define EPETRAEXT_MULTISERIALCOMM_H
00044 
00045 #include "EpetraExt_ConfigDefs.h"
00046 #include "EpetraExt_MultiComm.h" 
00047 #include "Epetra_SerialComm.h" 
00048 #include "Teuchos_RCP.hpp"
00049 
00054 
00064 namespace EpetraExt {
00065 
00066 class MultiSerialComm: public EpetraExt::MultiComm {
00067  public:
00068 
00070 
00071 
00080   MultiSerialComm(int numTimeSteps_=-1);
00081   
00083   MultiSerialComm( const MultiSerialComm &MSC );
00084 
00086   virtual ~MultiSerialComm();
00088   
00090   virtual Epetra_Comm& SubDomainComm() const {return *subComm;}
00091 
00093   virtual Epetra_Comm& TimeDomainComm() const { return *subComm; }
00094 
00096   virtual int NumSubDomains() const {return 1;}
00097 
00099   virtual int SubDomainRank() const {return 0;}
00100 
00102   virtual int NumTimeDomains() const { return 1; }
00103 
00105   virtual int TimeDomainRank() const { return 0; }
00106 
00108   virtual int NumTimeStepsOnDomain() const {return numTimeSteps;}
00109   virtual int FirstTimeStepOnDomain() const {return 0;}
00110 
00112   virtual int NumTimeSteps() const {return numTimeSteps;}
00113 
00115   //  be set later than the MultiLevel parallelism is set up.
00116   void ResetNumTimeSteps(int numTimeSteps);
00117 
00118   virtual Epetra_Comm * Clone() const  { return myComm->Clone(); };
00119   virtual void Barrier() const { myComm->Barrier(); };
00120   virtual int Broadcast(double * MyVals, int Count, int Root) const
00121           { return myComm->Broadcast( MyVals, Count, Root); };
00122   virtual int Broadcast(int * MyVals, int Count, int Root) const
00123           { return myComm->Broadcast( MyVals, Count, Root); };
00124   virtual int Broadcast(long * MyVals, int Count, int Root) const
00125           { return myComm->Broadcast( MyVals, Count, Root); };
00126   virtual int Broadcast(long long * MyVals, int Count, int Root) const
00127           { return myComm->Broadcast( MyVals, Count, Root); };
00128   virtual int Broadcast(char * MyVals, int Count, int Root) const
00129           { return myComm->Broadcast( MyVals, Count, Root); };
00130   virtual int GatherAll(double * MyVals, double * AllVals, int Count) const
00131           { return myComm->GatherAll( MyVals,  AllVals, Count); };
00132   virtual int GatherAll(int * MyVals, int * AllVals, int Count) const
00133           { return myComm->GatherAll( MyVals, AllVals, Count); };
00134   virtual int GatherAll(long * MyVals, long * AllVals, int Count) const
00135           { return myComm->GatherAll( MyVals,  AllVals, Count); };
00136   virtual int GatherAll(long long* MyVals, long long* AllVals, int Count) const
00137           { return myComm->GatherAll( MyVals,  AllVals, Count); };
00138   virtual int SumAll(double * PartialSums, double * GlobalSums, int Count) const
00139           { return myComm->SumAll( PartialSums,  GlobalSums, Count); };
00140   virtual int SumAll(int * PartialSums, int * GlobalSums, int Count) const
00141           { return myComm->SumAll( PartialSums,  GlobalSums, Count); };
00142   virtual int SumAll(long * PartialSums, long * GlobalSums, int Count) const
00143           { return myComm->SumAll( PartialSums,  GlobalSums, Count); };
00144   virtual int SumAll(long long* PartialSums, long long* GlobalSums, int Count) const
00145           { return myComm->SumAll( PartialSums,  GlobalSums, Count); };
00146   virtual int MaxAll(double * PartialMaxs, double * GlobalMaxs, int Count) const
00147           { return myComm->MaxAll( PartialMaxs,  GlobalMaxs, Count); };
00148   virtual int MaxAll(int * PartialMaxs, int * GlobalMaxs, int Count) const
00149           { return myComm->MaxAll( PartialMaxs,  GlobalMaxs, Count); };
00150   virtual int MaxAll(long * PartialMaxs, long * GlobalMaxs, int Count) const
00151           { return myComm->MaxAll( PartialMaxs, GlobalMaxs, Count); };
00152   virtual int MaxAll(long long* PartialMaxs, long long* GlobalMaxs, int Count) const
00153           { return myComm->MaxAll( PartialMaxs,  GlobalMaxs, Count); };
00154   virtual int MinAll(double * PartialMins, double * GlobalMins, int Count) const
00155           { return myComm->MinAll( PartialMins, GlobalMins, Count); };
00156   virtual int MinAll(int * PartialMins, int * GlobalMins, int Count) const
00157           { return myComm->MinAll( PartialMins, GlobalMins, Count); };
00158   virtual int MinAll(long * PartialMins, long * GlobalMins, int Count)const
00159           { return myComm->MinAll( PartialMins, GlobalMins, Count); };
00160   virtual int MinAll(long long* PartialMins, long long* GlobalMins, int Count) const
00161           { return myComm->MinAll( PartialMins, GlobalMins, Count); };
00162   virtual int ScanSum(double * MyVals, double * ScanSums, int Count)const
00163           { return myComm->ScanSum( MyVals,  ScanSums, Count); };
00164   virtual int ScanSum(int * MyVals, int * ScanSums, int Count) const
00165           { return myComm->ScanSum(MyVals, ScanSums, Count); };
00166   virtual int ScanSum(long * MyVals, long * ScanSums, int Count) const
00167           { return myComm->ScanSum(MyVals, ScanSums, Count); };
00168   virtual int ScanSum(long long* MyVals, long long* ScanSums, int Count) const
00169           { return myComm->ScanSum(MyVals, ScanSums, Count); };
00170   virtual int MyPID() const { return myComm->MyPID(); };
00171   virtual int NumProc() const { return myComm->NumProc(); };
00172   virtual Epetra_Distributor * CreateDistributor() const { return myComm->CreateDistributor(); };
00173   virtual Epetra_Directory * CreateDirectory(const Epetra_BlockMap & Map) const 
00174           { return myComm->CreateDirectory(Map); };
00175   virtual void PrintInfo(ostream & os) const { myComm->PrintInfo( os); };
00176 
00177  protected:
00178 
00179   Teuchos::RCP<Epetra_Comm> myComm;
00180   Epetra_SerialComm* subComm; 
00181   int numTimeSteps;
00182 };
00183 
00184 } //namespace EpetraExt
00185 
00186 #endif /* EPETRAEXT_MULTISERIALCOMM_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines