Teuchos_Comm.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //                    Teuchos: Common Tools Package
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef TEUCHOS_COMM_HPP
00030 #define TEUCHOS_COMM_HPP
00031 
00032 #include "Teuchos_ReductionOp.hpp"
00033 
00034 namespace Teuchos {
00035 
00052 template<typename Ordinal>
00053 class Comm : virtual public Describable {
00054 public:
00055   
00057 
00058 
00065   virtual int getRank() const = 0;
00066 
00073   virtual int getSize() const = 0;
00074   
00076 
00078 
00079 
00083   virtual void barrier() const = 0;
00084   
00100   virtual void broadcast(
00101     const int rootRank, const Ordinal bytes, char buffer[]
00102     ) const = 0;
00103 
00124   virtual void gatherAll(
00125     const Ordinal sendBytes, const char sendBuffer[]
00126     ,const Ordinal recvBytes, char recvBuffer[]
00127     ) const = 0;
00128 
00140   virtual void reduceAll(
00141     const ValueTypeReductionOp<Ordinal,char> &reductOp
00142     ,const Ordinal bytes, const char sendBuffer[], char globalReducts[]
00143     ) const = 0;
00144 
00168   virtual void reduceAllAndScatter(
00169     const ValueTypeReductionOp<Ordinal,char> &reductOp
00170     ,const Ordinal sendBytes, const char sendBuffer[]
00171     ,const Ordinal recvCounts[], const Ordinal blockSize, char myGlobalReducts[]
00172     ) const = 0;
00173 
00186   virtual void scan(
00187     const ValueTypeReductionOp<Ordinal,char> &reductOp
00188     ,const Ordinal bytes, const char sendBuffer[], char scanReducts[]
00189     ) const = 0;
00190 
00192 
00193 
00210   virtual void send(
00211     const Ordinal bytes, const char sendBuffer[], const int destRank
00212     ) const = 0;
00213 
00233   virtual int receive(
00234     const int sourceRank, const Ordinal bytes, char recvBuffer[]
00235     ) const = 0;
00236   
00238   
00239 }; // class Comm
00240 
00241 } // namespace Teuchos
00242 
00243 #endif // TEUCHOS_COMM_HPP

Generated on Thu Sep 18 12:30:29 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1