104 #define HIT_LAY_RANKS_ACTIVE_TO_TOPO 0
105 #define HIT_LAY_RANKS_TOPO_TO_ACTIVE 1
121 float* extraParameter );
132 float* extraParameter );
143 float* extraParameter );
173 #define HIT_LAYOUT_NODIM -1
181 #define HIT_SIGLAYOUT_NULL_STATIC {NULL, NULL, NULL, NULL, NULL, NULL, NULL, HIT_LAYOUT_NODIM}
187 #define HIT_NOWRAPPED 0
191 #define HIT_WRAPPED 1
212 #define HIT_GROUP_NULL_STATIC {0, 0}
239 #define HIT_LAYOUTLIST_NULL_STATIC {0, NULL, 0, NULL, 0, 0, 0}
300 #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 }
306 #define HIT_LAYOUT_SIG_CLASS 1
311 #define HIT_LAYOUT_LIST_CLASS 2
316 #define HIT_LAYOUT_BLOCKS 1
321 #define HIT_LAYOUT_DIMBLOCKS 2
326 #define HIT_LAYOUT_MINBLOCKS 3
333 #define HIT_LAYOUT_BLOCKSX 5
338 #define HIT_LAYOUT_BLOCKSF 6
343 #define HIT_LAYOUT_BLOCKSL 7
348 #define HIT_LAYOUT_ALLINLEADER 5
353 #define HIT_LAYOUT_WEIGHTED 8
358 #define HIT_LAYOUT_DIMWEIGHTED 9
363 #define HIT_LAYOUT_CYCLIC 10
369 #define HIT_LAYOUT_BLOCKS_BALANCE 20
376 #define HIT_LAYOUT_LIST_FIRST 100
381 #define HIT_LAYOUT_CONTIGUOUS (HIT_LAYOUT_LIST_FIRST+1)
386 #define HIT_LAYOUT_INDEPENDENTLB (HIT_LAYOUT_LIST_FIRST+2)
391 #define HIT_LAYOUT_METIS (HIT_LAYOUT_LIST_FIRST+3)
398 #define hit_layout_class(lay) (((lay).type<HIT_LAYOUT_LIST_FIRST)?(HIT_LAYOUT_SIG_CLASS):(HIT_LAYOUT_LIST_CLASS))
408 #define HIT_GROUP_ID_NULL -1
415 #define hit_layout( name, topo, ...) hit_layout_##name( topo, __VA_ARGS__ )
605 #define hit_layTopology( lay ) ((lay).topo)
615 #define hit_layGroup( lay ) ((lay).group)
625 #define hit_layLeader( lay ) ((lay).leaderRanks)
630 #define hit_layLoad( lay ) ((lay).ownLoad)
631 #define hit_layPredLoad( lay, dim ) ((lay).predecessorsLoad[dim])
632 #define hit_laySuccLoad( lay, dim ) ((lay).successorsLoad[dim])
642 #define hit_layFullShape(lay) ((lay).origShape)
650 #define hit_layShape(lay) ((lay).shape)
655 #define hit_layNumDims(lay) (hit_shapeDims((lay).shape))
660 #define hit_layDimMaxSize(lay, dim) ((lay).maxSize[dim])
665 #define hit_layDimNumActives(lay, dim) ((lay).numActives[dim])
675 #define hit_layOnDim(lay) ((lay).info.layoutSig.restrictToDim)
680 #define hit_layDimSig( lay, dim ) hit_shapeSig( (lay).shape, dim )
685 #define hit_layDimCard( lay, dim ) hit_sigCard( hit_layDimSig(lay,dim) )
690 #define hit_layCard( lay ) hit_shapeCard( (lay).shape )
695 #define hit_layDimBegin( lay, dim ) hit_layDimSig(lay,dim).begin
700 #define hit_layDimEnd( lay, dim ) hit_layDimSig(lay,dim).end
705 #define hit_layDimStride( lay, dim ) hit_layDimSig(lay,dim).stride
712 #define hit_layDimNeighbor( lay, dim, shift ) hit_layNeighborFromTopoRank(lay, lay.topo.self.rank[dim], dim, shift)
717 #define hit_layDimNeighborAbs( lay, dim, coord ) hit_ranks2( lay.topo.self.rank[dim], dim, shift)
722 #define hit_layNeighbor( lay, dim, shift ) hit_layNeighborRanks(lay, dim, shift)
727 #define hit_layShapeNeighbor(lay, dim, shift) (hit_layout_wrapperNeighborShape( lay, dim, shift ))
732 #define hit_layShapeOther(lay, ranks) (hit_layout_wrapperOtherShape( lay, ranks ))
797 #define hit_layImActive( lay ) ((lay).active)
802 #define hit_layInactiveWarning( lay ) \
803 if ( hit_layImLeader(lay) ) { \
804 int numInactive = hit_topCard( (lay).topo ) - hit_layNumActives( lay ); \
805 if ( numInactive > 0 ) { \
807 sprintf( message, "%d Processors inactive in layout \"%s\"", numInactive, #lay); \
808 hit_warning( message, __FILE__, __LINE__ ); \
817 #define hit_layImLeader( lay ) hit_topImLeader( (lay).topo )
825 #define hit_lsig_vfor(lay, dim, index) \
826 for( hit_lsig_vfor_index[dim]=0, index=0; \
827 hit_lsig_vfor_index[dim]<hit_lsig_numActives(lay,dim); \
828 hit_lsig_vfor_index[dim]++, index=hit_lsig_vDimNeighbor(lay,index,dim,1) )
837 #define hit_layForDimDomain(lay, dim, index) for( index=hit_layDimBegin(lay, dim); \
838 index<=hit_layDimEnd(lay,dim); \
839 index=index+hit_layDimStride(lay,dim) )
848 #define hit_laySelfRanks( lay ) (hit_layToActiveRanks( lay, (lay).topo.self ))
857 #define hit_laySelfRanksDim( lay, dim ) (hit_laySelfRanks( lay ).rank[dim])
866 #define hit_laySelfRank( lay ) ( hit_topoSelfRankInternal( (lay).topo ))
897 #define hit_lgr_numGroups(lay) (lay.info.layoutList.numGroups)
906 #define hit_lgr_group(lay, group) (lay.info.layoutList.groups[group])
909 #define hit_lgr_card(lay) (lay.info.layoutList.cardOwnElements)
910 #define hit_lgr_cardTotal(lay) (lay.info.layoutList.numElementsTotal)
911 #define hit_lgr_cardPred(lay) (lay.info.layoutList.cardPredElements)
912 #define hit_lgr_cardSucc(lay) (lay.info.layoutList.cardSuccElements)
922 #define hit_lgr_leader(lay, element) (lay.info.layoutList.groups[lay.assignedGroups[element]].leader)
930 #define hit_lgr_nProcs(lay, element) (lay.info.layoutList.groups[lay.assignedGroups[element]].numProcs)
938 #define hit_lgr_elementGroup(lay, element) ((lay).info.layoutList.assignedGroups[element])
947 #define hit_layHasElem(lay, element) ((lay).group == (lay).info.layoutList.assignedGroups[element])
959 #define hit_lgr_groupLeader(lay, group) (lay.info.layoutList.groups[group].leader)
967 #define hit_lgr_groupNProcs(lay, group) (lay.info.layoutList.groups[group].numProcs)
977 #define hit_layExtendedShape(lay) ((lay).info.layoutList.extendedShape)
1008 float* extraParameter,
1025 float* extraParameter,
1054 #define hit_layToActiveRanks( lay, ranks ) hit_layTransformRanks( HIT_LAY_RANKS_TOPO_TO_ACTIVE, lay, ranks )
1062 #define hit_layToTopoRanks( lay, ranks ) hit_layTransformRanks( HIT_LAY_RANKS_ACTIVE_TO_TOPO, lay, ranks )
HitLayout hit_layout_plug_layCyclic(HitTopology topo, HitShape shape, int dim)
HitLayout HIT_LAYOUT_NULL
int hit_layDimOwner(HitLayout lay, int dim, int ind)
HitLayoutSig HIT_LAYOUTSIG_NULL
int(* HitLayoutRanksFunction)(char topoActiveMode, int procId, int procsCard, int blocksCard, float *extraParam)
HitLayoutSignatureFunction signatureGenericF
HitLayoutSignatureInvFunction signatureInvRestrictedF
struct HitLayout HitLayout
HitLayoutRanksFunction ranksGenericF
int hit_layNeighborDistance(HitLayout self, int dim, int shift)
HitLayoutSignatureFunction signatureRestrictedF
void hit_lay_elements(HitLayout layout, int group, int **elements, int *nElements)
HitLayout hit_layout_plug_layIndependentLB(HitTopology topo, HitShape elements, const double *weights)
HitShape hit_layMaxShape(HitLayout lay)
HitLayout hit_layout_plug_layNotInLeader(HitTopology topo, HitShape shape)
HitTopology hit_layGroupTopo(HitLayout lay, int groupId)
void hit_layUnwrapNeighbors(HitLayout *lay)
HitPTopology * pTopology[HIT_MAXDIMS+1]
int hit_layActiveRanksId(HitLayout lay, HitRanks ranks)
HitShape hit_layDimMaxShape(HitLayout lay, int dim)
int(* HitLayoutSignatureNumActivesFunction)(int procsCard, int blocksCard, float *extraParameter)
HitShape hit_layout_wrapperOtherShape(HitLayout self, HitRanks ranks)
HitLayout hit_layout_plug_layInLeader(HitTopology topo, HitShape shape)
int hit_layNeighborFrom(HitLayout self, int source, int dim, int shift)
double successorsLoad[HIT_MAXDIMS]
HitRanks hit_layTransformRanks(char topoActiveMode, HitLayout lay, HitRanks ranks)
HitLayout hit_layout_plug_layBlocksBalance(HitTopology topo, HitShape shape, int dim, float load)
int(* HitLayoutSignatureMinCardFunction)(int procsCard, int blocksCard, float *extraParameter)
HitLayoutList HIT_LAYOUTLIST_NULL
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)
HitRanks hit_layActiveIdRanks(HitLayout lay, int id)
HitLayout hit_layout_plug_layBlocks(HitTopology topo, HitShape shape)
HitLayout hit_layout_plug_laySparseRows(HitTopology topo, HitShape *shape)
void hit_layWrapNeighbors(HitLayout *lay)
HitLayout hit_layout_plug_layMinBlocks(HitTopology topo, HitShape shape, int minElems)
HitShape hit_layDimMinShape(HitLayout lay, int dim)
HitLayout hit_layout_plug_layBlocksX(HitTopology topo, HitShape shape)
HitLayout hit_layout_plug_layContiguous(HitTopology topo, HitShape elements, const double *weights)
HitPTopology * pTopologyGroup
void hit_layWrapNeighborsDim(HitLayout *lay, int dim)
HitLayout hit_layout_plug_layMetis(HitTopology topo, HitShape *shape)
HitLayout hit_layout_plug_layBlocksL(HitTopology topo, HitShape shape)
HitLayout hit_layout_plug_layDimWeighted(HitTopology topo, HitShape shape, int restrictDim, float *weights)
void hit_layFree(HitLayout lay)
struct HitLayoutSig HitLayoutSig
int hit_layNeighborFromTopoRank(HitLayout self, int source, int dim, int shift)
int hit_layout_wrapperShape(int topoNumDims, HitRanks proc, int card[HIT_MAXDIMS], HitShape shape, HitShape *newShape, HitLayoutSignatureFunction sigFunctionGeneric, HitLayoutSignatureFunction sigFunctionRestricted, float *extraParameter, int restrictToDim)
HitLayoutSignatureInvFunction signatureInvGenericF
HitShape hit_layMinShape(HitLayout lay)
HitLayout hit_layout_plug_layWeighted(HitTopology topo, HitShape shape, float *weights)
HitShape hit_layout_wrapperNeighborShape(HitLayout self, int dim, int shift)
int(* HitLayoutSignatureFunction)(int procId, int procsCard, int blocksCard, float *extraParam, HitSig input, HitSig *res)
HitLayout hit_layout_plug_layBlocksF(HitTopology topo, HitShape shape)
int hit_layNumActives(HitLayout lay)
double predecessorsLoad[HIT_MAXDIMS]
HitRanks hit_layNeighborRanksFrom(HitLayout self, HitRanks source, int dim, int shift)
int numActives[HIT_MAXDIMS]
int(* HitLayoutSignatureMaxCardFunction)(int procsCard, int blocksCard, float *extraParameter)
HitTopology hit_layActivesTopology(HitLayout lay)
HitLayoutRanksFunction ranksRestrictedF
HitLayout hit_layout_plug_layDimBlocks(HitTopology topo, HitShape shape, int restrictDim)
HitRanks hit_layNeighborRanks(HitLayout self, int dim, int shift)
HitLayout hit_layout_plug_layBitmap(HitTopology topo, HitShape *shape)
void hit_layUnwrapNeighborsDim(HitLayout *lay, int dim)
int(* HitLayoutSignatureInvFunction)(int procId, int procsCard, int blocksCard, float *extraParam, HitSig input, int ind)
HitLayout hit_layout_plug_laySparseBitmapRows(HitTopology topo, HitShape *shapeP)
int hit_lay_procGroup(HitLayout layout, int processor)
int hit_lsig_vfor_index[HIT_MAXDIMS]