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 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
48 #ifdef __GNUC__
49 #warning "The Epetra package is deprecated"
50 #endif
51 #endif
52 
53 
54 
55 #include "Epetra_Object.h"
56 #include "Epetra_Distributor.h"
57 class Epetra_SerialComm;
58 
60 
67 
68  public:
69 
71 
72 
75 
78 
80  Epetra_Distributor * Clone(){return(dynamic_cast<Epetra_Distributor *>(new Epetra_SerialDistributor(*this)));};
81 
83 
86 
88  virtual ~Epetra_SerialDistributor();
89 
91 
92 
93  int CreateFromSends( const int & NumExportIDs,
94  const int * ExportPIDs,
95  bool Deterministic,
96  int & NumRemoteIDs );
97 
98  int CreateFromRecvs( const int & NumRemoteIDs,
99  const int * RemoteGIDs,
100  const int * RemotePIDs,
101  bool Deterministic,
102  int & NumExportIDs,
103  int *& ExportGIDs,
104  int *& ExportPIDs);
105 
106 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
107  int CreateFromRecvs( const int & NumRemoteIDs,
108  const long long * RemoteGIDs,
109  const int * RemotePIDs,
110  bool Deterministic,
111  int & NumExportIDs,
112  long long *& ExportGIDs,
113  int *& ExportPIDs);
114 #endif
115 
116  int Do (char * export_objs,
117  int obj_size,
118  int & len_import_objs,
119  char *& import_objs);
120  int DoReverse(char * export_objs,
121  int obj_size,
122  int & len_import_objs,
123  char *& import_objs);
124 
125  int DoPosts(char * export_objs,
126  int obj_size,
127  int & len_import_objs,
128  char *& import_objs);
129  int DoWaits();
130 
131  int DoReversePosts(char * export_objs,
132  int obj_size,
133  int & len_import_objs,
134  char *& import_objs);
135  int DoReverseWaits();
136 
137 
138  int Do (char * export_objs,
139  int obj_size,
140  int *& sizes,
141  int & len_import_objs,
142  char *& import_objs);
143  int DoReverse(char * export_objs,
144  int obj_size,
145  int *& sizes,
146  int & len_import_objs,
147  char *& import_objs);
148 
149  int DoPosts(char * export_objs,
150  int obj_size,
151  int *& sizes,
152  int & len_import_objs,
153  char *& import_objs);
154 
155  int DoReversePosts(char * export_objs,
156  int obj_size,
157  int *& sizes,
158  int & len_import_objs,
159  char *& import_objs);
160 
161  virtual void Print(std::ostream & os) const;
162 
163  private:
164  int nrecvs_;
165  int nsends_;
166 };
167 #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:65
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.