EpetraExt  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EpetraExt_MultiSerialComm.h
Go to the documentation of this file.
1 //@HEADER
2 // ***********************************************************************
3 //
4 // EpetraExt: Epetra Extended - Linear Algebra Services Package
5 // Copyright (2011) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 //@HEADER
41 
42 #ifndef EPETRAEXT_MULTISERIALCOMM_H
43 #define EPETRAEXT_MULTISERIALCOMM_H
44 
45 #if defined(EpetraExt_SHOW_DEPRECATED_WARNINGS)
46 #ifdef __GNUC__
47 #warning "The EpetraExt package is deprecated"
48 #endif
49 #endif
50 
51 #include "EpetraExt_ConfigDefs.h"
52 #include "EpetraExt_MultiComm.h"
53 #include "Epetra_SerialComm.h"
54 #include "Teuchos_RCP.hpp"
55 
60 
70 namespace EpetraExt {
71 
73  public:
74 
76 
86  MultiSerialComm(int numTimeSteps_=-1);
87 
89  MultiSerialComm( const MultiSerialComm &MSC );
90 
92  virtual ~MultiSerialComm();
94 
96  virtual Epetra_Comm& SubDomainComm() const {return *subComm;}
97 
99  virtual Epetra_Comm& TimeDomainComm() const { return *subComm; }
100 
102  virtual int NumSubDomains() const {return 1;}
103 
105  virtual int SubDomainRank() const {return 0;}
106 
108  virtual int NumTimeDomains() const { return 1; }
109 
111  virtual int TimeDomainRank() const { return 0; }
112 
114  virtual int NumTimeStepsOnDomain() const {return numTimeSteps;}
115  virtual int FirstTimeStepOnDomain() const {return 0;}
116 
118  virtual int NumTimeSteps() const {return numTimeSteps;}
119 
121  // be set later than the MultiLevel parallelism is set up.
123 
124  virtual Epetra_Comm * Clone() const { return myComm->Clone(); };
125  virtual void Barrier() const { myComm->Barrier(); };
126  virtual int Broadcast(double * MyVals, int Count, int Root) const
127  { return myComm->Broadcast( MyVals, Count, Root); };
128  virtual int Broadcast(int * MyVals, int Count, int Root) const
129  { return myComm->Broadcast( MyVals, Count, Root); };
130  virtual int Broadcast(long * MyVals, int Count, int Root) const
131  { return myComm->Broadcast( MyVals, Count, Root); };
132  virtual int Broadcast(long long * MyVals, int Count, int Root) const
133  { return myComm->Broadcast( MyVals, Count, Root); };
134  virtual int Broadcast(char * MyVals, int Count, int Root) const
135  { return myComm->Broadcast( MyVals, Count, Root); };
136  virtual int GatherAll(double * MyVals, double * AllVals, int Count) const
137  { return myComm->GatherAll( MyVals, AllVals, Count); };
138  virtual int GatherAll(int * MyVals, int * AllVals, int Count) const
139  { return myComm->GatherAll( MyVals, AllVals, Count); };
140  virtual int GatherAll(long * MyVals, long * AllVals, int Count) const
141  { return myComm->GatherAll( MyVals, AllVals, Count); };
142  virtual int GatherAll(long long* MyVals, long long* AllVals, int Count) const
143  { return myComm->GatherAll( MyVals, AllVals, Count); };
144  virtual int SumAll(double * PartialSums, double * GlobalSums, int Count) const
145  { return myComm->SumAll( PartialSums, GlobalSums, Count); };
146  virtual int SumAll(int * PartialSums, int * GlobalSums, int Count) const
147  { return myComm->SumAll( PartialSums, GlobalSums, Count); };
148  virtual int SumAll(long * PartialSums, long * GlobalSums, int Count) const
149  { return myComm->SumAll( PartialSums, GlobalSums, Count); };
150  virtual int SumAll(long long* PartialSums, long long* GlobalSums, int Count) const
151  { return myComm->SumAll( PartialSums, GlobalSums, Count); };
152  virtual int MaxAll(double * PartialMaxs, double * GlobalMaxs, int Count) const
153  { return myComm->MaxAll( PartialMaxs, GlobalMaxs, Count); };
154  virtual int MaxAll(int * PartialMaxs, int * GlobalMaxs, int Count) const
155  { return myComm->MaxAll( PartialMaxs, GlobalMaxs, Count); };
156  virtual int MaxAll(long * PartialMaxs, long * GlobalMaxs, int Count) const
157  { return myComm->MaxAll( PartialMaxs, GlobalMaxs, Count); };
158  virtual int MaxAll(long long* PartialMaxs, long long* GlobalMaxs, int Count) const
159  { return myComm->MaxAll( PartialMaxs, GlobalMaxs, Count); };
160  virtual int MinAll(double * PartialMins, double * GlobalMins, int Count) const
161  { return myComm->MinAll( PartialMins, GlobalMins, Count); };
162  virtual int MinAll(int * PartialMins, int * GlobalMins, int Count) const
163  { return myComm->MinAll( PartialMins, GlobalMins, Count); };
164  virtual int MinAll(long * PartialMins, long * GlobalMins, int Count)const
165  { return myComm->MinAll( PartialMins, GlobalMins, Count); };
166  virtual int MinAll(long long* PartialMins, long long* GlobalMins, int Count) const
167  { return myComm->MinAll( PartialMins, GlobalMins, Count); };
168  virtual int ScanSum(double * MyVals, double * ScanSums, int Count)const
169  { return myComm->ScanSum( MyVals, ScanSums, Count); };
170  virtual int ScanSum(int * MyVals, int * ScanSums, int Count) const
171  { return myComm->ScanSum(MyVals, ScanSums, Count); };
172  virtual int ScanSum(long * MyVals, long * ScanSums, int Count) const
173  { return myComm->ScanSum(MyVals, ScanSums, Count); };
174  virtual int ScanSum(long long* MyVals, long long* ScanSums, int Count) const
175  { return myComm->ScanSum(MyVals, ScanSums, Count); };
176  virtual int MyPID() const { return myComm->MyPID(); };
177  virtual int NumProc() const { return myComm->NumProc(); };
178  virtual Epetra_Distributor * CreateDistributor() const { return myComm->CreateDistributor(); };
179  virtual Epetra_Directory * CreateDirectory(const Epetra_BlockMap & Map) const
180  { return myComm->CreateDirectory(Map); };
181  virtual void PrintInfo(std::ostream & os) const { myComm->PrintInfo( os); };
182 
183  protected:
184 
185  Teuchos::RCP<Epetra_Comm> myComm;
188 };
189 
190 } //namespace EpetraExt
191 
192 #endif /* EPETRAEXT_MULTISERIALCOMM_H */
virtual int ScanSum(int *MyVals, int *ScanSums, int Count) const
virtual int MinAll(long *PartialMins, long *GlobalMins, int Count) const
virtual int SumAll(long long *PartialSums, long long *GlobalSums, int Count) const
virtual int Broadcast(long *MyVals, int Count, int Root) const
virtual Epetra_Comm & SubDomainComm() const
Get reference to split Communicator for sub-domain.
virtual int MinAll(double *PartialMins, double *GlobalMins, int Count) const
virtual int GatherAll(long *MyVals, long *AllVals, int Count) const
virtual int Broadcast(double *MyVals, int Count, int Root) const
virtual int NumTimeStepsOnDomain() const
Return number of time steps, first step number, on time domain.
virtual Epetra_Distributor * CreateDistributor() const
virtual int GatherAll(int *MyVals, int *AllVals, int Count) const
virtual int FirstTimeStepOnDomain() const
virtual int ScanSum(double *MyVals, double *ScanSums, int Count) const
virtual Epetra_Directory * CreateDirectory(const Epetra_BlockMap &Map) const
virtual int GatherAll(long long *MyVals, long long *AllVals, int Count) const
virtual int MaxAll(long *PartialMaxs, long *GlobalMaxs, int Count) const
virtual int NumTimeSteps() const
Return total number of time steps.
MultiSerialComm(int numTimeSteps_=-1)
MultiSerialComm constuctor.
virtual int SubDomainRank() const
Return integer [0:numSubDomains-1} corresponding to this sub-domain&#39;s rank.
virtual int SumAll(int *PartialSums, int *GlobalSums, int Count) const
Teuchos::RCP< Epetra_Comm > myComm
virtual int MaxAll(int *PartialMaxs, int *GlobalMaxs, int Count) const
void ResetNumTimeSteps(int numTimeSteps)
Reset total number of time steps, allowing time steps per domain to.
virtual int Broadcast(long long *MyVals, int Count, int Root) const
virtual int Broadcast(char *MyVals, int Count, int Root) const
virtual int ScanSum(long *MyVals, long *ScanSums, int Count) const
virtual Epetra_Comm & TimeDomainComm() const
Get reference to split Communicator for time domain.
virtual int MinAll(long long *PartialMins, long long *GlobalMins, int Count) const
virtual int MinAll(int *PartialMins, int *GlobalMins, int Count) const
virtual int SumAll(double *PartialSums, double *GlobalSums, int Count) const
virtual int TimeDomainRank() const
Return integer [0:numTimeDomains-1} corresponding to this time-domain&#39;s rank.
virtual void PrintInfo(std::ostream &os) const
virtual Epetra_Comm * Clone() const
virtual int NumSubDomains() const
Return number of sub-domains that the global problem is split into.
virtual int Broadcast(int *MyVals, int Count, int Root) const
virtual int MaxAll(double *PartialMaxs, double *GlobalMaxs, int Count) const
virtual int SumAll(long *PartialSums, long *GlobalSums, int Count) const
virtual int GatherAll(double *MyVals, double *AllVals, int Count) const
virtual int ScanSum(long long *MyVals, long long *ScanSums, int Count) const
virtual int MaxAll(long long *PartialMaxs, long long *GlobalMaxs, int Count) const
virtual int NumTimeDomains() const
Return number of time domains that the global problem is split into.