snl_fei_BlkSizeMsgHandler.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _snl_fei_BlkSizeMsgHandler_hpp_
00010 #define _snl_fei_BlkSizeMsgHandler_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 #include <fei_SharedPtr.hpp>
00014 #include <fei_VectorSpace.hpp>
00015 #include <fei_Graph.hpp>
00016 #include <fei_CommUtils.hpp>
00017 
00018 namespace snl_fei {
00019 
00021 class BlkSizeMsgHandler : public fei::MessageHandler<int> {
00022  public:
00024   BlkSizeMsgHandler(fei::VectorSpace* vspace,
00025         fei::Graph* graph,
00026         MPI_Comm comm);
00028   virtual ~BlkSizeMsgHandler();
00029 
00031   int do_the_exchange();
00032 
00034   std::vector<int>& getSendProcs();
00036   std::vector<int>& getRecvProcs();
00037 
00039   int getSendMessageLength(int destProc, int& messageLength);
00041   int getSendMessage(int destProc, std::vector<int>& message);
00043   int processRecvMessage(int srcProc, std::vector<int>& message);
00044 
00045  private:
00046   fei::comm_map* remote_colIndices_;
00047   fei::comm_map* local_colIndices_;
00048   fei::VectorSpace* vecSpace_;
00049   snl_fei::PointBlockMap* ptBlkMap_;
00050   fei::Graph* graph_;
00051   MPI_Comm comm_;
00052   std::vector<int> sendProcs_;
00053   std::vector<int> recvProcs_;
00054 
00055   bool firstExchange_;
00056 };
00057 
00058 } // namespace snl_fei
00059 
00060 #endif
00061 

Generated on Tue Jul 13 09:27:46 2010 for FEI by  doxygen 1.4.7