5 #ifndef BORDEREXCHANGE_HPP_ 6 #define BORDEREXCHANGE_HPP_ 8 #include "arch/mpi/mpi.h" 9 #include "include/PVLayerLoc.h" 10 #include "structures/MPIBlock.hpp" 20 void exchange(
float *data, std::vector<MPI_Request> &req);
22 static int wait(std::vector<MPI_Request> &req);
24 MPIBlock const *getMPIBlock()
const {
return mMPIBlock; }
26 int getRank()
const {
return mMPIBlock->
getRank(); }
28 int getNumNeighbors()
const {
return mNumNeighbors; }
30 static int northwest(
int row,
int column,
int numRows,
int numColumns);
31 static int north(
int row,
int column,
int numRows,
int numColumns);
32 static int northeast(
int row,
int column,
int numRows,
int numColumns);
33 static int west(
int row,
int column,
int numRows,
int numColumns);
34 static int east(
int row,
int column,
int numRows,
int numColumns);
35 static int southwest(
int row,
int column,
int numRows,
int numColumns);
36 static int south(
int row,
int column,
int numRows,
int numColumns);
37 static int southeast(
int row,
int column,
int numRows,
int numColumns);
39 static bool hasNorthwesternNeighbor(
int row,
int column,
int numRows,
int numColumns);
40 static bool hasNorthernNeighbor(
int row,
int column,
int numRows,
int numColumns);
41 static bool hasNortheasternNeighbor(
int row,
int column,
int numRows,
int numColumns);
42 static bool hasWesternNeighbor(
int row,
int column,
int numRows,
int numColumns);
43 static bool hasEasternNeighbor(
int row,
int column,
int numRows,
int numColumns);
44 static bool hasSouthwesternNeighbor(
int row,
int column,
int numRows,
int numColumns);
45 static bool hasSouthernNeighbor(
int row,
int column,
int numRows,
int numColumns);
46 static bool hasSoutheasternNeighbor(
int row,
int column,
int numRows,
int numColumns);
84 std::vector<MPI_Datatype> mDatatypes;
85 std::vector<int> neighbors;
86 unsigned int mNumNeighbors;
94 static int const LOCAL = 0;
95 static int const NORTHWEST = 1;
96 static int const NORTH = 2;
97 static int const NORTHEAST = 3;
98 static int const WEST = 4;
99 static int const EAST = 5;
100 static int const SOUTHWEST = 6;
101 static int const SOUTH = 7;
102 static int const SOUTHEAST = 8;
103 static std::vector<int>
const mTags;
105 static int exchangeCounter;
111 #endif // BORDEREXCHANGE_HPP_
int reverseDirection(int commId, int direction)
std::size_t recvOffset(int direction)
std::size_t sendOffset(int direction)
int neighborIndex(int commId, int direction)