Hitmap 1.3
|
Go to the source code of this file.
Data Structures | |
struct | HitRanks |
struct | HitTopology |
Macros | |
#define | HIT_RANK_NULL_STATIC -1 |
#define | HIT_RANKS_NULL_STATIC { { HIT_RANK_NULL_STATIC, HIT_RANK_NULL_STATIC, HIT_RANK_NULL_STATIC, HIT_RANK_NULL_STATIC } } |
#define | hit_ranks(numDims,...) hit_ranks##numDims( __VA_ARGS__ ) |
#define | hit_ranksCmp(a, b) ((a).rank[0] == (b).rank[0] && (a).rank[1] == (b).rank[1] && (a).rank[2] == (b).rank[2] && (a).rank[3] == (b).rank[3]) |
#define | hit_ranksDim(ranks, dim) (ranks.rank[dim]) |
#define | HIT_TOPOLOGY_PLAIN 1 |
#define | HIT_TOPOLOGY_SQUARE 2 |
#define | HIT_TOPOLOGY_ARRAY2DCOMP 3 |
#define | HIT_TOPOLOGY_ARRAYDIMS 4 |
#define | HIT_TOPOLOGY_DUMMYDIMS 5 |
#define | HIT_TOPOLOGY_PLAIN_POWER2 10 |
#define | HIT_TOPOLOGY_NULL_STATIC {0, 0, { 0, 0, 0, 0 }, { { -1, -1, -1, -1} }, 0, NULL } |
#define | hit_topology(name,...) hit_topology_##name(HIT_TOPOLOGY_INFO, ##__VA_ARGS__ ) |
#define | hit_topology_plug_topArray2D(topo) hit_topology_plug_topArrayDims(topo, 2); |
#define | hit_topology_plug_topArray3D(topo) hit_topology_plug_topArrayDims(topo, 3); |
#define | hit_topology_plug_topArray4D(topo) hit_topology_plug_topArrayDims(topo, 4); |
#define | hit_topSelfActive(topo) (topo.active) |
#define | hit_topDims(topo) (topo.numDims) |
#define | hit_topDimCard(topo, i) (topo.card[i]) |
#define | hit_topRanks(topo) (topo.self) |
#define | hit_topDimRank(topo, i) (topo.self.rank[i]) |
#define | hit_topSelfRankInternal(topo) ( (topo).pTopology->selfRank ) |
#define | hit_topDimForeach(topo, dim, index) for( index=0; index<topo.card[dim]; index++) |
#define | hit_topImActive(topo) ((topo).active) |
#define | hit_topImLeader(topo) ((topo).pTopology->selfRank == 0 ) |
#define | hit_topInactiveWarning(topo) |
Typedefs | |
typedef struct HitRanks | HitRanks |
typedef struct HitTopology | HitTopology |
Functions | |
HitTopology | hit_topology_plug_topPlain (HitPTopology *topo) |
HitTopology | hit_topology_plug_topPlainPower2 (HitPTopology *topo) |
HitTopology | hit_topology_plug_topSquare (HitPTopology *topo) |
HitTopology | hit_topology_plug_topArray2DComplete (HitPTopology *topo) |
HitTopology | hit_topology_plug_topArrayDims (HitPTopology *topo, int dims) |
HitTopology | hit_topology_plug_topDummyDims (HitPTopology *topo, int dims, int *virprocelems) |
int | hit_topCard (HitTopology topo) |
void | hit_topFree (HitTopology topo) |
int | hit_topDimNeighbor (HitTopology topo, int dim, int shift) |
int | hit_topRankInternal (HitTopology topo, HitRanks ranks) |
HitRanks | hit_topRanksInternal (HitTopology topo, int linealRank) |
Variables | |
int | HIT_RANK_NULL |
HitRanks | HIT_RANKS_NULL |
HitRanks | HIT_RANKS_LEADER |
HitTopology | HIT_TOPOLOGY_NULL |
Physical and virtual topologies of processes.
Plug-in system to introduce virtual topology generation policies, that defines groups of processes and neighbor relations among them. Support for virtual multidimensional grid topologies.
Definition in file hit_topology.h.
#define HIT_RANK_NULL_STATIC -1 |
Value for null static rank
Definition at line 144 of file hit_topology.h.
#define hit_ranks | ( | numDims, | |
... | |||
) | hit_ranks##numDims( __VA_ARGS__ ) |
HitRanks constructor function. The first argument is the dimension number, the following arguments are the value of the ranks.
numDims | Dimension number for the ranks |
Definition at line 169 of file hit_topology.h.
#define HIT_RANKS_NULL_STATIC { { HIT_RANK_NULL_STATIC, HIT_RANK_NULL_STATIC, HIT_RANK_NULL_STATIC, HIT_RANK_NULL_STATIC } } |
HitRanks null static value
Definition at line 154 of file hit_topology.h.
#define hit_ranksCmp | ( | a, | |
b | |||
) | ((a).rank[0] == (b).rank[0] && (a).rank[1] == (b).rank[1] && (a).rank[2] == (b).rank[2] && (a).rank[3] == (b).rank[3]) |
hit_ranks: Compare two HitRanks
Definition at line 220 of file hit_topology.h.
#define hit_ranksDim | ( | ranks, | |
dim | |||
) | (ranks.rank[dim]) |
hit_ranksDim: Returns the coordinate of a HitRanks object in a given dimension
ranks | HitRanks object |
dim | The number of a dimension |
Definition at line 228 of file hit_topology.h.
#define hit_topDimCard | ( | topo, | |
i | |||
) | (topo.card[i]) |
Cardinality of a topology dimension
Definition at line 413 of file hit_topology.h.
#define hit_topDimForeach | ( | topo, | |
dim, | |||
index | |||
) | for( index=0; index<topo.card[dim]; index++) |
Perform a loop across virtual processors of the given dimension
Definition at line 471 of file hit_topology.h.
#define hit_topDimRank | ( | topo, | |
i | |||
) | (topo.self.rank[i]) |
Self topology coordinate in a given dimension
Definition at line 431 of file hit_topology.h.
#define hit_topDims | ( | topo | ) | (topo.numDims) |
Number of dimensions of the topology
Definition at line 407 of file hit_topology.h.
#define hit_topImActive | ( | topo | ) | ((topo).active) |
Check if the processor is active in the topology
Definition at line 478 of file hit_topology.h.
#define hit_topImLeader | ( | topo | ) | ((topo).pTopology->selfRank == 0 ) |
Check if the processor is the leader (rank 0) in the topology
Definition at line 486 of file hit_topology.h.
#define hit_topInactiveWarning | ( | topo | ) |
Issue a warning in case of inactive processors in a topology
Definition at line 492 of file hit_topology.h.
#define hit_topology | ( | name, | |
... | |||
) | hit_topology_##name(HIT_TOPOLOGY_INFO, ##__VA_ARGS__ ) |
Topology constructor Hitmap provides this function to create some of the most used topologies. This predefined topologies are: plain, square, array2D, array2DComplete, array3D and array4D.
name | The name of the topology. |
Definition at line 308 of file hit_topology.h.
#define HIT_TOPOLOGY_ARRAY2DCOMP 3 |
Array 2D complete topology type constant.
Definition at line 271 of file hit_topology.h.
#define HIT_TOPOLOGY_ARRAYDIMS 4 |
Array dims topology type constant.
Definition at line 276 of file hit_topology.h.
#define HIT_TOPOLOGY_DUMMYDIMS 5 |
Multidimensional dummy topology type constant.
Definition at line 281 of file hit_topology.h.
#define HIT_TOPOLOGY_NULL_STATIC {0, 0, { 0, 0, 0, 0 }, { { -1, -1, -1, -1} }, 0, NULL } |
HitTopology null static value.
Definition at line 298 of file hit_topology.h.
#define HIT_TOPOLOGY_PLAIN 1 |
Plain topology type constant.
Definition at line 261 of file hit_topology.h.
#define HIT_TOPOLOGY_PLAIN_POWER2 10 |
Plain topology with restrictions: Number of active procs is a power of 2
Definition at line 287 of file hit_topology.h.
#define hit_topology_plug_topArray2D | ( | topo | ) | hit_topology_plug_topArrayDims(topo, 2); |
2D Array topology generator
The processors are arranged in a 2-dimensional topology Some processor may be inactive. If the input is power of two the result cardinalities keep this property First dimensions are bigger
Definition at line 374 of file hit_topology.h.
#define hit_topology_plug_topArray3D | ( | topo | ) | hit_topology_plug_topArrayDims(topo, 3); |
3D Array topology generator
The processors are arranged in a 3-dimensional topology Some processor may be inactive. If the input is power of two the result cardinalities keep this property First dimensions are bigger
Definition at line 384 of file hit_topology.h.
#define hit_topology_plug_topArray4D | ( | topo | ) | hit_topology_plug_topArrayDims(topo, 4); |
4D Array topology generator
The processors are arranged in a 4-dimensional topology Some processor may be inactive. If the input is power of two the result cardinalities keep this property First dimensions are bigger
Definition at line 394 of file hit_topology.h.
#define HIT_TOPOLOGY_SQUARE 2 |
Square topology type constant.
Definition at line 266 of file hit_topology.h.
#define hit_topRanks | ( | topo | ) | (topo.self) |
Self rank of the current processor in the topology
Definition at line 425 of file hit_topology.h.
#define hit_topSelfActive | ( | topo | ) | (topo.active) |
Active state of the processor in the topology
Definition at line 401 of file hit_topology.h.
#define hit_topSelfRankInternal | ( | topo | ) | ( (topo).pTopology->selfRank ) |
Self topology linear rank
Definition at line 439 of file hit_topology.h.
/* 2. RANKS IN MULTIDIMENSIONAL GRID ADT for ranks in a multidimensional domain.
typedef struct HitTopology HitTopology |
ADT for topologies A topology is a representation of a set of processor ordered in a number of dimensions. This structure also define the position of the actual processor in the topology.
int hit_topCard | ( | HitTopology | topo | ) |
Topology cardinality: number of active processors in the topology.
Definition at line 361 of file hit_topology.c.
int hit_topDimNeighbor | ( | HitTopology | topo, |
int | dim, | ||
int | shift | ||
) |
Return the neighbor index in the selected dimension with a shift.
Definition at line 376 of file hit_topology.c.
void hit_topFree | ( | HitTopology | topo | ) |
Free the resources used by a topology
Definition at line 129 of file hit_topology.c.
HitTopology hit_topology_plug_topArray2DComplete | ( | HitPTopology * | topo | ) |
Complete 2D Array topology generator
First dimension bigger. All processors are arranged in a two-dimensional topology or in a one-dimensional topology if some of then can't active. All of them are active.
Definition at line 207 of file hit_topology.c.
HitTopology hit_topology_plug_topArrayDims | ( | HitPTopology * | topo, |
int | dims | ||
) |
X-D Array topology generator
The processors are arranged in a X-dimensional topology Some processor may be inactive. If the input is power of two the result cardinalities keep this property First dimensions are bigger
This function is meant to be used thought the macros below.
Definition at line 249 of file hit_topology.c.
HitTopology hit_topology_plug_topDummyDims | ( | HitPTopology * | topo, |
int | dims, | ||
int * | virprocelems | ||
) |
Definition at line 319 of file hit_topology.c.
HitTopology hit_topology_plug_topPlain | ( | HitPTopology * | topo | ) |
Plain topology generator
All the processor are arranged in one dimension. All of them are active.
Definition at line 139 of file hit_topology.c.
HitTopology hit_topology_plug_topPlainPower2 | ( | HitPTopology * | topo | ) |
Plain topology generator, which restricts the number of active processors to a power of 2
All the processor are arranged in one dimension. Only a power of 2 number of processors are active
Definition at line 156 of file hit_topology.c.
HitTopology hit_topology_plug_topSquare | ( | HitPTopology * | topo | ) |
Square topology generator
The processors are arranged in a perfect square two-dimensional topology Uneven processors are inactive
Definition at line 176 of file hit_topology.c.
int hit_topRankInternal | ( | HitTopology | topo, |
HitRanks | ranks | ||
) |
Converts a multidimensional HitRanks in a linear value
Definition at line 415 of file hit_topology.c.
HitRanks hit_topRanksInternal | ( | HitTopology | topo, |
int | linealRank | ||
) |
Converts a linear value in a HitRanks
Definition at line 438 of file hit_topology.c.
int HIT_RANK_NULL |
Value for null rank
Definition at line 67 of file hit_topology.c.
HitRanks HIT_RANKS_LEADER |
Rank of a group leader
HitRanks HIT_RANKS_NULL |
HitRanks null value
Is a HitRanks structure with all the ranks set to HIT_RANK_NULL
Definition at line 68 of file hit_topology.c.
HitTopology HIT_TOPOLOGY_NULL |
HitTopology null value.
Definition at line 64 of file hit_topology.c.