Zoltan2
Loading...
Searching...
No Matches
Zoltan2_Machine.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Zoltan2: A package of combinatorial algorithms for scientific computing
4//
5// Copyright 2012 NTESS and the Zoltan2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef _ZOLTAN2_MACHINE_HPP_
11#define _ZOLTAN2_MACHINE_HPP_
12
13#include <Teuchos_Comm.hpp>
14#include <Zoltan2_config.h>
15namespace Zoltan2{
16
20template <typename pcoord_t, typename part_t>
21class Machine{
22
23protected:
25 int myRank;
26
27public:
32 Machine(const Teuchos::Comm<int> &comm) :
33 numRanks(comm.getSize()), myRank(comm.getRank())
34 { }
35
36 virtual ~Machine(){ }
37
40 bool hasMachineCoordinates() const {
41 return false; // Coordinates not available in this machine
42 }
43
46 int getMachineDim() const {
47 return 0; // Coordinates not available in this machine
48 }
49
53 bool getMachineExtent(int *nxyz) const {
54 return false; // Extent not available in this machine
55 }
56
60 bool getMachineExtentWrapArounds(bool *wrap_around) const {
61 return false; // Extent not available in this machine
62 }
63
68 bool getMyMachineCoordinate(pcoord_t *xyz) const {
69 return false; // Coordinates not available in this machine
70 }
71
76 bool getMachineCoordinate(const int rank, pcoord_t *xyz) const {
77 return false; // Coordinates not available by rank
78 }
79
84 bool getMachineCoordinate(const char *nodename, pcoord_t *xyz) const {
85 return false; // Coordinates not available by nodename
86 }
87
94 bool getAllMachineCoordinatesView(pcoord_t **allCoords) const {
95 return false; // Coordinates not available in this machine
96 }
97
101 int getNumRanks() const { return numRanks; }
102
107 virtual bool getHopCount(int rank1, int rank2, pcoord_t &hops) const {
108 return false;
109 }
110
118 virtual part_t getNumUniqueGroups() const {
119 return 1;
120 }
121
137 virtual bool getGroupCount(part_t *grp_count) const {
138 return false;
139 }
140
141 // KDD TODO: Add Graph interface and methods supporting full LDMS interface.
142
143};
144}
145#endif
MachineClass Base class for representing machine coordinates, networks, etc.
bool getAllMachineCoordinatesView(pcoord_t **allCoords) const
getProcDim function set the coordinates of all ranks allCoords[i][j], i=0,...,getMachineDim(),...
virtual part_t getNumUniqueGroups() const
getNumUniqueGroups function return the number of unique Dragonfly network groups in provided allocati...
bool getMyMachineCoordinate(pcoord_t *xyz) const
getMyCoordinate function set the machine coordinate xyz of the current process return true if current...
bool getMachineCoordinate(const int rank, pcoord_t *xyz) const
getCoordinate function set the machine coordinate xyz of any rank process return true if coordinates ...
virtual bool getGroupCount(part_t *grp_count) const
getGroupCount function return the number of ranks in each group (RCA X-dim, e.g. first dim)
bool getMachineExtent(int *nxyz) const
sets the number of unique coordinates in each machine dimension return true if coordinates are availa...
Machine(const Teuchos::Comm< int > &comm)
Constructor MachineRepresentation Class.
int getNumRanks() const
getNumRanks function return the number of ranks.
int getMachineDim() const
returns the dimension (number of coords per node) in the machine
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 hasMachineCoordinates() const
indicates whether or not the machine has coordinates
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...
virtual bool getHopCount(int rank1, int rank2, pcoord_t &hops) const
getHopCount function set hops between rank1 and rank2 return true if coordinates are available
Created by mbenlioglu on Aug 31, 2020.
SparseMatrixAdapter_t::part_t part_t