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;
00130 
00132 
00143   int Broadcast(char * MyVals, int Count, int Root) const;
00145 
00147 
00148 
00149 
00158   int GatherAll(double * MyVals, double * AllVals, int Count) const;
00159 
00161 
00170   int GatherAll(int * MyVals, int * AllVals, int Count) const;
00171 
00173 
00182   int GatherAll(long * MyVals, long * AllVals, int Count) const;
00184 
00186 
00187 
00188 
00198   int SumAll(double * PartialSums, double * GlobalSums, int Count) const;
00199 
00201 
00210   int SumAll(int * PartialSums, int * GlobalSums, int Count) const;
00211 
00213 
00222   int SumAll(long * PartialSums, long * GlobalSums, int Count) const;
00224 
00226 
00227 
00228 
00237   int MaxAll(double * PartialMaxs, double * GlobalMaxs, int Count) const;
00238 
00240 
00249   int MaxAll(int * PartialMaxs, int * GlobalMaxs, int Count) const;
00250 
00252 
00261   int MaxAll(long * PartialMaxs, long * GlobalMaxs, int Count) const;
00262 
00264 
00273   int MinAll(double * PartialMins, double * GlobalMins, int Count) const;
00274 
00276 
00285   int MinAll(int * PartialMins, int * GlobalMins, int Count) const;
00286 
00288 
00297   int MinAll(long * PartialMins, long * GlobalMins, int Count) const;
00299 
00301 
00302 
00303 
00311   int ScanSum(double * MyVals, double * ScanSums, int Count) const;
00312 
00314 
00322   int ScanSum(int * MyVals, int * ScanSums, int Count) const;
00323 
00325 
00333   int ScanSum(long * MyVals, long * ScanSums, int Count) const;
00335 
00337 
00338   
00340 
00343   int MyPID() const {return(SerialCommData_->MyPID_);};
00344   
00346   int NumProc() const {return(SerialCommData_->NumProc_);};
00347 
00349 
00351 
00352 
00353   Epetra_Distributor * CreateDistributor() const;
00355   Epetra_Directory * CreateDirectory(const Epetra_BlockMap & Map) const;
00357 
00359 
00360 
00361   inline void Print(ostream & os) const {
00362     os << "::Processor "<< MyPID()<<" of " << NumProc() << " total processors."; 
00363     return; 
00364   }
00366   void PrintInfo(ostream & os) const {
00367     Epetra_SerialComm::Print(os);
00368     return;
00369   };
00371 
00373 
00374 
00376 
00377   int ReferenceCount() const;
00378 
00380 
00381   const Epetra_SerialCommData * DataPtr() const {return(SerialCommData_);};
00382 
00384 
00386   Epetra_SerialComm & operator=(const Epetra_SerialComm & Comm);
00387 
00388  private:
00389 
00390   void CleanupData();
00391   Epetra_SerialCommData * SerialCommData_;
00392   
00393 };
00394 #endif /* EPETRA_SERIALCOMM_H */

Generated on Wed May 12 21:41:05 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7