Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Tsqr_MessengerBase.hpp
00001 //@HEADER
00002 // ************************************************************************
00003 // 
00004 //          Kokkos: Node API and Parallel Node Kernels
00005 //              Copyright (2009) 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 __TSQR_Tsqr_MessengerBase_hpp
00030 #define __TSQR_Tsqr_MessengerBase_hpp
00031 
00032 #include <Tsqr_ConfigDefs.hpp>
00033 
00034 
00035 namespace TSQR {
00043   template<class Datum>
00044   class MessengerBase {
00045   public:
00047     virtual ~MessengerBase() {}
00048 
00055     virtual void 
00056     send (const Datum sendData[], 
00057     const int sendCount, 
00058     const int destProc, 
00059     const int tag) = 0;
00060 
00067     virtual void 
00068     recv (Datum recvData[], 
00069     const int recvCount, 
00070     const int srcProc, 
00071     const int tag) = 0;
00072 
00089     virtual void 
00090     swapData (const Datum sendData[], 
00091         Datum recvData[], 
00092         const int sendRecvCount, 
00093         const int destProc, 
00094         const int tag) = 0;
00095 
00097     virtual Datum 
00098     globalSum (const Datum& inDatum) = 0;
00099 
00101     virtual void
00102     globalVectorSum (const Datum inData[], 
00103          Datum outData[], 
00104          const int count) = 0;
00105 
00109     virtual Datum 
00110     globalMin (const Datum& inDatum) = 0;
00111 
00115     virtual Datum 
00116     globalMax (const Datum& inDatum) = 0;
00117 
00119     virtual void
00120     broadcast (Datum data[], 
00121          const int count,
00122          const int root) = 0;
00123 
00125     virtual int rank () const = 0;
00126 
00128     virtual int size () const = 0;
00129 
00131     virtual void barrier () const = 0;
00132   };
00133 
00134 } // namespace TSQR
00135 
00136 #endif // __TSQR_Tsqr_MessengerBase_hpp
00137 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends