Epetra_SerialComm.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_SERIALCOMM_H
00033 #define EPETRA_SERIALCOMM_H
00034 
00035 #include "Epetra_Object.h"
00036 #include "Epetra_Comm.h"
00037 #include "Epetra_SerialCommData.h"
00038 class Epetra_Distributor;
00039 
00041 
00045 class Epetra_SerialComm: public Epetra_Object, public virtual Epetra_Comm {
00046     
00047   public:
00049 
00050 
00052 
00057   Epetra_SerialComm();
00058 
00059 
00061 
00063   Epetra_SerialComm(const Epetra_SerialComm& Comm);
00064 
00066   Epetra_Comm * Clone() const {
00067     return(dynamic_cast<Epetra_Comm *>(new Epetra_SerialComm(*this)));
00068   };
00069 
00071 
00076   virtual ~Epetra_SerialComm();
00078 
00080 
00081 
00082 
00084   void Barrier() const;
00086 
00088 
00089 
00090 
00101   int Broadcast(double * MyVals, int Count, int Root) const;
00102 
00104 
00115   int Broadcast(int * MyVals, int Count, int Root) const;
00116 
00118 
00129   int Broadcast(long * MyVals, int Count, int Root) const;
00131 
00133 
00134 
00135 
00144   int GatherAll(double * MyVals, double * AllVals, int Count) const;
00145 
00147 
00156   int GatherAll(int * MyVals, int * AllVals, int Count) const;
00157 
00159 
00168   int GatherAll(long * MyVals, long * AllVals, int Count) const;
00170 
00172 
00173 
00174 
00184   int SumAll(double * PartialSums, double * GlobalSums, int Count) const;
00185 
00187 
00196   int SumAll(int * PartialSums, int * GlobalSums, int Count) const;
00197 
00199 
00208   int SumAll(long * PartialSums, long * GlobalSums, int Count) const;
00210 
00212 
00213 
00214 
00223   int MaxAll(double * PartialMaxs, double * GlobalMaxs, int Count) const;
00224 
00226 
00235   int MaxAll(int * PartialMaxs, int * GlobalMaxs, int Count) const;
00236 
00238 
00247   int MaxAll(long * PartialMaxs, long * GlobalMaxs, int Count) const;
00248 
00250 
00259   int MinAll(double * PartialMins, double * GlobalMins, int Count) const;
00260 
00262 
00271   int MinAll(int * PartialMins, int * GlobalMins, int Count) const;
00272 
00274 
00283   int MinAll(long * PartialMins, long * GlobalMins, int Count) const;
00285 
00287 
00288 
00289 
00297   int ScanSum(double * MyVals, double * ScanSums, int Count) const;
00298 
00300 
00308   int ScanSum(int * MyVals, int * ScanSums, int Count) const;
00309 
00311 
00319   int ScanSum(long * MyVals, long * ScanSums, int Count) const;
00321 
00323 
00324   
00326 
00329   int MyPID() const {return(SerialCommData_->MyPID_);};
00330   
00332   int NumProc() const {return(SerialCommData_->NumProc_);};
00333 
00335 
00337 
00338 
00339   Epetra_Distributor * CreateDistributor() const;
00341   Epetra_Directory * CreateDirectory(const Epetra_BlockMap & Map) const;
00343 
00345 
00346 
00347   inline void Print(ostream & os) const {
00348     os << "::Processor "<< MyPID()<<" of " << NumProc() << " total processors."; 
00349     return; 
00350   }
00352   void PrintInfo(ostream & os) const {
00353     Epetra_SerialComm::Print(os);
00354     return;
00355   };
00357 
00359 
00360 
00362 
00363   int ReferenceCount() const;
00364 
00366 
00367   const Epetra_SerialCommData * DataPtr() const {return(SerialCommData_);};
00368 
00370 
00372   Epetra_SerialComm & operator=(const Epetra_SerialComm & Comm);
00373 
00374  private:
00375 
00376   void CleanupData();
00377   Epetra_SerialCommData * SerialCommData_;
00378   
00379 };
00380 #endif /* EPETRA_SERIALCOMM_H */

Generated on Thu Sep 18 12:37:58 2008 for Epetra Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1