Zoltan2
Zoltan2_MachineRepresentation.hpp
Go to the documentation of this file.
1 #ifndef _ZOLTAN2_MACHINEREPRESENTATION_HPP_
2 #define _ZOLTAN2_MACHINEREPRESENTATION_HPP_
3 
4 #include <Teuchos_Comm.hpp>
8 
9 //#define HAVE_ZOLTAN2_BGQTEST
10 
11 namespace Zoltan2{
12 
16 template <typename pcoord_t, typename part_t>
18 
19 public:
20 
21 #if defined(HAVE_ZOLTAN2_LDMS)
22  typedef MachineLDMS<pcoord_t,part_t> machine_t;
23 #elif defined(HAVE_ZOLTAN2_RCA)
24  typedef MachineRCA<pcoord_t,part_t> machine_t;
25 #elif defined(HAVE_ZOLTAN2_TOPOMANAGER)
27 #elif defined(HAVE_ZOLTAN2_BGQTEST)
29 #else
31 #endif
32 
37  MachineRepresentation(const Teuchos::Comm<int> &comm) :
38  machine(new machine_t(comm)) { }
39 
40  MachineRepresentation(const Teuchos::Comm<int> &comm, const Teuchos::ParameterList &pl ) :
41  machine(new machine_t(comm, pl)) { }
42 
43  ~MachineRepresentation() {delete machine;}
44 
45  // Interface functions follow.
46  // They are just wrappers around the specific machine's functions.
47 
50  inline bool hasMachineCoordinates() const {
51  return machine->hasMachineCoordinates();
52  }
53 
56  inline int getMachineDim() const { return machine->getMachineDim(); }
57 
61  inline bool getMachineExtent(int *nxyz) const {
62  return machine->getMachineExtent(nxyz);
63  }
64 
68  bool getMachineExtentWrapArounds(bool *wrap_around) const {
69  return machine->getMachineExtentWrapArounds(wrap_around);
70  }
71 
72 
77  inline bool getMyMachineCoordinate(pcoord_t *xyz) const {
78  return machine->getMyMachineCoordinate(xyz);
79  }
80 
85  inline bool getMachineCoordinate(const int rank,
86  pcoord_t *xyz) const {
87  return machine->getMachineCoordinate(rank, xyz);
88  }
89 
94  inline bool getMachineCoordinate(const char *nodename,
95  pcoord_t *xyz) const {
96  return machine->getMachineCoordinate(nodename, xyz);
97  }
98 
105  inline bool getAllMachineCoordinatesView(pcoord_t **&allCoords) const {
106  return machine->getAllMachineCoordinatesView(allCoords);
107  }
108 
111  inline int getNumRanks() const { return machine->getNumRanks(); }
112 
113 
114  inline bool getHopCount(int rank1, int rank2, pcoord_t &hops) const {
115  return machine->getHopCount(rank1, rank2, hops);
116  }
117 
118 
119  // KDD TODO: Add Graph interface and methods supporting full LDMS interface.
120 
121 private:
122  machine_t *machine;
123 };
124 }
125 #endif
A Machine Class for testing only A more realistic machine should be used for task mapping...
bool getHopCount(int rank1, int rank2, pcoord_t &hops) const
bool getMachineCoordinate(const int rank, pcoord_t *xyz) const
getCoordinate function set the machine coordinate xyz of any rank process return true if coordinates ...
MachineRepresentation(const Teuchos::Comm< int > &comm, const Teuchos::ParameterList &pl)
MachineRepresentation(const Teuchos::Comm< int > &comm)
Constructor MachineRepresentation Class.
bool getMyMachineCoordinate(pcoord_t *xyz) const
getMyCoordinate function set the machine coordinate xyz of the current process return true if current...
virtual bool getHopCount(int rank1, int rank2, pcoord_t &hops)
bool getMachineExtentWrapArounds(bool *wrap_around) const
if the machine has a wrap-around tourus link in each dimension. return true if the information is ava...
int getMachineDim() const
returns the dimension (number of coords per node) in the machine
bool getAllMachineCoordinatesView(pcoord_t **&allCoords) const
getProcDim function set the coordinates of all ranks allCoords[i][j], i=0,...,getMachineDim(), j=0,...,getNumRanks(), is the i-th dimensional coordinate for rank j. return true if coordinates are available for all ranks
A Machine Class for testing only A more realistic machine should be used for task mapping...
MachineRepresentation Class Base class for representing machine coordinates, networks, etc.
MachineForTesting< pcoord_t, part_t > machine_t
bool getMachineCoordinate(const int rank, pcoord_t *xyz)
bool getMachineExtent(int *nxyz) const
sets the number of unique coordinates in each machine dimension return true if coordinates are availa...
int getNumRanks() const
return the number of ranks.
int getNumRanks() const
return the number of ranks.
A Machine Class for testing only A more realistic machine should be used for task mapping...
bool getMachineExtentWrapArounds(bool *wrap_around) const
if the machine has a wrap-around tourus link in each dimension. return true if the information is ava...
bool getMachineCoordinate(const char *nodename, pcoord_t *xyz) const
getCoordinate function set the machine coordinate xyz of any node by nodename return true if coordina...
bool hasMachineCoordinates() const
indicates whether or not the machine has coordinates
bool getAllMachineCoordinatesView(pcoord_t **&allCoords) const