Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Epetra_SerialDistributor.h
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // ************************************************************************
4 //
5 // Epetra: Linear Algebra Services Package
6 // Copyright 2011 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ************************************************************************
41 //@HEADER
42 */
43 
44 #ifndef EPETRA_SERIALDISTRIBUTOR_H
45 #define EPETRA_SERIALDISTRIBUTOR_H
46 
47 #include "Epetra_Object.h"
48 #include "Epetra_Distributor.h"
49 class Epetra_SerialComm;
50 
52 
59 
60  public:
61 
63 
64 
67 
70 
72  Epetra_Distributor * Clone(){return(dynamic_cast<Epetra_Distributor *>(new Epetra_SerialDistributor(*this)));};
73 
75 
78 
80  virtual ~Epetra_SerialDistributor();
81 
83 
84 
85  int CreateFromSends( const int & NumExportIDs,
86  const int * ExportPIDs,
87  bool Deterministic,
88  int & NumRemoteIDs );
89 
90  int CreateFromRecvs( const int & NumRemoteIDs,
91  const int * RemoteGIDs,
92  const int * RemotePIDs,
93  bool Deterministic,
94  int & NumExportIDs,
95  int *& ExportGIDs,
96  int *& ExportPIDs);
97 
98 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
99  int CreateFromRecvs( const int & NumRemoteIDs,
100  const long long * RemoteGIDs,
101  const int * RemotePIDs,
102  bool Deterministic,
103  int & NumExportIDs,
104  long long *& ExportGIDs,
105  int *& ExportPIDs);
106 #endif
107 
108  int Do (char * export_objs,
109  int obj_size,
110  int & len_import_objs,
111  char *& import_objs);
112  int DoReverse(char * export_objs,
113  int obj_size,
114  int & len_import_objs,
115  char *& import_objs);
116 
117  int DoPosts(char * export_objs,
118  int obj_size,
119  int & len_import_objs,
120  char *& import_objs);
121  int DoWaits();
122 
123  int DoReversePosts(char * export_objs,
124  int obj_size,
125  int & len_import_objs,
126  char *& import_objs);
127  int DoReverseWaits();
128 
129 
130  int Do (char * export_objs,
131  int obj_size,
132  int *& sizes,
133  int & len_import_objs,
134  char *& import_objs);
135  int DoReverse(char * export_objs,
136  int obj_size,
137  int *& sizes,
138  int & len_import_objs,
139  char *& import_objs);
140 
141  int DoPosts(char * export_objs,
142  int obj_size,
143  int *& sizes,
144  int & len_import_objs,
145  char *& import_objs);
146 
147  int DoReversePosts(char * export_objs,
148  int obj_size,
149  int *& sizes,
150  int & len_import_objs,
151  char *& import_objs);
152 
153  virtual void Print(std::ostream & os) const;
154 
155  private:
156  int nrecvs_;
157  int nsends_;
158 };
159 #endif /* EPETRA_SERIALDISTRIBUTOR_H */
int DoReversePosts(char *export_objs, int obj_size, int &len_import_objs, char *&import_objs)
Do reverse post of buffer of export objects (can do other local work before executing Waits) ...
int CreateFromRecvs(const int &NumRemoteIDs, const int *RemoteGIDs, const int *RemotePIDs, bool Deterministic, int &NumExportIDs, int *&ExportGIDs, int *&ExportPIDs)
Create Distributor object using list of Remote global IDs and corresponding PIDs. ...
Epetra_SerialDistributor: The Epetra Serial implementation of the Epetra_Distributor Gather/Scatter S...
Epetra_Distributor: The Epetra Gather/Scatter Setup Base Class.
Epetra_Distributor * ReverseClone()
Create and extract the reverse version of the distributor.
int Do(char *export_objs, int obj_size, int &len_import_objs, char *&import_objs)
Execute plan on buffer of export objects in a single step.
Epetra_Object: The base Epetra class.
Definition: Epetra_Object.h:57
Epetra_SerialDistributor(const Epetra_SerialComm &Comm)
Constructor.
virtual void Print(std::ostream &os) const
virtual ~Epetra_SerialDistributor()
Epetra_Comm Destructor.
int DoPosts(char *export_objs, int obj_size, int &len_import_objs, char *&import_objs)
Post buffer of export objects (can do other local work before executing Waits)
Epetra_SerialComm: The Epetra Serial Communication Class.
int CreateFromSends(const int &NumExportIDs, const int *ExportPIDs, bool Deterministic, int &NumRemoteIDs)
Create Distributor object using list of process IDs to which we export.
int DoReverseWaits()
Wait on a reverse set of posts.
int DoReverse(char *export_objs, int obj_size, int &len_import_objs, char *&import_objs)
Execute reverse of plan on buffer of export objects in a single step.
Epetra_Distributor * Clone()
Clone method.
int DoWaits()
Wait on a set of posts.