PetaVision  Alpha
 All Data Structures Namespaces Functions Variables
PV::Communicator Class Reference
Inheritance diagram for PV::Communicator:
PV::InterColComm

Public Member Functions

 Communicator (PV_Arguments *argumentList)
 
int commBatch ()
 
int commColumn ()
 
int commRank ()
 
int commRow ()
 
int commSize ()
 
MPI_Comm communicator ()
 
int exchange (pvdata_t *data, const MPI_Datatype neighborDatatypes[], const PVLayerLoc *loc)
 
double fprintTime (std::ostream &st)
 
int getReverseTag (int neighbor)
 
int getTag (int neighbor)
 
int globalCommRank ()
 
int globalCommSize ()
 
MPI_Comm globalCommunicator ()
 
bool hasNeighbor (int neighborId)
 
bool isExtraProc ()
 
char * name ()
 
int neighborIndex (int commId, int index)
 
int numberOfBorders ()
 
int numberOfNeighbors ()
 
int numCommBatches ()
 
int numCommColumns ()
 
int numCommRows ()
 
size_t recvOffset (int n, const PVLayerLoc *loc)
 
int reverseDirection (int commId, int direction)
 
size_t sendOffset (int n, const PVLayerLoc *loc)
 

Static Public Member Functions

static int freeDatatypes (MPI_Datatype *mpi_datatypes)
 
static MPI_Datatype * newDatatypes (const PVLayerLoc *loc)
 

Protected Member Functions

int commBatch (int commId)
 
int commColumn (int commId)
 
int commIdFromRowColumn (int commRow, int commColumn)
 
int commRow (int commId)
 

Protected Attributes

int borders [NUM_NEIGHBORHOOD-1]
 
int isExtra
 
int neighbors [NUM_NEIGHBORHOOD]
 
int numBorders
 
int numNeighbors
 
int remoteNeighbors [NUM_NEIGHBORHOOD]
 
int tags [NUM_NEIGHBORHOOD]
 

Private Member Functions

int east (int commRow, int commColumn)
 
int gcd (int a, int b)
 
bool hasEasternNeighbor (int commRow, int commColumn)
 
bool hasNortheasternNeighbor (int commRow, int commColumn)
 
bool hasNorthernNeighbor (int commRow, int commColumn)
 
bool hasNorthwesternNeighbor (int commRow, int commColumn)
 
bool hasSoutheasternNeighbor (int commRow, int commColumn)
 
bool hasSouthernNeighbor (int commRow, int commColumn)
 
bool hasSouthwesternNeighbor (int commRow, int commColumn)
 
bool hasWesternNeighbor (int commRow, int commColumn)
 
int neighborInit ()
 
int north (int commRow, int commColumn)
 
int northeast (int commRow, int commColumn)
 
int northwest (int commRow, int commColumn)
 
int south (int commRow, int commColumn)
 
int southeast (int commRow, int commColumn)
 
int southwest (int commRow, int commColumn)
 
int west (int commRow, int commColumn)
 

Private Attributes

int batchRank
 
int batchWidth
 
char commName [COMMNAME_MAXLENGTH]
 
Timerexchange_timer
 
MPI_Comm globalIcComm
 
int globalRank
 
int globalSize
 
MPI_Comm localIcComm
 
int localRank
 
int localSize
 
int numCols
 
int numRows
 
MPI_Request requests [NUM_NEIGHBORHOOD-1]
 

Detailed Description

Definition at line 34 of file Communicator.hpp.

Member Function Documentation

int PV::Communicator::commBatch ( int  commId)
protected

Returns the batch column id for the given communication id

Definition at line 220 of file Communicator.cpp.

int PV::Communicator::commColumn ( int  commId)
protected

Returns the communication column id for the given communication id

Definition at line 212 of file Communicator.cpp.

int PV::Communicator::commIdFromRowColumn ( int  commRow,
int  commColumn 
)
protected

Returns the communication id for a given row and column

Definition at line 231 of file Communicator.cpp.

int PV::Communicator::commRow ( int  commId)
protected

Returns the communication row id for the given communication id

Definition at line 204 of file Communicator.cpp.

int PV::Communicator::east ( int  commRow,
int  commColumn 
)
private

Returns the communication id of the eastern HyperColumn

Definition at line 389 of file Communicator.cpp.

int PV::Communicator::exchange ( pvdata_t *  data,
const MPI_Datatype  neighborDatatypes[],
const PVLayerLoc loc 
)

Exchange data with neighbors

  • the data regions to be sent are described by the datatypes
  • do irecv first so there is a location for send data to be received

Definition at line 737 of file Communicator.cpp.

bool PV::Communicator::hasEasternNeighbor ( int  row,
int  column 
)
private

Returns true if the given commId has an eastern neighbor (false otherwise)

Definition at line 285 of file Communicator.cpp.

bool PV::Communicator::hasNeighbor ( int  neighbor)

Returns true if the given neighbor is present (false otherwise)

Definition at line 239 of file Communicator.cpp.

bool PV::Communicator::hasNortheasternNeighbor ( int  row,
int  column 
)
private

Returns true if the given commId has a northeastern neighbor (false otherwise)

Definition at line 267 of file Communicator.cpp.

bool PV::Communicator::hasNorthernNeighbor ( int  row,
int  column 
)
private

Returns true if the given commId has a northern neighbor (false otherwise)

Definition at line 258 of file Communicator.cpp.

bool PV::Communicator::hasNorthwesternNeighbor ( int  row,
int  column 
)
private

Returns true if the given commId has a northwestern neighbor (false otherwise)

Definition at line 249 of file Communicator.cpp.

bool PV::Communicator::hasSoutheasternNeighbor ( int  row,
int  column 
)
private

Returns true if the given commId has a southeastern neighbor (false otherwise)

Definition at line 312 of file Communicator.cpp.

bool PV::Communicator::hasSouthernNeighbor ( int  row,
int  column 
)
private

Returns true if the given commId has a southern neighbor (false otherwise)

Definition at line 303 of file Communicator.cpp.

bool PV::Communicator::hasSouthwesternNeighbor ( int  row,
int  column 
)
private

Returns true if the given commId has a southwestern neighbor (false otherwise)

Definition at line 294 of file Communicator.cpp.

bool PV::Communicator::hasWesternNeighbor ( int  row,
int  column 
)
private

Returns true if the given commId has a western neighbor (false otherwise)

Definition at line 276 of file Communicator.cpp.

int PV::Communicator::neighborIndex ( int  commId,
int  direction 
)

Returns the intercolumn rank of the neighbor in the given direction If there is no neighbor, returns a negative value

Definition at line 442 of file Communicator.cpp.

int PV::Communicator::neighborInit ( )
private

Initialize the communication neighborhood

Definition at line 158 of file Communicator.cpp.

MPI_Datatype * PV::Communicator::newDatatypes ( const PVLayerLoc loc)
static

Create a set of data types for inter-neighbor communication

  • caller should delete the MPI_Datatype array by calling Communicator::freeDatatypes

Definition at line 645 of file Communicator.cpp.

int PV::Communicator::north ( int  commRow,
int  commColumn 
)
private

Returns the communication id of the northern HyperColumn

Definition at line 351 of file Communicator.cpp.

int PV::Communicator::northeast ( int  commRow,
int  commColumn 
)
private

Returns the communication id of the northeastern HyperColumn

Definition at line 363 of file Communicator.cpp.

int PV::Communicator::northwest ( int  commRow,
int  commColumn 
)
private

Returns the communication id of the northwestern HyperColumn

Definition at line 337 of file Communicator.cpp.

int PV::Communicator::numberOfNeighbors ( )

Returns the number in communication neighborhood (local included)

Definition at line 320 of file Communicator.cpp.

size_t PV::Communicator::recvOffset ( int  n,
const PVLayerLoc loc 
)

Returns the recv data offset for the given neighbor

  • recv into borders

Definition at line 561 of file Communicator.cpp.

size_t PV::Communicator::sendOffset ( int  n,
const PVLayerLoc loc 
)

Returns the send data offset for the given neighbor

  • send from interior

Definition at line 601 of file Communicator.cpp.

int PV::Communicator::south ( int  commRow,
int  commColumn 
)
private

Returns the communication id of the southern HyperColumn

Definition at line 415 of file Communicator.cpp.

int PV::Communicator::southeast ( int  commRow,
int  commColumn 
)
private

Returns the communication id of the southeastern HyperColumn

Definition at line 427 of file Communicator.cpp.

int PV::Communicator::southwest ( int  commRow,
int  commColumn 
)
private

Returns the communication id of the southwestern HyperColumn

Definition at line 401 of file Communicator.cpp.

int PV::Communicator::west ( int  commRow,
int  commColumn 
)
private

Returns the communication id of the western HyperColumn

Definition at line 377 of file Communicator.cpp.


The documentation for this class was generated from the following files: