Hitmap 1.3
|
#include <stdio.h>
#include <stdlib.h>
#include "hit_shape.h"
#include "hit_topology.h"
#include "hit_error.h"
Go to the source code of this file.
Data Structures | |
struct | HitLayoutSig |
struct | HitGroup |
struct | HitLayoutList |
struct | HitLayout |
Macros | |
#define | HIT_LAY_RANKS_ACTIVE_TO_TOPO 0 |
#define | HIT_LAY_RANKS_TOPO_TO_ACTIVE 1 |
#define | HIT_LAYOUT_NODIM -1 |
#define | HIT_SIGLAYOUT_NULL_STATIC {NULL, NULL, NULL, NULL, NULL, NULL, NULL, HIT_LAYOUT_NODIM} |
#define | HIT_NOWRAPPED 0 |
#define | HIT_WRAPPED 1 |
#define | HIT_GROUP_NULL_STATIC {0, 0} |
#define | HIT_LAYOUTLIST_NULL_STATIC {0, NULL, 0, NULL, 0, 0, 0} |
#define | HIT_LAYOUT_NULL_STATIC {0, HIT_TOPOLOGY_NULL_STATIC, { HIT_NOWRAPPED, HIT_NOWRAPPED, HIT_NOWRAPPED, HIT_NOWRAPPED }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0, HIT_GROUP_ID_NULL, 0, HIT_RANKS_NULL_STATIC, HIT_SHAPE_NULL_STATIC, HIT_SHAPE_NULL_STATIC, {NULL, NULL, NULL, NULL, NULL}, NULL, {HIT_SIGLAYOUT_NULL_STATIC}, { 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0 }, 0.0 } |
#define | HIT_LAYOUT_SIG_CLASS 1 |
#define | HIT_LAYOUT_LIST_CLASS 2 |
#define | HIT_LAYOUT_BLOCKS 1 |
#define | HIT_LAYOUT_DIMBLOCKS 2 |
#define | HIT_LAYOUT_MINBLOCKS 3 |
#define | HIT_LAYOUT_BLOCKSX 5 |
#define | HIT_LAYOUT_BLOCKSF 6 |
#define | HIT_LAYOUT_BLOCKSL 7 |
#define | HIT_LAYOUT_ALLINLEADER 5 |
#define | HIT_LAYOUT_WEIGHTED 8 |
#define | HIT_LAYOUT_DIMWEIGHTED 9 |
#define | HIT_LAYOUT_CYCLIC 10 |
#define | HIT_LAYOUT_BLOCKS_BALANCE 20 |
#define | HIT_LAYOUT_LIST_FIRST 100 |
#define | HIT_LAYOUT_CONTIGUOUS (HIT_LAYOUT_LIST_FIRST+1) |
#define | HIT_LAYOUT_INDEPENDENTLB (HIT_LAYOUT_LIST_FIRST+2) |
#define | HIT_LAYOUT_METIS (HIT_LAYOUT_LIST_FIRST+3) |
#define | hit_layout_class(lay) (((lay).type<HIT_LAYOUT_LIST_FIRST)?(HIT_LAYOUT_SIG_CLASS):(HIT_LAYOUT_LIST_CLASS)) |
#define | HIT_GROUP_ID_NULL -1 |
#define | hit_layout(name, topo,...) hit_layout_##name( topo, __VA_ARGS__ ) |
#define | hit_layTopology(lay) ((lay).topo) |
#define | hit_layGroup(lay) ((lay).group) |
#define | hit_layLeader(lay) ((lay).leaderRanks) |
#define | hit_layLoad(lay) ((lay).ownLoad) |
#define | hit_layPredLoad(lay, dim) ((lay).predecessorsLoad[dim]) |
#define | hit_laySuccLoad(lay, dim) ((lay).successorsLoad[dim]) |
#define | hit_layFullShape(lay) ((lay).origShape) |
#define | hit_layShape(lay) ((lay).shape) |
#define | hit_layNumDims(lay) (hit_shapeDims((lay).shape)) |
#define | hit_layDimMaxSize(lay, dim) ((lay).maxSize[dim]) |
#define | hit_layDimNumActives(lay, dim) ((lay).numActives[dim]) |
#define | hit_layOnDim(lay) ((lay).info.layoutSig.restrictToDim) |
#define | hit_layDimSig(lay, dim) hit_shapeSig( (lay).shape, dim ) |
#define | hit_layDimCard(lay, dim) hit_sigCard( hit_layDimSig(lay,dim) ) |
#define | hit_layCard(lay) hit_shapeCard( (lay).shape ) |
#define | hit_layDimBegin(lay, dim) hit_layDimSig(lay,dim).begin |
#define | hit_layDimEnd(lay, dim) hit_layDimSig(lay,dim).end |
#define | hit_layDimStride(lay, dim) hit_layDimSig(lay,dim).stride |
#define | hit_layDimNeighbor(lay, dim, shift) hit_layNeighborFromTopoRank(lay, lay.topo.self.rank[dim], dim, shift) |
#define | hit_layDimNeighborAbs(lay, dim, coord) hit_ranks2( lay.topo.self.rank[dim], dim, shift) |
#define | hit_layNeighbor(lay, dim, shift) hit_layNeighborRanks(lay, dim, shift) |
#define | hit_layShapeNeighbor(lay, dim, shift) (hit_layout_wrapperNeighborShape( lay, dim, shift )) |
#define | hit_layShapeOther(lay, ranks) (hit_layout_wrapperOtherShape( lay, ranks )) |
#define | hit_layImActive(lay) ((lay).active) |
#define | hit_layInactiveWarning(lay) |
#define | hit_layImLeader(lay) hit_topImLeader( (lay).topo ) |
#define | hit_lsig_vfor(lay, dim, index) |
#define | hit_layForDimDomain(lay, dim, index) |
#define | hit_laySelfRanks(lay) (hit_layToActiveRanks( lay, (lay).topo.self )) |
#define | hit_laySelfRanksDim(lay, dim) (hit_laySelfRanks( lay ).rank[dim]) |
#define | hit_laySelfRank(lay) ( hit_topoSelfRankInternal( (lay).topo )) |
#define | hit_lgr_numGroups(lay) (lay.info.layoutList.numGroups) |
#define | hit_lgr_group(lay, group) (lay.info.layoutList.groups[group]) |
#define | hit_lgr_card(lay) (lay.info.layoutList.cardOwnElements) |
#define | hit_lgr_cardTotal(lay) (lay.info.layoutList.numElementsTotal) |
#define | hit_lgr_cardPred(lay) (lay.info.layoutList.cardPredElements) |
#define | hit_lgr_cardSucc(lay) (lay.info.layoutList.cardSuccElements) |
#define | hit_lgr_leader(lay, element) (lay.info.layoutList.groups[lay.assignedGroups[element]].leader) |
#define | hit_lgr_nProcs(lay, element) (lay.info.layoutList.groups[lay.assignedGroups[element]].numProcs) |
#define | hit_lgr_elementGroup(lay, element) ((lay).info.layoutList.assignedGroups[element]) |
#define | hit_layHasElem(lay, element) ((lay).group == (lay).info.layoutList.assignedGroups[element]) |
#define | hit_lgr_groupLeader(lay, group) (lay.info.layoutList.groups[group].leader) |
#define | hit_lgr_groupNProcs(lay, group) (lay.info.layoutList.groups[group].numProcs) |
#define | hit_layExtendedShape(lay) ((lay).info.layoutList.extendedShape) |
#define | hit_layToActiveRanks(lay, ranks) hit_layTransformRanks( HIT_LAY_RANKS_TOPO_TO_ACTIVE, lay, ranks ) |
#define | hit_layToTopoRanks(lay, ranks) hit_layTransformRanks( HIT_LAY_RANKS_ACTIVE_TO_TOPO, lay, ranks ) |
Typedefs | |
typedef int(* | HitLayoutSignatureFunction )(int procId, int procsCard, int blocksCard, float *extraParam, HitSig input, HitSig *res) |
typedef int(* | HitLayoutSignatureInvFunction )(int procId, int procsCard, int blocksCard, float *extraParam, HitSig input, int ind) |
typedef int(* | HitLayoutRanksFunction )(char topoActiveMode, int procId, int procsCard, int blocksCard, float *extraParam) |
typedef int(* | HitLayoutSignatureMaxCardFunction )(int procsCard, int blocksCard, float *extraParameter) |
typedef int(* | HitLayoutSignatureMinCardFunction )(int procsCard, int blocksCard, float *extraParameter) |
typedef int(* | HitLayoutSignatureNumActivesFunction )(int procsCard, int blocksCard, float *extraParameter) |
typedef struct HitLayoutSig | HitLayoutSig |
typedef struct HitLayout | HitLayout |
Variables | |
HitLayoutSig | HIT_LAYOUTSIG_NULL |
HitGroup | HIT_GROUP_NULL |
HitLayoutList | HIT_LAYOUTLIST_NULL |
HitLayout | HIT_LAYOUT_NULL |
int | hit_lsig_vfor_index [HIT_MAXDIMS] |
Layout management funtionalities. A layout maps the indexes of domain expressed as a shape to the processes of a virtual topology.
Definition in file hit_layout.h.
#define HIT_GROUP_ID_NULL -1 |
Null value for group ID
Definition at line 408 of file hit_layout.h.
#define HIT_GROUP_NULL_STATIC {0, 0} |
Null static value for Groups
Definition at line 212 of file hit_layout.h.
#define HIT_LAY_RANKS_ACTIVE_TO_TOPO 0 |
Function type to transform topology ranks to/from active processes ranks
procId | The processor ID |
procsCard | Processor cardinality |
blocksCard | Blocks cardinality |
wrap | The wrap flat |
Definition at line 104 of file hit_layout.h.
#define HIT_LAY_RANKS_TOPO_TO_ACTIVE 1 |
Definition at line 105 of file hit_layout.h.
Shortcut: Cardinality of the whole local shape
Definition at line 690 of file hit_layout.h.
#define hit_layDimBegin | ( | lay, | |
dim | |||
) | hit_layDimSig(lay,dim).begin |
Shortcut: Begin of a signature of the local shape
Definition at line 695 of file hit_layout.h.
#define hit_layDimCard | ( | lay, | |
dim | |||
) | hit_sigCard( hit_layDimSig(lay,dim) ) |
Shortcut: Cardinality of the signature in a given dimension, for the local shape
Definition at line 685 of file hit_layout.h.
#define hit_layDimEnd | ( | lay, | |
dim | |||
) | hit_layDimSig(lay,dim).end |
Shortcut: End of a signature of the local shape
Definition at line 700 of file hit_layout.h.
Max size of the biggest shape
Definition at line 660 of file hit_layout.h.
#define hit_layDimNeighbor | ( | lay, | |
dim, | |||
shift | |||
) | hit_layNeighborFromTopoRank(lay, lay.topo.self.rank[dim], dim, shift) |
This macro returns the neighbor in a dimension with a shift
Definition at line 712 of file hit_layout.h.
#define hit_layDimNeighborAbs | ( | lay, | |
dim, | |||
coord | |||
) | hit_ranks2( lay.topo.self.rank[dim], dim, shift) |
This macro returns the neighbor in a dimension with a given active coordinate
Definition at line 717 of file hit_layout.h.
Number of active processors in a dimension
Definition at line 665 of file hit_layout.h.
#define hit_layDimSig | ( | lay, | |
dim | |||
) | hit_shapeSig( (lay).shape, dim ) |
Shortcut: Signature of a given dimension for the local shape
Definition at line 680 of file hit_layout.h.
#define hit_layDimStride | ( | lay, | |
dim | |||
) | hit_layDimSig(lay,dim).stride |
Shortcut: Stride of a signature of the local shape
Definition at line 705 of file hit_layout.h.
hit_layExtendedShape: return the extended sparse shape of a layout.
lay | Layout. |
Definition at line 977 of file hit_layout.h.
#define hit_layForDimDomain | ( | lay, | |
dim, | |||
index | |||
) |
hit_layForDimDomain: Loop across elements in the virtual process.
lay | Layout. |
dim | Dimension. |
index | Variable index. |
Definition at line 837 of file hit_layout.h.
Active status: TODO: Duplicated A.K.A. "hit_layImActive" (see bellow) Original Shape
Definition at line 642 of file hit_layout.h.
hit_layGroup: Returns the id of the local group
Definition at line 615 of file hit_layout.h.
#define hit_layHasElem | ( | lay, | |
element | |||
) | ((lay).group == (lay).info.layoutList.assignedGroups[element]) |
hit_layHasElement: true if the local layout has the element
lay | Layout. |
element | Domain index |
Definition at line 947 of file hit_layout.h.
hit_layImActive: Check if the local process is activated in the layout.
lay | Layout. |
Definition at line 797 of file hit_layout.h.
#define hit_layImLeader | ( | lay | ) | hit_topImLeader( (lay).topo ) |
hit_layImLeader: Check if the local process is the leader (rank 0) in the topology
lay | Layout. |
Definition at line 817 of file hit_layout.h.
#define hit_layInactiveWarning | ( | lay | ) |
Issue a warning in case of inactive processors in a layout
Definition at line 802 of file hit_layout.h.
hit_layLeader: Returns the ranks of the local-group's leader
Definition at line 625 of file hit_layout.h.
hit_layLoad: Returns the load of the local group
Definition at line 630 of file hit_layout.h.
#define hit_layNeighbor | ( | lay, | |
dim, | |||
shift | |||
) | hit_layNeighborRanks(lay, dim, shift) |
This macro returns all the ranks of neighbor shifting in a given dimmension
Definition at line 722 of file hit_layout.h.
#define hit_layNumDims | ( | lay | ) | (hit_shapeDims((lay).shape)) |
Signature layout number of dimensions
Definition at line 655 of file hit_layout.h.
Is the layout restricted to dimension?
Definition at line 675 of file hit_layout.h.
#define hit_layout | ( | name, | |
topo, | |||
... | |||
) | hit_layout_##name( topo, __VA_ARGS__ ) |
Hit layout constructor macro
Definition at line 415 of file hit_layout.h.
#define HIT_LAYOUT_ALLINLEADER 5 |
Whole structure in the leader
Definition at line 348 of file hit_layout.h.
#define HIT_LAYOUT_BLOCKS 1 |
Blocks layout type constant.
Definition at line 316 of file hit_layout.h.
#define HIT_LAYOUT_BLOCKS_BALANCE 20 |
Blocks with load balancing in one dimension
Definition at line 369 of file hit_layout.h.
#define HIT_LAYOUT_BLOCKSF 6 |
BlocksF (first) layout type constant.
Definition at line 338 of file hit_layout.h.
#define HIT_LAYOUT_BLOCKSL 7 |
BlocksL (last) layout type constant.
Definition at line 343 of file hit_layout.h.
#define HIT_LAYOUT_BLOCKSX 5 |
BlocksX layout type constant.
Definition at line 333 of file hit_layout.h.
#define hit_layout_class | ( | lay | ) | (((lay).type<HIT_LAYOUT_LIST_FIRST)?(HIT_LAYOUT_SIG_CLASS):(HIT_LAYOUT_LIST_CLASS)) |
Hit layout class: Signature layout or List layout.
lay | The layout. |
Definition at line 398 of file hit_layout.h.
#define HIT_LAYOUT_CONTIGUOUS (HIT_LAYOUT_LIST_FIRST+1) |
Contiguous layout type constant.
Definition at line 381 of file hit_layout.h.
#define HIT_LAYOUT_CYCLIC 10 |
Cyclic layout type constant.
Definition at line 363 of file hit_layout.h.
#define HIT_LAYOUT_DIMBLOCKS 2 |
Blocks restricted to one dimension, layout type constant.
Definition at line 321 of file hit_layout.h.
#define HIT_LAYOUT_DIMWEIGHTED 9 |
Blocks size determined by weights, signature type layout
Definition at line 358 of file hit_layout.h.
#define HIT_LAYOUT_INDEPENDENTLB (HIT_LAYOUT_LIST_FIRST+2) |
Independent LB layout type constant.
Definition at line 386 of file hit_layout.h.
#define HIT_LAYOUT_LIST_CLASS 2 |
Constant for list layout class
Definition at line 311 of file hit_layout.h.
#define HIT_LAYOUT_LIST_FIRST 100 |
Constant to distinguish list layout from signature layout.
Definition at line 376 of file hit_layout.h.
#define HIT_LAYOUT_METIS (HIT_LAYOUT_LIST_FIRST+3) |
Metis layout type constant.
Definition at line 391 of file hit_layout.h.
#define HIT_LAYOUT_MINBLOCKS 3 |
Blocks with a minimum size, layout type constant.
Definition at line 326 of file hit_layout.h.
#define HIT_LAYOUT_NODIM -1 |
Indicate that the dimension are not restricted
Definition at line 173 of file hit_layout.h.
#define HIT_LAYOUT_NULL_STATIC {0, HIT_TOPOLOGY_NULL_STATIC, { HIT_NOWRAPPED, HIT_NOWRAPPED, HIT_NOWRAPPED, HIT_NOWRAPPED }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0, HIT_GROUP_ID_NULL, 0, HIT_RANKS_NULL_STATIC, HIT_SHAPE_NULL_STATIC, HIT_SHAPE_NULL_STATIC, {NULL, NULL, NULL, NULL, NULL}, NULL, {HIT_SIGLAYOUT_NULL_STATIC}, { 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0 }, 0.0 } |
Null static value for a layout.
Definition at line 300 of file hit_layout.h.
#define HIT_LAYOUT_SIG_CLASS 1 |
Constant for signature layout class
Definition at line 306 of file hit_layout.h.
#define HIT_LAYOUT_WEIGHTED 8 |
Blocks size determined by weights, signature type layout
Definition at line 353 of file hit_layout.h.
#define HIT_LAYOUTLIST_NULL_STATIC {0, NULL, 0, NULL, 0, 0, 0} |
Null static value for List Layout.
Definition at line 239 of file hit_layout.h.
Definition at line 631 of file hit_layout.h.
hit_laySelfRanks: return the rank of the local virtual processor in the group of active virtual processors defined by a given layout
lay | layout which define the active processors |
Definition at line 866 of file hit_layout.h.
#define hit_laySelfRanks | ( | lay | ) | (hit_layToActiveRanks( lay, (lay).topo.self )) |
hit_laySelfRanks: return the ranks of the local virtual processor in the network of active virtual processors defined by a given layout
lay | layout which define the active processors |
Definition at line 848 of file hit_layout.h.
#define hit_laySelfRanksDim | ( | lay, | |
dim | |||
) | (hit_laySelfRanks( lay ).rank[dim]) |
hit_laySelfRanksDim: return a given dimension of the ranks of the local virtual processor in the network of active virtual processors defined by a given layout
lay | layout which define the active processors |
dim | selected dimension |
Definition at line 857 of file hit_layout.h.
Local shape
Definition at line 650 of file hit_layout.h.
#define hit_layShapeNeighbor | ( | lay, | |
dim, | |||
shift | |||
) | (hit_layout_wrapperNeighborShape( lay, dim, shift )) |
This macro returns the shape of a neighbor
Definition at line 727 of file hit_layout.h.
#define hit_layShapeOther | ( | lay, | |
ranks | |||
) | (hit_layout_wrapperOtherShape( lay, ranks )) |
This macro returns the shape of a neighbor defined by its ranks
Definition at line 732 of file hit_layout.h.
Definition at line 632 of file hit_layout.h.
#define hit_layToActiveRanks | ( | lay, | |
ranks | |||
) | hit_layTransformRanks( HIT_LAY_RANKS_TOPO_TO_ACTIVE, lay, ranks ) |
hit_layToActiveRanks: Transforms topology ranks to active ranks
lay | Layout. |
ranks | Topology ranks |
Definition at line 1054 of file hit_layout.h.
hit_layTopology: Returns the topology used to create the layout
Definition at line 605 of file hit_layout.h.
#define hit_layToTopoRanks | ( | lay, | |
ranks | |||
) | hit_layTransformRanks( HIT_LAY_RANKS_ACTIVE_TO_TOPO, lay, ranks ) |
hit_layToTopoRanks: Transforms active ranks to topology ranks
lay | Layout. |
ranks | Active ranks |
Definition at line 1062 of file hit_layout.h.
#define hit_lgr_card | ( | lay | ) | (lay.info.layoutList.cardOwnElements) |
Definition at line 909 of file hit_layout.h.
#define hit_lgr_cardPred | ( | lay | ) | (lay.info.layoutList.cardPredElements) |
Definition at line 911 of file hit_layout.h.
#define hit_lgr_cardSucc | ( | lay | ) | (lay.info.layoutList.cardSuccElements) |
Definition at line 912 of file hit_layout.h.
#define hit_lgr_cardTotal | ( | lay | ) | (lay.info.layoutList.numElementsTotal) |
Definition at line 910 of file hit_layout.h.
hit_lgr_elementGroup: get the group index that has the element.
lay | Layout. |
element | Data element. |
Definition at line 938 of file hit_layout.h.
#define hit_lgr_group | ( | lay, | |
group | |||
) | (lay.info.layoutList.groups[group]) |
hit_lgr_group: short-cut to get the group.
lay | Layout. |
group | Group index. |
Definition at line 906 of file hit_layout.h.
#define hit_lgr_groupLeader | ( | lay, | |
group | |||
) | (lay.info.layoutList.groups[group].leader) |
hit_lgr_groupLeader: get the leader of the group.
lay | Layout. |
group | Group index. |
Definition at line 959 of file hit_layout.h.
#define hit_lgr_groupNProcs | ( | lay, | |
group | |||
) | (lay.info.layoutList.groups[group].numProcs) |
hit_lgr_groupNProcs: get the number of processors in the group.
lay | Layout. |
group | Group index. |
Definition at line 967 of file hit_layout.h.
#define hit_lgr_leader | ( | lay, | |
element | |||
) | (lay.info.layoutList.groups[lay.assignedGroups[element]].leader) |
hit_lgr_leader: get the leader of the group that has the element.
lay | Layout. |
element | Data element. |
Definition at line 922 of file hit_layout.h.
#define hit_lgr_nProcs | ( | lay, | |
element | |||
) | (lay.info.layoutList.groups[lay.assignedGroups[element]].numProcs) |
hit_lgr_nProcs: get the number of processors of the group that has the element.
lay | Layout. |
element | Data element. |
Definition at line 930 of file hit_layout.h.
#define hit_lgr_numGroups | ( | lay | ) | (lay.info.layoutList.numGroups) |
hit_lgr_numGroups: short-cut to get the number of groups.
lay | Layout. |
Definition at line 897 of file hit_layout.h.
#define hit_lsig_vfor | ( | lay, | |
dim, | |||
index | |||
) |
Definition at line 825 of file hit_layout.h.
#define HIT_NOWRAPPED 0 |
No wrapped (no periodic) signature layouts
Definition at line 187 of file hit_layout.h.
#define HIT_SIGLAYOUT_NULL_STATIC {NULL, NULL, NULL, NULL, NULL, NULL, NULL, HIT_LAYOUT_NODIM} |
Null static value for Signature Layouts
Definition at line 181 of file hit_layout.h.
#define HIT_WRAPPED 1 |
Wrapped (periodic) signature layouts
Definition at line 191 of file hit_layout.h.
ADT for layouts.
This ADT keeps both signature and list layouts. In layouts groups the relations of neighbors is only defined between leaders.
typedef int(* HitLayoutRanksFunction)(char topoActiveMode, int procId, int procsCard, int blocksCard, float *extraParam) |
Definition at line 106 of file hit_layout.h.
typedef struct HitLayoutSig HitLayoutSig |
ADT for the specific part of a layout signature. A Signature Layout contains the shape that is a partition of the original shape, a pointer to a function to calculate the signatures of the other processors shapes and a integer that is used to restrict the shape to a given number of dimensions.
typedef int(* HitLayoutSignatureFunction)(int procId, int procsCard, int blocksCard, float *extraParam, HitSig input, HitSig *res) |
Function type to calculate the Signature of the current processor in one dimension
procId | The processor ID |
procsCard | Processor cardinality |
blocksCard | Blocks cardinality |
extraParam | Optional extra parameter for some signatures |
input | Global Signature for the actual dimension |
res | Output pointer with the local Signature |
Definition at line 73 of file hit_layout.h.
typedef int(* HitLayoutSignatureInvFunction)(int procId, int procsCard, int blocksCard, float *extraParam, HitSig input, int ind) |
Function type to calculate the inverse of the Signature. Returns who has a given index.
procId | The processor ID |
procsCard | Processor cardinality |
blocksCard | Blocks cardinality |
input | Original global Signature for the actual dimension |
ind | Index to locate |
Definition at line 89 of file hit_layout.h.
typedef int(* HitLayoutSignatureMaxCardFunction)(int procsCard, int blocksCard, float *extraParameter) |
Function type to calculate the maximum cardinality of the assigned blocks
procsCard | Processors cardinality |
blocksCard | Blocks cardinality |
Definition at line 119 of file hit_layout.h.
typedef int(* HitLayoutSignatureMinCardFunction)(int procsCard, int blocksCard, float *extraParameter) |
Function type to calculate the minimum cardinality of the assigned blocks
procsCard | Processors cardinality |
blocksCard | Blocks cardinality |
Definition at line 130 of file hit_layout.h.
typedef int(* HitLayoutSignatureNumActivesFunction)(int procsCard, int blocksCard, float *extraParameter) |
Function type to calculate the number of active proceesors
procsCard | Processors cardinality |
blocksCard | Blocks cardinality |
Definition at line 141 of file hit_layout.h.
void hit_lay_elements | ( | HitLayout | layout, |
int | group, | ||
int ** | elements, | ||
int * | nElements | ||
) |
List of the elements assigned to a group
layout | The layout. |
group | The asked group number. |
elements | pointer to a int array where the elements number are alocated. |
nElements | pointer to a int where the number of elements are saved. |
Definition at line 2452 of file hit_layout.c.
int hit_lay_procGroup | ( | HitLayout | layout, |
int | processor | ||
) |
Calculate the group number for a given processor
layout | The layout. |
processor | The processor number. |
Definition at line 2477 of file hit_layout.c.
hit_layActiveIdRanks: Transforms a process id in multidimensional active ranks in the active grid
lay | Layout. |
ranks | Active Ranks. |
Definition at line 1935 of file hit_layout.c.
hit_layActiveRanksId: Transforms multidimensional active ranks to a process id in the active grid
lay | Layout. |
ranks | Active Ranks. |
Definition at line 1916 of file hit_layout.c.
HitTopology hit_layActivesTopology | ( | HitLayout | lay | ) |
hit_layActivesTopology: Returns the topology with the active processors
Definition at line 2372 of file hit_layout.c.
Return the maximum shape of the neighbors in a given dimension in a the layout. This function can be used to make a buffer to share date among neighbors in a dimension.
lay | The Layout. lay Dimension. |
Definition at line 1650 of file hit_layout.c.
Return the minimum shape of the neighbors in a given dimension in a the layout. This function can be used to make a buffer to share date among neighbors in a dimension.
lay | The Layout. lay Dimension. |
Definition at line 1704 of file hit_layout.c.
int hit_layDimOwner | ( | HitLayout | lay, |
int | dim, | ||
int | ind | ||
) |
hit_layDimOwner: Transforms shape index to active rank of the owner process
lay | Layout. |
ind | Shape index |
Definition at line 2223 of file hit_layout.c.
void hit_layFree | ( | HitLayout | lay | ) |
hit_layFree: free allocated resources used by the layout.
Definition at line 2251 of file hit_layout.c.
HitTopology hit_layGroupTopo | ( | HitLayout | lay, |
int | groupId | ||
) |
hit_layGroupTopo: Builds and returns the subtopology of a given group
Definition at line 2318 of file hit_layout.c.
Return the maximum shape of the neighbors in the layout. This function can be used to make a buffer to share date among the processors.
lay | The Layout. |
Definition at line 1623 of file hit_layout.c.
Return the minimum shape of the neighbors in the layout. This function can be used to make a buffer to share date among the processors.
lay | The Layout. |
Definition at line 1677 of file hit_layout.c.
int hit_layNeighborDistance | ( | HitLayout | self, |
int | dim, | ||
int | shift | ||
) |
int hit_layNeighborFrom | ( | HitLayout | self, |
int | source, | ||
int | dim, | ||
int | shift | ||
) |
int hit_layNeighborFromTopoRank | ( | HitLayout | self, |
int | source, | ||
int | dim, | ||
int | shift | ||
) |
Definition at line 1982 of file hit_layout.c.
Definition at line 2039 of file hit_layout.c.
int hit_layNumActives | ( | HitLayout | lay | ) |
Number of total active processors in the layout
Definition at line 2213 of file hit_layout.c.
HitLayout hit_layout_plug_layBitmap | ( | HitTopology | topo, |
HitShape * | shape | ||
) |
Distributes a graph into groups of processors by "rows".
topo | the topology. |
shape | the sparse shape that represents the graph. |
Definition at line 2859 of file hit_layout.c.
HitLayout hit_layout_plug_layBlocks | ( | HitTopology | topo, |
HitShape | shape | ||
) |
Hit Layout Blocks constructor function This layout leave the inactive processor at the end of the dimension when there are more processor than data.
topo | The topology |
shape | The global shape |
Definition at line 326 of file hit_layout.c.
HitLayout hit_layout_plug_layBlocksBalance | ( | HitTopology | topo, |
HitShape | shape, | ||
int | dim, | ||
float | load | ||
) |
Hit Layout Blocks with Load Balance in One Dimension constructor function This layout leave the inactive processor at the end of the dimension when there are more processor that data.
TODO: This is a test implementation for only two types of devices that simply applies a trivial load-balancing in one dimension
topo | The topology |
shape | The global shape |
dim | The dimension in which load balance is applyed |
load | The normalized capability of the first device (between 0.0 and 1.0) |
Definition at line 1202 of file hit_layout.c.
HitLayout hit_layout_plug_layBlocksF | ( | HitTopology | topo, |
HitShape | shape | ||
) |
Hit Layout BlocksF constructor function (Blocks at First) This layout mix active and inactive processors in a regular way making groups when there are more processor than data. The leader is the first processor in the group.
topo | The topology |
shape | The global shape |
Definition at line 721 of file hit_layout.c.
HitLayout hit_layout_plug_layBlocksL | ( | HitTopology | topo, |
HitShape | shape | ||
) |
Hit Layout BlocksF constructor function (Blocks at Last) This layout mix active and inactive processors in a regular way making groups when there are more processor than data. The leader is the last processor in the group.
topo | The topology |
shape | The global shape |
Definition at line 838 of file hit_layout.c.
HitLayout hit_layout_plug_layBlocksX | ( | HitTopology | topo, |
HitShape | shape | ||
) |
An alternative implementation of Blocks
Definition at line 625 of file hit_layout.c.
HitLayout hit_layout_plug_layContiguous | ( | HitTopology | topo, |
HitShape | elements, | ||
const double * | weights | ||
) |
hit_layout_plug_layContiguous: generic sheduling of n contiguos blocks to m processors, according to block weights.
topo | the topology. |
elements | the shape that represent the element domain. |
weights | the block weights. |
Definition at line 2652 of file hit_layout.c.
HitLayout hit_layout_plug_layCyclic | ( | HitTopology | topo, |
HitShape | shape, | ||
int | dim | ||
) |
Hit Layout Cyclic constructor function Distribute the data defined by a shape among the processors in a cyclic way.
topo | The topology |
shape | The global shape |
dim | Number of dimensions |
Definition at line 948 of file hit_layout.c.
HitLayout hit_layout_plug_layDimBlocks | ( | HitTopology | topo, |
HitShape | shape, | ||
int | restrictDim | ||
) |
Hit Layout DimBlocks constructor function Applies blocks in a given dimension. This layout leave the inactive processor at the end of the dimension when there are more processor than data.
topo | The topology |
shape | The global shape |
restrictDim | The dimension to apply the block/band partition |
Definition at line 382 of file hit_layout.c.
HitLayout hit_layout_plug_layDimWeighted | ( | HitTopology | topo, |
HitShape | shape, | ||
int | restrictDim, | ||
float * | weights | ||
) |
TODO: Write the documentation
Definition at line 1484 of file hit_layout.c.
HitLayout hit_layout_plug_layIndependentLB | ( | HitTopology | topo, |
HitShape | elements, | ||
const double * | weights | ||
) |
hit_layout_plug_layIndependentLB: generic sheduling of n independent blocks to m processors, according to block weights.
topo | the topology. |
elements | the shape that represent the element domain. |
weights | the block weights |
Definition at line 2495 of file hit_layout.c.
HitLayout hit_layout_plug_layInLeader | ( | HitTopology | topo, |
HitShape | shape | ||
) |
Hit Layout AllInLeader constructor function Distribute the whole domain to a single proccess: The leader
topo | The topology |
shape | The global shape |
Definition at line 1013 of file hit_layout.c.
HitLayout hit_layout_plug_layMetis | ( | HitTopology | topo, |
HitShape * | shape | ||
) |
Use METIS library to distribute a graph into groups of processors.
topo | the topology. |
shape | the sparse shape that represents the graph. |
Definition at line 131 of file hit_layoutMetis.c.
HitLayout hit_layout_plug_layMinBlocks | ( | HitTopology | topo, |
HitShape | shape, | ||
int | minElems | ||
) |
Hit Layout MinBlocks constructor function The resulting blocks will have a minimum number of elements. This layout leave the inactive processor at the end of the dimension when there are more processor than data.
topo | The topology |
shape | The global shape |
minElems | The minimum number of elements on each partition |
Definition at line 529 of file hit_layout.c.
HitLayout hit_layout_plug_layNotInLeader | ( | HitTopology | topo, |
HitShape | shape | ||
) |
Hit Layout NotInLeader constructor function Distribute the whole domain among all processes different of the leader. This layout leaves the inactive processor at the end of the dimension when there are more processor than data.
topo | The topology |
shape | The global shape |
HitLayout hit_layout_plug_laySparseBitmapRows | ( | HitTopology | topo, |
HitShape * | shapeP | ||
) |
Distributes a matrix into groups of processors by rows.
topo | the topology. |
shape | the sparse shape that represents the matrix. |
Definition at line 3015 of file hit_layout.c.
HitLayout hit_layout_plug_laySparseRows | ( | HitTopology | topo, |
HitShape * | shape | ||
) |
Distributes a matrix into groups of processors by rows.
topo | the topology. |
shape | the sparse shape that represents the matrix. |
Definition at line 2963 of file hit_layout.c.
HitLayout hit_layout_plug_layWeighted | ( | HitTopology | topo, |
HitShape | shape, | ||
float * | weights | ||
) |
TODO: Write the documentation
Definition at line 1538 of file hit_layout.c.
HitLayout hit_layout_wrapper | ( | HitTopology | topo, |
HitShape | shape, | ||
HitLayoutSignatureFunction | signatureGenericF, | ||
HitLayoutSignatureInvFunction | signatureInvGenericF, | ||
HitLayoutSignatureFunction | signatureRestrictedF, | ||
HitLayoutSignatureInvFunction | signatureInvRestrictedF, | ||
HitLayoutRanksFunction | ranksGenericF, | ||
HitLayoutRanksFunction | ranksRestrictedF, | ||
HitLayoutSignatureMaxCardFunction | maxCardGenericF, | ||
HitLayoutSignatureMaxCardFunction | maxCardRestrictedF, | ||
HitLayoutSignatureMinCardFunction | minCardGenericF, | ||
HitLayoutSignatureMinCardFunction | minCardRestrictedF, | ||
HitLayoutSignatureNumActivesFunction | activesGenericF, | ||
HitLayoutSignatureNumActivesFunction | activesRestrictedF, | ||
float * | extraParameter, | ||
int | restrictToDim | ||
) |
Definition at line 2073 of file hit_layout.c.
Definition at line 1815 of file hit_layout.c.
int hit_layout_wrapperShape | ( | int | topoNumDims, |
HitRanks | proc, | ||
int | card[HIT_MAXDIMS], | ||
HitShape | shape, | ||
HitShape * | newShape, | ||
HitLayoutSignatureFunction | sigFunctionGeneric, | ||
HitLayoutSignatureFunction | sigFunctionRestricted, | ||
float * | extraParameter, | ||
int | restrictToDim | ||
) |
Definition at line 1886 of file hit_layout.c.
void hit_layUnwrapNeighbors | ( | HitLayout * | lay | ) |
Unset the periodic boundary conditions
Definition at line 1607 of file hit_layout.c.
void hit_layUnwrapNeighborsDim | ( | HitLayout * | lay, |
int | dim | ||
) |
Unset the periodic boundary conditions for one dimension
Definition at line 1616 of file hit_layout.c.
void hit_layWrapNeighbors | ( | HitLayout * | lay | ) |
Set the periodic boundary conditions
Definition at line 1593 of file hit_layout.c.
void hit_layWrapNeighborsDim | ( | HitLayout * | lay, |
int | dim | ||
) |
Set the periodic boundary conditions for one dimension
Definition at line 1602 of file hit_layout.c.
HitGroup HIT_GROUP_NULL |
Null value for Groups.
Definition at line 65 of file hit_layout.c.
HitLayout HIT_LAYOUT_NULL |
Null value for a layout.
Definition at line 71 of file hit_layout.c.
HitLayoutList HIT_LAYOUTLIST_NULL |
Null value for List Layout.
Definition at line 68 of file hit_layout.c.
HitLayoutSig HIT_LAYOUTSIG_NULL |
Null value for Signature Layouts
Definition at line 62 of file hit_layout.c.
int hit_lsig_vfor_index[HIT_MAXDIMS] |
Extern array used by the hit_lsig_vfor function.
Definition at line 59 of file hit_layout.c.