MPI implementation of Epetra_Distributor. More...
#include <Epetra_MpiDistributor.h>
Public Member Functions | |
Constructors/Destructor | |
Epetra_MpiDistributor (const Epetra_MpiComm &Comm) | |
Default constructor. | |
Epetra_MpiDistributor (const Epetra_MpiDistributor &Distributor) | |
Copy constructor. | |
Epetra_Distributor * | Clone () |
Clone method. | |
Epetra_Distributor * | ReverseClone () |
Create and extract the reverse version of the distributor. More... | |
virtual | ~Epetra_MpiDistributor () |
Destructor (declared virtual for memory safety). | |
Gather/Scatter Constructors | |
int | CreateFromSends (const int &NumExportIDs, const int *ExportPIDs, bool Deterministic, int &NumRemoteIDs) |
Create a communication plan from send list. More... | |
int | CreateFromRecvs (const int &NumRemoteIDs, const int *RemoteGIDs, const int *RemotePIDs, bool Deterministic, int &NumExportIDs, int *&ExportGIDs, int *&ExportPIDs) |
Create a communication plan from receive list. More... | |
int | CreateFromRecvs (const int &NumRemoteIDs, const long long *RemoteGIDs, const int *RemotePIDs, bool Deterministic, int &NumExportIDs, long long *&ExportGIDs, int *&ExportPIDs) |
int | CreateFromSendsAndRecvs (const int &NumExportIDs, const int *ExportPIDs, const int &NumRemoteIDs, const int *RemoteGIDs, const int *RemotePIDs, bool Deterministic) |
Create a communication plan from send list and a recv list. More... | |
int | CreateFromSendsAndRecvs (const int &NumExportIDs, const int *ExportPIDs, const int &NumRemoteIDs, const long long *RemoteGIDs, const int *RemotePIDs, bool Deterministic) |
Execute Gather/Scatter Operations | |
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. | |
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. | |
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) | |
int | DoWaits () |
Wait on a set of posts. | |
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 | DoReverseWaits () |
Wait on a reverse set of posts. | |
Execute Gather/Scatter Operations (Non-constant size objects) | |
int | Do (char *export_objs, int obj_size, int *&sizes, int &len_import_objs, char *&import_objs) |
Execute plan on buffer of export objects in a single step (object size may vary) | |
int | DoReverse (char *export_objs, int obj_size, int *&sizes, int &len_import_objs, char *&import_objs) |
Execute reverse of plan on buffer of export objects in a single step (object size may vary) | |
int | DoPosts (char *export_objs, int obj_size, int *&sizes, int &len_import_objs, char *&import_objs) |
Post buffer of export objects (can do other local work before executing Waits) | |
int | DoReversePosts (char *export_objs, int obj_size, int *&sizes, int &len_import_objs, char *&import_objs) |
Do reverse post of buffer of export objects (can do other local work before executing Waits) | |
Attribute Accessor Methods | |
int | NumReceives () const |
The number of procs from which we will receive data. | |
int | NumSends () const |
The number of procs to which we will send data. | |
int | MaxSendLength () const |
Maximum number of values that this proc is sending to another single proc. | |
int | TotalReceiveLength () const |
Total number of values that this proc is receiving from other procs. | |
const int * | ProcsFrom () const |
A list of procs sending values to this proc. | |
const int * | ProcsTo () const |
A list of procs to which this proc is sending values. | |
const int * | LengthsFrom () const |
Number of values we're receiving from each proc. More... | |
const int * | LengthsTo () const |
Number of values we're sending to each proc. More... | |
void | GetLastDoStatistics (int &bytes_sent, int &bytes_recvd) const |
Information on the last call to Do/DoReverse. More... | |
Print object to an output stream | |
void | Print (std::ostream &os) const |
Public Member Functions inherited from Epetra_Object | |
Epetra_Object (int TracebackModeIn=-1, bool set_label=true) | |
Epetra_Object Constructor. More... | |
Epetra_Object (const char *const Label, int TracebackModeIn=-1) | |
Epetra_Object Constructor. More... | |
Epetra_Object (const Epetra_Object &Object) | |
Epetra_Object Copy Constructor. More... | |
virtual | ~Epetra_Object () |
Epetra_Object Destructor. More... | |
virtual int | ReportError (const std::string Message, int ErrorCode) const |
Error reporting method. | |
virtual void | SetLabel (const char *const Label) |
Epetra_Object Label definition using char *. More... | |
virtual const char * | Label () const |
Epetra_Object Label access funtion. More... | |
Public Member Functions inherited from Epetra_Distributor | |
virtual | ~Epetra_Distributor () |
Epetra_Distributor Destructor. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Epetra_Object | |
static void | SetTracebackMode (int TracebackModeValue) |
Set the value of the Epetra_Object error traceback report mode. More... | |
static int | GetTracebackMode () |
Get the value of the Epetra_Object error report mode. | |
static std::ostream & | GetTracebackStream () |
Get the output stream for error reporting. | |
Static Public Attributes inherited from Epetra_Object | |
static int | TracebackMode |
Protected Member Functions inherited from Epetra_Object | |
std::string | toString (const int &x) const |
std::string | toString (const long long &x) const |
std::string | toString (const double &x) const |
MPI implementation of Epetra_Distributor.
This class is an MPI implementation of Epetra_Distributor
. It encapsulates the general information and services needed for other Epetra classes to perform gather/scatter operations on a parallel computer. An Epetra_MpiDistributor instance is actually produced by calling a method in the Epetra_MpiComm class.
|
virtual |
Create a communication plan from receive list.
Given a list of remote data IDs and corresponding process IDs from which to receive data, construct a communication plan for efficiently scattering data to these processes.
NumRemoteIDs | [in] Number of data IDs the calling process will be receiving. |
RemoteGIDs | [in] List of data IDs that the calling process wants to receive. |
RemotePIDs | [in] List of IDs of the processes that will send the remote data IDs to the calling process. |
Deterministic | [in] Currently has no effect. |
NumExportIDs | [out] Number of data IDs that need to be sent from the calling process. |
ExportGIDs | [out] List of data IDs that the calling process will send out. |
ExportPIDs | [out] List of IDs of the processes that will receive the data IDs sent by the calling process. |
new
. The caller is responsible for deallocating them after use. Implements Epetra_Distributor.
|
virtual |
Create a communication plan from send list.
Given a list of process IDs to which to send the given number of data IDs, construct a communication plan for efficiently scattering data to these processes.
NumExportIDs | [in] Number of data IDs that need to be sent from the calling process. |
ExportPIDs | [in] List of process IDs that will get the exported data IDs. |
Deterministic | [in] Currently has no effect. |
NumRemoteIDs | [out] Number of data IDs the calling process will be receiving. |
Implements Epetra_Distributor.
int Epetra_MpiDistributor::CreateFromSendsAndRecvs | ( | const int & | NumExportIDs, |
const int * | ExportPIDs, | ||
const int & | NumRemoteIDs, | ||
const int * | RemoteGIDs, | ||
const int * | RemotePIDs, | ||
bool | Deterministic | ||
) |
Create a communication plan from send list and a recv list.
Given a list of process IDs to which to send the given number of data IDs, and a list of remote data IDs and corresponding process IDs from which to receive data, construct a communication plan for efficiently scattering data to these processes.
Needless to say, knowing both of these at the same time is a pretty rare occurance. But if it happens, this routine will avoid a lot of communication that CreateFromSends or CreateFromRecvs would have to do.
NumExportIDs | [in] Number of data IDs that need to be sent from the calling process. |
ExportPIDs | [in] List of process IDs that will get the exported data IDs. |
NumRemoteIDs | [in] Number of data IDs the calling process will be receiving. |
RemoteGIDs | [in] List of data IDs that the calling process wants to receive. |
RemotePIDs | [in] List of IDs of the processes that will send the remote data IDs to the calling process. |
Deterministic | [in] Currently has no effect. |
|
inline |
Information on the last call to Do/DoReverse.
Returns the amount of data sent & recv'd on this processor in bytes
|
inline |
Number of values we're receiving from each proc.
We will receive LengthsFrom[i]
values from proc ProcsFrom[i]
.
|
inline |
Number of values we're sending to each proc.
We will send LengthsTo[i]
values to procs ProcsTo[i]
.
|
virtual |
Create and extract the reverse version of the distributor.
This is not a const method since a reverse distributor might need to be created. This works like Clone, returning a new object the user must deallocate.
Implements Epetra_Distributor.