Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
hit_layout.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include "hit_shape.h"
#include "hit_topology.h"
#include "hit_error.h"
Include dependency graph for hit_layout.h:
This graph shows which files directly or indirectly include this file:

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
 

Functions

HitLayout hit_layout_plug_layBlocks (HitTopology topo, HitShape shape)
 
HitLayout hit_layout_plug_layDimBlocks (HitTopology topo, HitShape shape, int restrictDim)
 
HitLayout hit_layout_plug_layMinBlocks (HitTopology topo, HitShape shape, int minElems)
 
HitLayout hit_layout_plug_layBlocksX (HitTopology topo, HitShape shape)
 
HitLayout hit_layout_plug_layBlocksF (HitTopology topo, HitShape shape)
 
HitLayout hit_layout_plug_layBlocksL (HitTopology topo, HitShape shape)
 
HitLayout hit_layout_plug_layCyclic (HitTopology topo, HitShape shape, int dim)
 
HitLayout hit_layout_plug_layInLeader (HitTopology topo, HitShape shape)
 
HitLayout hit_layout_plug_layNotInLeader (HitTopology topo, HitShape shape)
 
HitLayout hit_layout_plug_layWeighted (HitTopology topo, HitShape shape, float *weights)
 
HitLayout hit_layout_plug_layDimWeighted (HitTopology topo, HitShape shape, int restrictDim, float *weights)
 
HitLayout hit_layout_plug_layBlocksBalance (HitTopology topo, HitShape shape, int dim, float load)
 
HitLayout hit_layout_plug_layContiguous (HitTopology topo, HitShape elements, const double *weights)
 
HitLayout hit_layout_plug_layIndependentLB (HitTopology topo, HitShape elements, const double *weights)
 
HitLayout hit_layout_plug_layMetis (HitTopology topo, HitShape *shape)
 
HitLayout hit_layout_plug_layBitmap (HitTopology topo, HitShape *shape)
 
HitLayout hit_layout_plug_laySparseRows (HitTopology topo, HitShape *shape)
 
HitLayout hit_layout_plug_laySparseBitmapRows (HitTopology topo, HitShape *shapeP)
 
HitTopology hit_layActivesTopology (HitLayout lay)
 
HitTopology hit_layGroupTopo (HitLayout lay, int groupId)
 
int hit_layNumActives (HitLayout lay)
 
HitShape hit_layMaxShape (HitLayout lay)
 
HitShape hit_layDimMaxShape (HitLayout lay, int dim)
 
HitShape hit_layMinShape (HitLayout lay)
 
HitShape hit_layDimMinShape (HitLayout lay, int dim)
 
void hit_layWrapNeighbors (HitLayout *lay)
 
void hit_layWrapNeighborsDim (HitLayout *lay, int dim)
 
void hit_layUnwrapNeighbors (HitLayout *lay)
 
void hit_layUnwrapNeighborsDim (HitLayout *lay, int dim)
 
void hit_lay_elements (HitLayout layout, int group, int **elements, int *nElements)
 
int hit_lay_procGroup (HitLayout layout, int processor)
 
void hit_layFree (HitLayout lay)
 
HitRanks hit_layTransformRanks (char topoActiveMode, HitLayout lay, HitRanks ranks)
 
int hit_layNeighborFrom (HitLayout self, int source, int dim, int shift)
 
int hit_layNeighborFromTopoRank (HitLayout self, int source, int dim, int shift)
 
int hit_layNeighborDistance (HitLayout self, int dim, int shift)
 
HitRanks hit_layNeighborRanks (HitLayout self, int dim, int shift)
 
HitRanks hit_layNeighborRanksFrom (HitLayout self, HitRanks source, int dim, int shift)
 
HitShape hit_layout_wrapperNeighborShape (HitLayout self, int dim, int shift)
 
HitShape hit_layout_wrapperOtherShape (HitLayout self, HitRanks ranks)
 
int hit_layout_wrapperShape (int topoNumDims, HitRanks proc, int card[HIT_MAXDIMS], HitShape shape, HitShape *newShape, HitLayoutSignatureFunction sigFunctionGeneric, HitLayoutSignatureFunction sigFunctionRestricted, float *extraParameter, int restrictToDim)
 
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)
 
int hit_layActiveRanksId (HitLayout lay, HitRanks ranks)
 
HitRanks hit_layActiveIdRanks (HitLayout lay, int id)
 
int hit_layDimOwner (HitLayout lay, int dim, int ind)
 

Variables

HitLayoutSig HIT_LAYOUTSIG_NULL
 
HitGroup HIT_GROUP_NULL
 
HitLayoutList HIT_LAYOUTLIST_NULL
 
HitLayout HIT_LAYOUT_NULL
 
int hit_lsig_vfor_index [HIT_MAXDIMS]
 

Detailed Description

Layout management funtionalities. A layout maps the indexes of domain expressed as a shape to the processes of a virtual topology.

Version
1.5
Author
Arturo Gonzalez-Escribano
Javier Fresno Bausela
Carlos de Blas Carton
Date
Mar 2013

Definition in file hit_layout.h.

Macro Definition Documentation

#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

Parameters
procIdThe processor ID
procsCardProcessor cardinality
blocksCardBlocks cardinality
wrapThe wrap flat
Returns
The transformed rank

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.

#define hit_layCard (   lay)    hit_shapeCard( (lay).shape )

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.

#define hit_layDimMaxSize (   lay,
  dim 
)    ((lay).maxSize[dim])

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.

#define hit_layDimNumActives (   lay,
  dim 
)    ((lay).numActives[dim])

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.

#define hit_layExtendedShape (   lay)    ((lay).info.layoutList.extendedShape)

hit_layExtendedShape: return the extended sparse shape of a layout.

Parameters
layLayout.
Returns
The extended shape.

Definition at line 977 of file hit_layout.h.

#define hit_layForDimDomain (   lay,
  dim,
  index 
)
Value:
for( index=hit_layDimBegin(lay, dim); \
index<=hit_layDimEnd(lay,dim); \
index=index+hit_layDimStride(lay,dim) )
#define hit_layDimEnd(lay, dim)
Definition: hit_layout.h:700
#define hit_layDimStride(lay, dim)
Definition: hit_layout.h:705
#define hit_layDimBegin(lay, dim)
Definition: hit_layout.h:695
HitLayout lay
Definition: heat.c:107

hit_layForDimDomain: Loop across elements in the virtual process.

Parameters
layLayout.
dimDimension.
indexVariable index.

Definition at line 837 of file hit_layout.h.

#define hit_layFullShape (   lay)    ((lay).origShape)

Active status: TODO: Duplicated A.K.A. "hit_layImActive" (see bellow) Original Shape

Definition at line 642 of file hit_layout.h.

#define hit_layGroup (   lay)    ((lay).group)

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

Parameters
layLayout.
elementDomain index
Returns
True if the index is in the local domain NOTE: TODO: This is the implementation only for the list layouts. Easy to extent for signature

Definition at line 947 of file hit_layout.h.

#define hit_layImActive (   lay)    ((lay).active)

hit_layImActive: Check if the local process is activated in the layout.

Parameters
layLayout.

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

Parameters
layLayout.

Definition at line 817 of file hit_layout.h.

#define hit_layInactiveWarning (   lay)
Value:
if ( hit_layImLeader(lay) ) { \
int numInactive = hit_topCard( (lay).topo ) - hit_layNumActives( lay ); \
if ( numInactive > 0 ) { \
char message[256]; \
sprintf( message, "%d Processors inactive in layout \"%s\"", numInactive, #lay); \
hit_warning( message, __FILE__, __LINE__ ); \
} \
}
#define hit_warning(name, file, numLine)
Definition: hit_error.h:82
#define hit_layImLeader(lay)
Definition: hit_layout.h:817
int hit_topCard(HitTopology topo)
Definition: hit_topology.c:361
int hit_layNumActives(HitLayout lay)
Definition: hit_layout.c:2213
HitLayout lay
Definition: heat.c:107

Issue a warning in case of inactive processors in a layout

Definition at line 802 of file hit_layout.h.

#define hit_layLeader (   lay)    ((lay).leaderRanks)

hit_layLeader: Returns the ranks of the local-group's leader

Definition at line 625 of file hit_layout.h.

#define hit_layLoad (   lay)    ((lay).ownLoad)

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.

#define hit_layOnDim (   lay)    ((lay).info.layoutSig.restrictToDim)

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.

Parameters
layThe layout.
Returns
Its class.

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.

#define hit_layPredLoad (   lay,
  dim 
)    ((lay).predecessorsLoad[dim])

Definition at line 631 of file hit_layout.h.

#define hit_laySelfRank (   lay)    ( hit_topoSelfRankInternal( (lay).topo ))

hit_laySelfRanks: return the rank of the local virtual processor in the group of active virtual processors defined by a given layout

Parameters
laylayout which define the active processors
Returns
int with the rank of the virtual processor 2015/01/22

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

Parameters
laylayout which define the active processors
Returns
HitRanks with the coordinates of the virtual processor

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

Parameters
laylayout which define the active processors
dimselected dimension
Returns
HitRanks with the coordinates of the virtual processor

Definition at line 857 of file hit_layout.h.

#define hit_layShape (   lay)    ((lay).shape)

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.

#define hit_laySuccLoad (   lay,
  dim 
)    ((lay).successorsLoad[dim])

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

Parameters
layLayout.
ranksTopology ranks
Returns
Active ranks

Definition at line 1054 of file hit_layout.h.

#define hit_layTopology (   lay)    ((lay).topo)

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

Parameters
layLayout.
ranksActive ranks
Returns
Topology 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.

#define hit_lgr_elementGroup (   lay,
  element 
)    ((lay).info.layoutList.assignedGroups[element])

hit_lgr_elementGroup: get the group index that has the element.

Deprecated:
Parameters
layLayout.
elementData element.
Returns
The group index.

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.

Deprecated:
Parameters
layLayout.
groupGroup index.
Returns
The group object.

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.

Deprecated:
Parameters
layLayout.
groupGroup index.
Returns
The leader.

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.

Deprecated:
Parameters
layLayout.
groupGroup index.
Returns
The number of processors.

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.

Deprecated:
Parameters
layLayout.
elementData element.
Returns
The leader.

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.

Deprecated:
Parameters
layLayout.
elementData element.
Returns
The number of processors.

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.

Parameters
layLayout.
Returns
The number of groups.

Definition at line 897 of file hit_layout.h.

#define hit_lsig_vfor (   lay,
  dim,
  index 
)
Value:
for( hit_lsig_vfor_index[dim]=0, index=0; \
hit_lsig_vfor_index[dim]<hit_lsig_numActives(lay,dim); \
hit_lsig_vfor_index[dim]++, index=hit_lsig_vDimNeighbor(lay,index,dim,1) )
HitLayout lay
Definition: heat.c:107
int hit_lsig_vfor_index[HIT_MAXDIMS]
Definition: hit_layout.c:59

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.

Typedef Documentation

typedef struct HitLayout HitLayout

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

Parameters
procIdThe processor ID
procsCardProcessor cardinality
blocksCardBlocks cardinality
extraParamOptional extra parameter for some signatures
inputGlobal Signature for the actual dimension
resOutput pointer with the local Signature
Returns
Active status

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.

Parameters
procIdThe processor ID
procsCardProcessor cardinality
blocksCardBlocks cardinality
inputOriginal global Signature for the actual dimension
indIndex to locate
Returns
Rank of the process who has the index

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

Parameters
procsCardProcessors cardinality
blocksCardBlocks cardinality
Returns
The maximum 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

Parameters
procsCardProcessors cardinality
blocksCardBlocks cardinality
Returns
The maximum 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

Parameters
procsCardProcessors cardinality
blocksCardBlocks cardinality
Returns
The number of active processors

Definition at line 141 of file hit_layout.h.

Function Documentation

void hit_lay_elements ( HitLayout  layout,
int  group,
int **  elements,
int *  nElements 
)

List of the elements assigned to a group

Parameters
layoutThe layout.
groupThe asked group number.
elementspointer to a int array where the elements number are alocated.
nElementspointer 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

Parameters
layoutThe layout.
processorThe processor number.
Returns
The group number of the select processor.

Definition at line 2477 of file hit_layout.c.

Here is the caller graph for this function:

HitRanks hit_layActiveIdRanks ( HitLayout  lay,
int  id 
)

hit_layActiveIdRanks: Transforms a process id in multidimensional active ranks in the active grid

Parameters
layLayout.
ranksActive Ranks.
Returns
Process identifier (linear rank).

Definition at line 1935 of file hit_layout.c.

Here is the caller graph for this function:

int hit_layActiveRanksId ( HitLayout  lay,
HitRanks  ranks 
)

hit_layActiveRanksId: Transforms multidimensional active ranks to a process id in the active grid

Parameters
layLayout.
ranksActive Ranks.
Returns
Process identifier (linear rank).

Definition at line 1916 of file hit_layout.c.

Here is the caller graph for this function:

HitTopology hit_layActivesTopology ( HitLayout  lay)

hit_layActivesTopology: Returns the topology with the active processors

Definition at line 2372 of file hit_layout.c.

Here is the call graph for this function:

Here is the caller graph for this function:

HitShape hit_layDimMaxShape ( HitLayout  lay,
int  dim 
)

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.

Parameters
layThe Layout. lay Dimension.
Returns
The maximum shape.

Definition at line 1650 of file hit_layout.c.

HitShape hit_layDimMinShape ( HitLayout  lay,
int  dim 
)

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.

Parameters
layThe Layout. lay Dimension.
Returns
The minimum shape.

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

Parameters
layLayout.
indShape index
Returns
Active rank of the owner

Definition at line 2223 of file hit_layout.c.

Here is the caller graph for this function:

void hit_layFree ( HitLayout  lay)

hit_layFree: free allocated resources used by the layout.

Definition at line 2251 of file hit_layout.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

HitShape hit_layMaxShape ( HitLayout  lay)

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.

Parameters
layThe Layout.
Returns
The maximum shape.

Definition at line 1623 of file hit_layout.c.

Here is the caller graph for this function:

HitShape hit_layMinShape ( HitLayout  lay)

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.

Parameters
layThe Layout.
Returns
The minimum shape.

Definition at line 1677 of file hit_layout.c.

int hit_layNeighborDistance ( HitLayout  self,
int  dim,
int  shift 
)

Definition at line 2001 of file hit_layout.c.

Here is the call graph for this function:

int hit_layNeighborFrom ( HitLayout  self,
int  source,
int  dim,
int  shift 
)

Definition at line 1955 of file hit_layout.c.

Here is the caller graph for this function:

int hit_layNeighborFromTopoRank ( HitLayout  self,
int  source,
int  dim,
int  shift 
)

Definition at line 1982 of file hit_layout.c.

Here is the call graph for this function:

Here is the caller graph for this function:

HitRanks hit_layNeighborRanks ( HitLayout  self,
int  dim,
int  shift 
)

Definition at line 2039 of file hit_layout.c.

HitRanks hit_layNeighborRanksFrom ( HitLayout  self,
HitRanks  source,
int  dim,
int  shift 
)

Definition at line 2008 of file hit_layout.c.

Here is the call graph for this function:

int hit_layNumActives ( HitLayout  lay)

Number of total active processors in the layout

Definition at line 2213 of file hit_layout.c.

Here is the caller graph for this function:

HitLayout hit_layout_plug_layBitmap ( HitTopology  topo,
HitShape shape 
)

Distributes a graph into groups of processors by "rows".

Parameters
topothe topology.
shapethe sparse shape that represents the graph.
Returns
a list layout

Definition at line 2859 of file hit_layout.c.

Here is the call graph for this function:

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.

Parameters
topoThe topology
shapeThe global shape

Definition at line 326 of file hit_layout.c.

Here is the call graph for this function:

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

Parameters
topoThe topology
shapeThe global shape
dimThe dimension in which load balance is applyed
loadThe normalized capability of the first device (between 0.0 and 1.0)

Definition at line 1202 of file hit_layout.c.

Here is the call graph for this function:

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.

Parameters
topoThe topology
shapeThe global shape

Definition at line 721 of file hit_layout.c.

Here is the call graph for this function:

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.

Parameters
topoThe topology
shapeThe global shape

Definition at line 838 of file hit_layout.c.

Here is the call graph for this function:

HitLayout hit_layout_plug_layBlocksX ( HitTopology  topo,
HitShape  shape 
)

An alternative implementation of Blocks

Definition at line 625 of file hit_layout.c.

Here is the call graph for this function:

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.

Parameters
topothe topology.
elementsthe shape that represent the element domain.
weightsthe block weights.
Returns
a list layout.

Definition at line 2652 of file hit_layout.c.

Here is the call graph for this function:

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.

Parameters
topoThe topology
shapeThe global shape
dimNumber of dimensions

Definition at line 948 of file hit_layout.c.

Here is the call graph for this function:

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.

Parameters
topoThe topology
shapeThe global shape
restrictDimThe dimension to apply the block/band partition

Definition at line 382 of file hit_layout.c.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Parameters
topothe topology.
elementsthe shape that represent the element domain.
weightsthe block weights
Returns
a list layout.

Definition at line 2495 of file hit_layout.c.

Here is the call graph for this function:

HitLayout hit_layout_plug_layInLeader ( HitTopology  topo,
HitShape  shape 
)

Hit Layout AllInLeader constructor function Distribute the whole domain to a single proccess: The leader

Parameters
topoThe topology
shapeThe global shape

Definition at line 1013 of file hit_layout.c.

Here is the call graph for this function:

HitLayout hit_layout_plug_layMetis ( HitTopology  topo,
HitShape shape 
)

Use METIS library to distribute a graph into groups of processors.

Parameters
topothe topology.
shapethe sparse shape that represents the graph.
Returns
a list layout

Definition at line 131 of file hit_layoutMetis.c.

Here is the call graph for this function:

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.

Parameters
topoThe topology
shapeThe global shape
minElemsThe minimum number of elements on each partition

Definition at line 529 of file hit_layout.c.

Here is the call graph for this function:

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.

Parameters
topoThe topology
shapeThe global shape
HitLayout hit_layout_plug_laySparseBitmapRows ( HitTopology  topo,
HitShape shapeP 
)

Distributes a matrix into groups of processors by rows.

Parameters
topothe topology.
shapethe sparse shape that represents the matrix.
Returns
a list layout
Note
Layout for bitmap shapes.

Definition at line 3015 of file hit_layout.c.

Here is the call graph for this function:

HitLayout hit_layout_plug_laySparseRows ( HitTopology  topo,
HitShape shape 
)

Distributes a matrix into groups of processors by rows.

Parameters
topothe topology.
shapethe sparse shape that represents the matrix.
Returns
a list layout

Definition at line 2963 of file hit_layout.c.

Here is the call graph for this function:

HitLayout hit_layout_plug_layWeighted ( HitTopology  topo,
HitShape  shape,
float *  weights 
)

TODO: Write the documentation

Definition at line 1538 of file hit_layout.c.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

HitShape hit_layout_wrapperNeighborShape ( HitLayout  self,
int  dim,
int  shift 
)

Definition at line 1815 of file hit_layout.c.

HitShape hit_layout_wrapperOtherShape ( HitLayout  self,
HitRanks  ranks 
)

Definition at line 1792 of file hit_layout.c.

Here is the call graph for this function:

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 1732 of file hit_layout.c.

Here is the caller graph for this function:

HitRanks hit_layTransformRanks ( char  topoActiveMode,
HitLayout  lay,
HitRanks  ranks 
)

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.

Here is the caller graph for this function:

void hit_layWrapNeighborsDim ( HitLayout lay,
int  dim 
)

Set the periodic boundary conditions for one dimension

Definition at line 1602 of file hit_layout.c.

Variable Documentation

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.

See Also
hit_lsig_vfor.

Definition at line 59 of file hit_layout.c.