Data Structures | |
class | SpanningTreeStrategy |
The spanning tree build strategy interface. More... | |
class | SpanningTreeVertex |
Contains indices to direct children. More... | |
class | SpanningTreeStrategy_3dTorus_minBytesHops |
A concrete tree builder for use on machines with a 3D Torus topology. More... | |
class | topo::SpanningTreeStrategy_3dTorus_minBytesHops< Iterator, SpanningTreeVertex > |
Partial specialization when input is a container of SpanningTreeVertices. More... | |
class | topo::SpanningTreeStrategy_3dTorus_minBytesHops< Iterator, vtxType > |
Partial specialization when input is a container of vtxTypes. More... | |
class | SpanningTreeStrategy_3dTorus_minHops |
A concrete tree builder for use on machines with a 3D Torus topology. More... | |
class | topo::SpanningTreeStrategy_3dTorus_minHops< Iterator, SpanningTreeVertex > |
Partial specialization for scenario for a container of SpanningTreeVertices. More... | |
class | topo::SpanningTreeStrategy_3dTorus_minHops< Iterator, vtxType > |
Partial specialization for scenario when a container of vtxTypes is input. More... | |
class | SpanningTreeStrategy_nodeAware_minBytes |
A concrete tree builder that is aware of cpu topology (ie, node aware) while constructing spanning trees. More... | |
class | topo::SpanningTreeStrategy_nodeAware_minBytes< Iterator, SpanningTreeVertex > |
Partial specialization when input is a container of SpanningTreeVertices. More... | |
class | SpanningTreeStrategy_nodeAware_minGens |
A concrete tree builder that is aware of cpu topology (ie, node aware) while constructing spanning trees. More... | |
class | topo::SpanningTreeStrategy_nodeAware_minGens< Iterator, SpanningTreeVertex > |
Partial specialization for the scenario of a container of SpanningTreeVertices. More... | |
class | SpanningTreeStrategy_topoUnaware |
A concrete tree builder that is NOT topology aware. More... | |
class | topo::SpanningTreeStrategy_topoUnaware< Iterator, SpanningTreeVertex > |
Partial specialization when input is a container of SpanningTreeVertices. More... | |
Namespaces | |
namespace | impl |
Nested namespace to prevent the implementation muck from polluting topo::. | |
Typedefs | |
typedef int | vtxType |
Alias for the actual data type of a vertex id (PE/node number). | |
Functions | |
template<typename Iterator> | |
SpanningTreeStrategy< Iterator > * | getSpanningTreeStrategy (const Iterator firstVtx, const Iterator beyondLastVtx, const int maxBranches) |
Tiny factory method that returns a tree construction strategy that it thinks is best (based on inputs, the machine's network topology info etc). | |
int | getProcID (const vtxType vtx) |
int | getProcID (const SpanningTreeVertex &vtx) |
int | numHops (const SpanningTreeVertex &vtx1, const SpanningTreeVertex &vtx2) |
Return the number of hops (on the machine network) between two vertices in the tree. | |
template<typename Iterator> | |
Iterator | pickClosest (const SpanningTreeVertex &parent, const Iterator start, const Iterator end) |
Pick the vertex closes to the parent in the given range. | |
void | writeAllocTopoManager (const char *fileName) |
template<typename Iterator> | |
void | writeCoordinatesPEList (const char *fileName, const Iterator start, const Iterator end) |
template<typename Iterator> | |
SpanningTreeVertex * | buildSpanningTreeGeneration (const Iterator firstVtx, const Iterator beyondLastVtx, const int maxBranches=2) |
Builds one generation of the spanning tree given a container of vertices with the tree root as the first element in the container. | |
template<typename Iterator> | |
SpanningTreeVertex * | buildSpanningTreeGeneration (const Iterator firstVtx, const Iterator beyondLastVtx, const int maxBranches, SpanningTreeStrategy< Iterator > *bldr) |
Facade function to hide all the template muck for the mainstream usecases. | |
template<typename Iterator> | |
void | buildSpanningTree (const Iterator firstVtx, const Iterator beyondLastVtx, const int maxBranches=2) |
Builds the complete spanning tree given a container of vertices with the tree root as the first element in the container. | |
template<typename Iterator> | |
void | buildSpanningTree (const Iterator firstVtx, const Iterator beyondLastVtx, const int maxBranches, SpanningTreeStrategy< Iterator > *bldr) |
Facade function to build a complete spanning tree given an input container of SpanningTreeVertex-es Uses tag-dispatching to ensure at compile-time that the input container holds only SpanningTreeVertex and nothing else. |
typedef int topo::vtxType |
Alias for the actual data type of a vertex id (PE/node number).
Definition at line 114 of file spanningTreeStrategy.h.
SpanningTreeVertex * topo::buildSpanningTreeGeneration | ( | const Iterator | firstVtx, | |
const Iterator | beyondLastVtx, | |||
const int | maxBranches = 2 | |||
) | [inline] |
Builds one generation of the spanning tree given a container of vertices with the tree root as the first element in the container.
Definition at line 213 of file spanningTreeStrategy.h.
References getSpanningTreeStrategy().
Referenced by topo::impl::buildSpanningTree().
SpanningTreeVertex * topo::buildSpanningTreeGeneration | ( | const Iterator | firstVtx, | |
const Iterator | beyondLastVtx, | |||
const int | maxBranches, | |||
SpanningTreeStrategy< Iterator > * | bldr | |||
) | [inline] |
Facade function to hide all the template muck for the mainstream usecases.
Use when you're happy with the default spanning tree strategy. This should hide the very existence of all this template stuff for the default use-cases.
For scenarios, where you want to specify the tree building strategy, you need to supply a strategy object. In this case, instantiate a strategy object manually (the factory method getSpanningTreeStrategy() will give you what it thinks is best) and plug it into this function call.
Its advisable to use this facade even when explicitly specifying a strategy object, as this leaves room for future additions to the procedure without affecting the user code
Validate input. Invalid inputs are not exceptions. They are just no-ops
Delegate the actual work
Definition at line 194 of file spanningTreeStrategy.h.
References topo::SpanningTreeStrategy< Iterator, ValueType >::buildNextGen().
void topo::buildSpanningTree | ( | const Iterator | firstVtx, | |
const Iterator | beyondLastVtx, | |||
const int | maxBranches = 2 | |||
) | [inline] |
Builds the complete spanning tree given a container of vertices with the tree root as the first element in the container.
Definition at line 291 of file spanningTreeStrategy.h.
References getSpanningTreeStrategy().
void topo::buildSpanningTree | ( | const Iterator | firstVtx, | |
const Iterator | beyondLastVtx, | |||
const int | maxBranches, | |||
SpanningTreeStrategy< Iterator > * | bldr | |||
) | [inline] |
Facade function to build a complete spanning tree given an input container of SpanningTreeVertex-es Uses tag-dispatching to ensure at compile-time that the input container holds only SpanningTreeVertex and nothing else.
Create a tag
Delegate the work
Definition at line 275 of file spanningTreeStrategy.h.
References topo::impl::buildSpanningTree(), and tag.
SpanningTreeStrategy< Iterator > * topo::getSpanningTreeStrategy | ( | const Iterator | firstVtx, | |
const Iterator | beyondLastVtx, | |||
const int | maxBranches | |||
) | [inline] |
Tiny factory method that returns a tree construction strategy that it thinks is best (based on inputs, the machine's network topology info etc).
Simply uses machine specific preprocessor macros to return an appropriate strategy.
Expects that these macros will be available in the current compilation unit thanks to charm innards.
Reserves the right to use other heuristics (based on the input data) to select a strategy, if such needs arise in the future.
Nested, utility class to let us to use the parent PE for different Iterator::value_types
Find the number of PEs on the same node as the parent vertex (max possible on-node destinations)
If minimizing tree generations may be more beneficial than reducing inter-node traffic
Definition at line 331 of file spanningTreeStrategy.h.
References CmiNumPesOnPhysicalNode(), CmiPhysicalNodeID(), and topo::SpanningTreeVertex::id.
Referenced by buildSpanningTree(), and buildSpanningTreeGeneration().
int topo::getProcID | ( | const vtxType | vtx | ) | [inline] |
Definition at line 66 of file spanningTreeVertex.h.
Referenced by topo::topo::SpanningTreeStrategy_3dTorus_minBytesHops< Iterator, SpanningTreeVertex >::buildNextGen(), topo::impl::buildNextGen_topoUnaware(), and numHops().
int topo::getProcID | ( | const SpanningTreeVertex & | vtx | ) | [inline] |
int topo::numHops | ( | const SpanningTreeVertex & | vtx1, | |
const SpanningTreeVertex & | vtx2 | |||
) | [inline] |
Return the number of hops (on the machine network) between two vertices in the tree.
Assert that the dimensions of the coordinate vectors of the two vertices are the same
Definition at line 70 of file spanningTreeVertex.h.
References TopoManager::getHopsBetweenRanks(), getProcID(), and TopoManager::getTopoManager().
Referenced by topo::topo::SpanningTreeStrategy_3dTorus_minBytesHops< Iterator, SpanningTreeVertex >::buildNextGen(), and pickClosest().
Iterator topo::pickClosest | ( | const SpanningTreeVertex & | parent, | |
const Iterator | start, | |||
const Iterator | end | |||
) | [inline] |
Pick the vertex closes to the parent in the given range.
Loop thro the range and identify the vertex closest to the parent
Definition at line 80 of file spanningTreeVertex.h.
References numHops().
Referenced by topo::topo::SpanningTreeStrategy_3dTorus_minHops< Iterator, SpanningTreeVertex >::buildNextGen(), and topo::topo::SpanningTreeStrategy_3dTorus_minBytesHops< Iterator, SpanningTreeVertex >::buildNextGen().
void topo::writeAllocTopoManager | ( | const char * | fileName | ) |
Definition at line 83 of file treeStrategy_3dTorus_minBytesHops.h.
References Converse::CkNumPes(), coords, endl(), and TopoManager_getPeCoordinates().
Referenced by topo::topo::SpanningTreeStrategy_3dTorus_minBytesHops< Iterator, SpanningTreeVertex >::buildNextGen().
void topo::writeCoordinatesPEList | ( | const char * | fileName, | |
const Iterator | start, | |||
const Iterator | end | |||
) | [inline] |
Definition at line 95 of file treeStrategy_3dTorus_minBytesHops.h.
References endl().
Referenced by topo::topo::SpanningTreeStrategy_3dTorus_minBytesHops< Iterator, SpanningTreeVertex >::buildNextGen().