EpetraExt_ZoltanMpiDistributor.h

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //     EpetraExt: Epetra Extended - Linear Algebra Services Package
00005 //                 Copyright (2001) 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 _EPETRAEXT_ZOLTANMPIDISTRIBUTOR_H_
00030 #define _EPETRAEXT_ZOLTANMPIDISTRIBUTOR_H_
00031 
00032 #include "Epetra_Object.h"
00033 #include "Epetra_Distributor.h"
00034 
00035 #include "zoltan_comm.h"
00036 
00037 namespace EpetraExt {
00038 
00039 class ZoltanMpiComm;
00040 
00042 
00049 class ZoltanMpiDistributor: public Epetra_Object, public virtual Epetra_Distributor {
00050     
00051   public:
00052 
00054 
00056   ZoltanMpiDistributor(const ZoltanMpiComm &Comm);
00057 
00059   ZoltanMpiDistributor(const ZoltanMpiDistributor &Distributor);
00060 
00062   Epetra_Distributor *Clone() {
00063      return dynamic_cast<Epetra_Distributor*>(new ZoltanMpiDistributor(*this));
00064   };
00065 
00067   virtual ~ZoltanMpiDistributor();
00069 
00070   
00072 
00073 
00085   int CreateFromSends( const int &NumExportIDs,
00086                        const int *ExportPIDs,
00087                        bool Deterministic,
00088                        int &NumRemoteIDs );
00089 
00091 
00107   int CreateFromRecvs( const int &NumRemoteIDs,
00108                        const int *RemoteGIDs,
00109                        const int *RemotePIDs,
00110                        bool Deterministic,
00111            int &NumExportIDs,
00112                        int *&ExportGIDs,
00113            int *&ExportPIDs);
00115 
00117 
00119   int Do( char *export_objs,
00120           int obj_size,
00121           int & len_import_objs,
00122           char *& import_objs );
00123 
00125   int DoReverse( char * export_objs,
00126                  int obj_size,
00127                  int & len_import_objs,
00128                  char *& import_objs );
00129 
00131   int DoPosts( char * export_objs,
00132                int obj_size,
00133                int & len_import_objs,
00134                char *& import_objs );
00135   
00137   int DoWaits();
00138 
00140   int DoReversePosts( char * export_objs,
00141                       int obj_size,
00142                       int & len_import_objs,
00143                       char *& import_objs );
00144 
00146   int DoReverseWaits();
00147 
00149 
00151 
00153   int Do( char *export_objs,
00154           int obj_size,
00155           int *& sizes,
00156           int & len_import_objs,
00157           char *& import_objs );
00158   
00160   int DoReverse( char *export_objs,
00161                  int obj_size,
00162                  int *& sizes,
00163                  int & len_import_objs,
00164                  char *& import_objs );
00165   
00167   int DoPosts( char *export_objs,
00168                int obj_size,
00169                int *& sizes,
00170                int & len_import_objs,
00171                char *& import_objs );
00172   
00174   int DoReversePosts( char *export_objs,
00175                       int obj_size,
00176                       int *& sizes,
00177                       int & len_import_objs,
00178                       char *& import_objs );
00179   
00181   
00183   void Print(ostream &os) const;
00185  
00186   private:
00187 
00189     int Resize (int *sizes, int *sum_recv_sizes);
00190 
00191     Zoltan_Comm_Obj *plan_;
00192 
00193     int   tag_;
00194 
00195     const ZoltanMpiComm *epComm_;
00196     const MPI_Comm comm_;
00197 
00198 };
00199 
00200 } //namespace EpetraExt
00201 
00202 #endif /* _EPETRAEXT_ZOLTANMPIDISTRIBUTOR_H_ */

Generated on Thu Sep 18 12:31:44 2008 for EpetraExt by doxygen 1.3.9.1