Epetra_MpiComm Class Reference

Epetra_MpiComm: The Epetra MPI Communication Class. More...

#include <Epetra_MpiComm.h>

Inheritance diagram for Epetra_MpiComm:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Epetra_MpiCommoperator= (const Epetra_MpiComm &Comm)
 Assignment Operator.

Private Member Functions

int CheckInput (double *ptr, int count) const
int CheckInput (int *ptr, int count) const
int CheckInput (long *ptr, int count) const
int CheckInput (char *ptr, int count) const
void CleanupData ()

Private Attributes

Epetra_MpiCommDataMpiCommData_

Constructor/Destructor Methods



 Epetra_MpiComm (MPI_Comm comm)
 Epetra_MpiComm MPI Constructor.
 Epetra_MpiComm (const Epetra_MpiComm &Comm)
 Epetra_MpiComm Copy Constructor.
Epetra_CommClone () const
 Clone method.
virtual ~Epetra_MpiComm ()
 Epetra_MpiComm Destructor.

Barrier Methods



void Barrier () const
 Epetra_MpiComm Barrier function.

Broadcast Methods



int Broadcast (double *MyVals, int Count, int Root) const
 Epetra_MpiComm Broadcast function.
int Broadcast (int *MyVals, int Count, int Root) const
 Epetra_MpiComm Broadcast function.
int Broadcast (long *MyVals, int Count, int Root) const
 Epetra_MpiComm Broadcast function.
int Broadcast (char *MyVals, int Count, int Root) const
 Epetra_MpiComm Broadcast function.

Gather Methods



int GatherAll (double *MyVals, double *AllVals, int Count) const
 Epetra_MpiComm All Gather function.
int GatherAll (int *MyVals, int *AllVals, int Count) const
 Epetra_MpiComm All Gather function.
int GatherAll (long *MyVals, long *AllVals, int Count) const
 Epetra_MpiComm All Gather function.

Sum Methods



int SumAll (double *PartialSums, double *GlobalSums, int Count) const
 Epetra_MpiComm Global Sum function.
int SumAll (int *PartialSums, int *GlobalSums, int Count) const
 Epetra_MpiComm Global Sum function.
int SumAll (long *PartialSums, long *GlobalSums, int Count) const
 Epetra_MpiComm Global Sum function.

Max/Min Methods



int MaxAll (double *PartialMaxs, double *GlobalMaxs, int Count) const
 Epetra_MpiComm Global Max function.
int MaxAll (int *PartialMaxs, int *GlobalMaxs, int Count) const
 Epetra_MpiComm Global Max function.
int MaxAll (long *PartialMaxs, long *GlobalMaxs, int Count) const
 Epetra_MpiComm Global Max function.
int MinAll (double *PartialMins, double *GlobalMins, int Count) const
 Epetra_MpiComm Global Min function.
int MinAll (int *PartialMins, int *GlobalMins, int Count) const
 Epetra_MpiComm Global Min function.
int MinAll (long *PartialMins, long *GlobalMins, int Count) const
 Epetra_MpiComm Global Min function.

Parallel Prefix Methods



int ScanSum (double *MyVals, double *ScanSums, int Count) const
 Epetra_MpiComm Scan Sum function.
int ScanSum (int *MyVals, int *ScanSums, int Count) const
 Epetra_MpiComm Scan Sum function.
int ScanSum (long *MyVals, long *ScanSums, int Count) const
 Epetra_MpiComm Scan Sum function.

Attribute Accessor Methods



MPI_Comm Comm () const
 Extract MPI Communicator from a Epetra_MpiComm object.
int MyPID () const
 Return my process ID.
int NumProc () const
 Returns total number of processes.

Gather/Scatter and Directory Constructors



Epetra_DistributorCreateDistributor () const
 Create a distributor object.
Epetra_DirectoryCreateDirectory (const Epetra_BlockMap &Map) const
 Create a directory object for the given Epetra_BlockMap.

MPI-specific Methods



int GetMpiTag () const
 Acquire an MPI tag from the Epetra range of 24050-24099, increment tag.
MPI_Comm GetMpiComm () const
 Get the MPI Communicator (identical to Comm() method; used when we know we are MPI.

Print object to an output stream



void Print (ostream &os) const
 Print method that implements Epetra_Object virtual Print method.
void PrintInfo (ostream &os) const
 Print method that implements Epetra_Comm virtual PrintInfo method.

Expert Users and Developers Only



int ReferenceCount () const
 Returns the reference count of MpiCommData.
const Epetra_MpiCommDataDataPtr () const
 Returns a pointer to the MpiCommData instance this MpiComm uses.

Detailed Description

Epetra_MpiComm: The Epetra MPI Communication Class.

The Epetra_MpiComm class is an implementation of Epetra_Comm that encapsulates the general information and services needed for other Epetra classes to run on a parallel computer using MPI.

Definition at line 49 of file Epetra_MpiComm.h.


Constructor & Destructor Documentation

Epetra_MpiComm::Epetra_MpiComm ( MPI_Comm  comm  ) 

Epetra_MpiComm MPI Constructor.

Creates a Epetra_MpiComm instance for use with MPI. If no specialized MPI communicator is needed, this constuctor can be called with the argument MPI_COMM_WORLD.

Definition at line 33 of file Epetra_MpiComm.cpp.

Epetra_MpiComm::Epetra_MpiComm ( const Epetra_MpiComm Comm  ) 

Epetra_MpiComm Copy Constructor.

Makes an exact copy of an existing Epetra_MpiComm instance.

Definition at line 40 of file Epetra_MpiComm.cpp.

Epetra_MpiComm::~Epetra_MpiComm (  )  [virtual]

Epetra_MpiComm Destructor.

Completely deletes a Epetra_MpiComm object.

Warning:
Note: All objects that depend on a Epetra_MpiComm instance should be destroyed prior to calling this function.

Definition at line 193 of file Epetra_MpiComm.cpp.


Member Function Documentation

Epetra_Comm* Epetra_MpiComm::Clone (  )  const [inline, virtual]

Clone method.

Implements Epetra_Comm.

Definition at line 69 of file Epetra_MpiComm.h.

void Epetra_MpiComm::Barrier (  )  const [virtual]

Epetra_MpiComm Barrier function.

Causes each processor in the communicator to wait until all processors have arrived.

Implements Epetra_Comm.

Definition at line 48 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::Broadcast ( double *  MyVals,
int  Count,
int  Root 
) const [virtual]

Epetra_MpiComm Broadcast function.

Takes list of input values from the root processor and sends to all other processors.

Parameters:
Values InOut On entry, the root processor contains the list of values. On exit, all processors will have the same list of values. Note that values must be allocated on all processor before the broadcast.
Count In On entry, contains the length of the list of Values.
Root In On entry, contains the processor from which all processors will receive a copy of Values.

Implements Epetra_Comm.

Definition at line 52 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::Broadcast ( int *  MyVals,
int  Count,
int  Root 
) const [virtual]

Epetra_MpiComm Broadcast function.

Take list of input values from the root processor and sends to all other processors.

Parameters:
Values InOut On entry, the root processor contains the list of values. On exit, all processors will have the same list of values. Note that values must be allocated on all processor before the broadcast.
Count In On entry, contains the length of the list of Values.
Root In On entry, contains the processor from which all processors will receive a copy of Values.

Implements Epetra_Comm.

Definition at line 58 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::Broadcast ( long *  MyVals,
int  Count,
int  Root 
) const [virtual]

Epetra_MpiComm Broadcast function.

Take list of input values from the root processor and sends to all other processors.

Parameters:
Values InOut On entry, the root processor contains the list of values. On exit, all processors will have the same list of values. Note that values must be allocated on all processor before the broadcast.
Count In On entry, contains the length of the list of Values.
Root In On entry, contains the processor from which all processors will receive a copy of Values.

Implements Epetra_Comm.

Definition at line 64 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::Broadcast ( char *  MyVals,
int  Count,
int  Root 
) const [virtual]

Epetra_MpiComm Broadcast function.

Take list of input values from the root processor and sends to all other processors.

Parameters:
Values InOut On entry, the root processor contains the list of values. On exit, all processors will have the same list of values. Note that values must be allocated on all processor before the broadcast.
Count In On entry, contains the length of the list of Values.
Root In On entry, contains the processor from which all processors will receive a copy of Values.

Implements Epetra_Comm.

Definition at line 70 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::GatherAll ( double *  MyVals,
double *  AllVals,
int  Count 
) const [virtual]

Epetra_MpiComm All Gather function.

Take list of input values from all processors in the communicator and creates an ordered contiguous list of those values on each processor.

Parameters:
MyVals In On entry, contains the list of values, to be sent to all processors.
AllVals Out On exit, contains the list of values from all processors. Must by of size NumProc*Count.
Count In On entry, contains the length of the list of MyVals.

Implements Epetra_Comm.

Definition at line 76 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::GatherAll ( int *  MyVals,
int *  AllVals,
int  Count 
) const [virtual]

Epetra_MpiComm All Gather function.

Take list of input values from all processors in the communicator and creates an ordered contiguous list of those values on each processor.

Parameters:
MyVals In On entry, contains the list of values, to be sent to all processors.
AllVals Out On exit, contains the list of values from all processors. Must by of size NumProc*Count.
Count In On entry, contains the length of the list of MyVals.

Implements Epetra_Comm.

Definition at line 83 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::GatherAll ( long *  MyVals,
long *  AllVals,
int  Count 
) const [virtual]

Epetra_MpiComm All Gather function.

Take list of input values from all processors in the communicator and creates an ordered contiguous list of those values on each processor.

Parameters:
MyVals In On entry, contains the list of values, to be sent to all processors.
AllVals Out On exit, contains the list of values from all processors. Must by of size NumProc*Count.
Count In On entry, contains the length of the list of MyVals.

Implements Epetra_Comm.

Definition at line 90 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::SumAll ( double *  PartialSums,
double *  GlobalSums,
int  Count 
) const [virtual]

Epetra_MpiComm Global Sum function.

Take list of input values from all processors in the communicator, computes the sum and returns the sum to all processors.

Parameters:
PartialSums In On entry, contains the list of values, usually partial sums computed locally, to be summed across all processors.
GlobalSums Out On exit, contains the list of values summed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 97 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::SumAll ( int *  PartialSums,
int *  GlobalSums,
int  Count 
) const [virtual]

Epetra_MpiComm Global Sum function.

Take list of input values from all processors in the communicator, computes the sum and returns the sum to all processors.

Parameters:
PartialSums In On entry, contains the list of values, usually partial sums computed locally, to be summed across all processors.
GlobalSums Out On exit, contains the list of values summed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 104 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::SumAll ( long *  PartialSums,
long *  GlobalSums,
int  Count 
) const [virtual]

Epetra_MpiComm Global Sum function.

Take list of input values from all processors in the communicator, computes the sum and returns the sum to all processors.

Parameters:
PartialSums In On entry, contains the list of values, usually partial sums computed locally, to be summed across all processors.
GlobalSums Out On exit, contains the list of values summed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 111 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::MaxAll ( double *  PartialMaxs,
double *  GlobalMaxs,
int  Count 
) const [virtual]

Epetra_MpiComm Global Max function.

Take list of input values from all processors in the communicator, computes the max and returns the max to all processors.

Parameters:
PartialMaxs In On entry, contains the list of values, usually partial maxs computed locally; using these Partial Maxs, the max across all processors will be computed.
GlobalMaxs Out On exit, contains the list of maxs computed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 118 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::MaxAll ( int *  PartialMaxs,
int *  GlobalMaxs,
int  Count 
) const [virtual]

Epetra_MpiComm Global Max function.

Take list of input values from all processors in the communicator, computes the max and returns the max to all processors.

Parameters:
PartialMaxs In On entry, contains the list of values, usually partial maxs computed locally; using these Partial Maxs, the max across all processors will be computed.
GlobalMaxs Out On exit, contains the list of maxs computed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 125 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::MaxAll ( long *  PartialMaxs,
long *  GlobalMaxs,
int  Count 
) const [virtual]

Epetra_MpiComm Global Max function.

Take list of input values from all processors in the communicator, computes the max and returns the max to all processors.

Parameters:
PartialMaxs In On entry, contains the list of values, usually partial maxs computed locally; using these Partial Maxs, the max across all processors will be computed.
GlobalMaxs Out On exit, contains the list of maxs computed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 132 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::MinAll ( double *  PartialMins,
double *  GlobalMins,
int  Count 
) const [virtual]

Epetra_MpiComm Global Min function.

Take list of input values from all processors in the communicator, computes the min and returns the min to all processors.

Parameters:
PartialMins In On entry, contains the list of values, usually partial mins computed locally; using these Partial Mins, the min across all processors will be computed.
GlobalMins Out On exit, contains the list of mins computed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 139 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::MinAll ( int *  PartialMins,
int *  GlobalMins,
int  Count 
) const [virtual]

Epetra_MpiComm Global Min function.

Take list of input values from all processors in the communicator, computes the min and returns the min to all processors.

Parameters:
PartialMins In On entry, contains the list of values, usually partial mins computed locally; using these Partial Mins, the min across all processors will be computed.
GlobalMins Out On exit, contains the list of mins computed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 146 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::MinAll ( long *  PartialMins,
long *  GlobalMins,
int  Count 
) const [virtual]

Epetra_MpiComm Global Min function.

Take list of input values from all processors in the communicator, computes the min and returns the min to all processors.

Parameters:
PartialMins In On entry, contains the list of values, usually partial mins computed locally; using these Partial Mins, the min across all processors will be computed.
GlobalMins Out On exit, contains the list of mins computed across all processors.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 153 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::ScanSum ( double *  MyVals,
double *  ScanSums,
int  Count 
) const [virtual]

Epetra_MpiComm Scan Sum function.

Take list of input values from all processors in the communicator, computes the scan sum and returns it to all processors such that processor i contains the sum of values from processor 0 up to and including processor i.

Parameters:
MyVals In On entry, contains the list of values to be summed across all processors.
ScanSums Out On exit, contains the list of values summed across processors 0 through i.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 160 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::ScanSum ( int *  MyVals,
int *  ScanSums,
int  Count 
) const [virtual]

Epetra_MpiComm Scan Sum function.

Take list of input values from all processors in the communicator, computes the scan sum and returns it to all processors such that processor i contains the sum of values from processor 0 up to and including processor i.

Parameters:
MyVals In On entry, contains the list of values to be summed across all processors.
ScanSums Out On exit, contains the list of values summed across processors 0 through i.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 167 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::ScanSum ( long *  MyVals,
long *  ScanSums,
int  Count 
) const [virtual]

Epetra_MpiComm Scan Sum function.

Take list of input values from all processors in the communicator, computes the scan sum and returns it to all processors such that processor i contains the sum of values from processor 0 up to and including processor i.

Parameters:
MyVals In On entry, contains the list of values to be summed across all processors.
ScanSums Out On exit, contains the list of values summed across processors 0 through i.
Count In On entry, contains the length of the list of values.

Implements Epetra_Comm.

Definition at line 174 of file Epetra_MpiComm.cpp.

MPI_Comm Epetra_MpiComm::Comm (  )  const [inline]

Extract MPI Communicator from a Epetra_MpiComm object.

Definition at line 363 of file Epetra_MpiComm.h.

int Epetra_MpiComm::MyPID (  )  const [inline, virtual]

Return my process ID.

In MPI mode returns the rank of the calling process. In serial mode returns 0.

Implements Epetra_Comm.

Definition at line 369 of file Epetra_MpiComm.h.

int Epetra_MpiComm::NumProc (  )  const [inline, virtual]

Returns total number of processes.

In MPI mode returns the size of the MPI communicator. In serial mode returns 1.

Implements Epetra_Comm.

Definition at line 375 of file Epetra_MpiComm.h.

Epetra_Distributor * Epetra_MpiComm::CreateDistributor (  )  const [virtual]

Create a distributor object.

Implements Epetra_Comm.

Definition at line 181 of file Epetra_MpiComm.cpp.

Epetra_Directory * Epetra_MpiComm::CreateDirectory ( const Epetra_BlockMap Map  )  const [virtual]

Create a directory object for the given Epetra_BlockMap.

Implements Epetra_Comm.

Definition at line 187 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::GetMpiTag (  )  const [inline]

Acquire an MPI tag from the Epetra range of 24050-24099, increment tag.

Definition at line 389 of file Epetra_MpiComm.h.

MPI_Comm Epetra_MpiComm::GetMpiComm (  )  const [inline]

Get the MPI Communicator (identical to Comm() method; used when we know we are MPI.

Definition at line 392 of file Epetra_MpiComm.h.

void Epetra_MpiComm::Print ( ostream &  os  )  const [inline, virtual]

Print method that implements Epetra_Object virtual Print method.

Reimplemented from Epetra_Object.

Definition at line 397 of file Epetra_MpiComm.h.

void Epetra_MpiComm::PrintInfo ( ostream &  os  )  const [inline, virtual]

Print method that implements Epetra_Comm virtual PrintInfo method.

Implements Epetra_Comm.

Definition at line 401 of file Epetra_MpiComm.h.

int Epetra_MpiComm::ReferenceCount (  )  const [inline]

Returns the reference count of MpiCommData.

(Intended for testing purposes.)

Definition at line 409 of file Epetra_MpiComm.h.

const Epetra_MpiCommData* Epetra_MpiComm::DataPtr (  )  const [inline]

Returns a pointer to the MpiCommData instance this MpiComm uses.

(Intended for developer use only for testing purposes.)

Definition at line 413 of file Epetra_MpiComm.h.

Epetra_MpiComm & Epetra_MpiComm::operator= ( const Epetra_MpiComm Comm  ) 

Assignment Operator.

Definition at line 207 of file Epetra_MpiComm.cpp.

int Epetra_MpiComm::CheckInput ( double *  ptr,
int  count 
) const [inline, private]

Definition at line 422 of file Epetra_MpiComm.h.

int Epetra_MpiComm::CheckInput ( int *  ptr,
int  count 
) const [inline, private]

Definition at line 423 of file Epetra_MpiComm.h.

int Epetra_MpiComm::CheckInput ( long *  ptr,
int  count 
) const [inline, private]

Definition at line 424 of file Epetra_MpiComm.h.

int Epetra_MpiComm::CheckInput ( char *  ptr,
int  count 
) const [inline, private]

Definition at line 425 of file Epetra_MpiComm.h.

void Epetra_MpiComm::CleanupData (  )  [private]

Definition at line 197 of file Epetra_MpiComm.cpp.


Member Data Documentation

Definition at line 428 of file Epetra_MpiComm.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 09:58:46 2011 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.6.3