62 #define hit_mpiTestError(ok,cad) \
63 if ( ok != MPI_SUCCESS ) { \
64 fprintf(stderr,"Hit MPI RunTime-Error, Rank %d: %s - %d\n", hit_Rank, cad, ok); fflush(stderr); \
72 #define HIT_CHAR MPI_CHAR
74 #define HIT_INT MPI_INT
76 #define HIT_FLOAT MPI_FLOAT
78 #define HIT_DOUBLE MPI_DOUBLE
80 #define HIT_BOOL MPI_BOOL
89 #define HIT_COMTYPE_NULL 0
91 #define HIT_SENDRECV 3
95 #define HIT_ALLREDUCE 5
97 #define HIT_ALLTOALL 6
99 #define HIT_ALLTOALLV 7
101 #define HIT_BROADCAST 8
103 #define HIT_SENDRECV_REPLACE 9
105 #define HIT_SPARSE_UPDATE 10
107 #define HIT_SPARSE_SCATTER 11
109 #define HIT_ALLDISTRIBUTE 12
111 #define HIT_SPARSE_SCATTER_ROWS 13
113 #define HIT_ALLGATHERV 14
132 #define HIT_ANY_TAG 0
135 #define HIT_COM_MYSELF -100
140 #define hit_Rank (HIT_TOPOLOGY_INFO->selfRank)
142 #define hit_NProcs (HIT_TOPOLOGY_INFO->numProcs)
145 #define hit_Comm (HIT_TOPOLOGY_INFO->comm)
170 HitType
hit_comType(
const void *varP, HitType baseType);
181 #define HIT_TYPE_NULL MPI_DATATYPE_NULL
187 #define hit_comFreeType(type) if (type!=HIT_TYPE_NULL) MPI_Type_free( &type );
208 #define hit_comTypeStruct(new_type,Nstruct,n, ...) hit_comTypeStruct##n(new_type,Nstruct,__VA_ARGS__)
308 #define HIT_COM_NULL_STATIC { \
309 .commType = HIT_COMTYPE_NULL, \
310 .myself=MPI_PROC_NULL, \
311 .sendTo=MPI_PROC_NULL, \
312 .recvFrom=MPI_PROC_NULL, \
314 .typeSend=HIT_TYPE_NULL, \
315 .typeRecv=HIT_TYPE_NULL, \
318 .comm=MPI_COMM_NULL, \
319 .requestSend=MPI_REQUEST_NULL, \
320 .requestRecv=MPI_REQUEST_NULL, \
330 #define HIT_COM_ALLTOALLV_NULL_STATIC {NULL,NULL,NULL,NULL,NULL}
335 #define HIT_COM_SPARSE_NULL_STATIC {HIT_SHAPE_NULL_STATIC, NULL, NULL, NULL, 0, 0, 0, NULL}
343 #define HIT_COM_TILECOORDS 0x43
345 #define HIT_COM_ARRAYCOORDS 0x44
358 #define hit_comSendRecv(lay, sendTo, tilePSend, receiveFrom, tilePRecv, baseType) hit_comSendRecvSelect(lay, sendTo, tilePSend, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, receiveFrom, tilePRecv, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType)
371 #define hit_comSendRecvTag(lay, sendTo, tilePSend, receiveFrom, tilePRecv, baseType, tag) hit_comSendRecvSelectTag(lay, sendTo, tilePSend, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, receiveFrom, tilePRecv, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType, tag)
387 #define hit_comSendRecvSelect(lay, sendTo, tilePSend, selectionSend, modeSelectSend, receiveFrom, tilePRecv, selectionRecv, modeSelectRecv, baseType) hit_comSendRecvSelectTag(lay, sendTo, tilePSend, selectionSend, modeSelectSend, receiveFrom, tilePRecv, selectionRecv, modeSelectRecv, baseType, HIT_ANY_TAG)
404 HitCom hit_comSendRecvSelectTag(
HitLayout lay,
HitRanks sendTo,
const void *tilePSend,
HitShape selectionSend,
int modeSelectSend,
HitRanks receiveFrom,
const void *tilePRecv,
HitShape selectionRecv,
int modeSelectRecv, HitType baseType,
int tag);
419 #define hit_comSendSelectTag(lay, sendTo, tileP, selection, modeSelect, baseType, tag) hit_comSendRecvSelectTag(lay, sendTo, tileP, selection, modeSelect, HIT_RANKS_NULL, &HIT_TILE_NULL, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType, tag)
430 #define hit_comSendTag(lay, sendTo, tileP, baseType, tag) hit_comSendRecvSelectTag(lay, sendTo, tileP, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, HIT_RANKS_NULL, &HIT_TILE_NULL, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType, tag)
442 #define hit_comSendSelect(lay, sendTo, tileP, selection, modeSelect, baseType) hit_comSendRecvSelect(lay, sendTo, tileP, selection, modeSelect, HIT_RANKS_NULL, &HIT_TILE_NULL, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType)
452 #define hit_comSend(lay, sendTo, tileP, baseType) hit_comSendRecvSelect(lay, sendTo, tileP, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, HIT_RANKS_NULL, &HIT_TILE_NULL, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType)
466 #define hit_comRecvSelectTag(lay, receiveFrom, tileP, selection, modeSelect, baseType, tag) hit_comSendRecvSelectTag(lay, HIT_RANKS_NULL, &HIT_TILE_NULL, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, receiveFrom, tileP, selection, modeSelect, baseType, tag)
477 #define hit_comRecvTag(lay, receiveFrom, tileP, baseType, tag) hit_comSendRecvSelect(lay, HIT_RANKS_NULL, &HIT_TILE_NULL, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, receiveFrom, tileP, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType, tag)
489 #define hit_comRecvSelect(lay, receiveFrom, tileP, selection, modeSelect, baseType) hit_comSendRecvSelect(lay, HIT_RANKS_NULL, &HIT_TILE_NULL, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, receiveFrom, tileP, selection, modeSelect, baseType)
499 #define hit_comRecv(lay, receiveFrom, tileP, baseType) hit_comSendRecvSelect(lay, HIT_RANKS_NULL, &HIT_TILE_NULL, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, receiveFrom, tileP, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType)
509 #define hit_comUpdateSendTile(comm, sendTile) comm.dataSend=sendTile.data
519 #define hit_comUpdateRecvTile(comm, recvTile) comm.dataRecv=recvTile.data
529 #define hit_comUpdateSendTo(comm, topo, SendTo) comm.sendTo=hit_topRankInternal(topo,SendTo)
539 #define hit_comUpdateRecvFrom(comm, topo, RecvFrom) comm.recvFrom=hit_topRankInternal(topo,RecvFrom)
550 #define hit_comUpdateDimSendTo(comm, dim, SendTo) comm.sendTo=SendTo
561 #define hit_comUpdateDimRecvFrom(comm, dim, RecvFrom) comm.recvFrom=RecvFrom
570 #define hit_comUpdateTag(comm, Tag) comm.tag=Tag
587 #define hit_comAllowDims(lay) {\
589 for (hit_i=0;hit_i<hit_layNumDims(lay); hit_i++) hit_comAllowDim(&lay,hit_i); \
619 #define hit_comShiftDimSelect(lay, dim, shift, tileP, selection, modeSelect, baseType, tag) hit_comSendRecvReplaceSelectTag(lay, hit_layNeighbor(lay,dim,shift), tileP, selection, modeSelect, hit_layNeighbor(lay,dim,-shift), baseType, tag)
646 #define hit_comShiftDim(lay, dim, shift, tileP, baseType) hit_comShiftDimSelect(lay, dim, shift, tileP, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType, HIT_ANY_TAG)
661 #define hit_comShiftDimAsync(lay, dim, shift, tileSend, tileRecv, baseType, tag) hit_comSendRecvTag(lay, hit_layNeighbor( lay, dim, shift ), tileSend, hit_layNeighbor( lay, dim, -shift ), tileRecv, baseType, tag)
673 #define hit_comBroadcast(lay, root, tile, baseType) hit_comBroadcastSelect(lay, root, tile, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType)
696 #define hit_comBroadcastDim(lay, dim, root, tile, baseType) hit_comBroadcastDimSelect(lay, dim, root, tile, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType)
725 #define hit_comReduce(lay, root, tilePSend, tilePRecv, baseType, operation) hit_comReduceSelect(lay, root, tilePSend, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, tilePRecv, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType, operation)
756 #define hit_comReduceDim(lay, dim, root, tilePSend, tilePRecv, baseType, operation) hit_comReduceDimSelect(lay, dim, root, tilePSend, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, tilePRecv, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType, operation)
774 HitCom hit_comReduceDimSelect(
HitLayout lay,
int dim,
HitRanks root,
const void * tilePSend,
HitShape selectionSend,
int modeSelectSend,
const void * tilePRecv,
HitShape selectionRecv,
int modeSelectRecv, HitType baseType, HitOp operation);
785 #define hit_comAlltoall(lay, tilePSend, tilePRecv, baseType, count) hit_comAlltoallSelect(lay, tilePSend, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, tilePRecv, HIT_SHAPE_WHOLE, HIT_COM_TILECOORDS, baseType, count)
812 #define hit_comAlltoallv(lay, tilePSend, selectionSend, tilePRecv, selectionRecv, baseType) hit_comAlltoallSelectv(lay, tilePSend, selectionSend, HIT_COM_TILECOORDS, tilePRecv, selectionRecv, HIT_COM_TILECOORDS, baseType)
852 #define hit_comSparseScatter(lay, tilePSend, tilePRecv, baseType) hit_comSparseScatterInternal(lay, tilePSend, tilePRecv, baseType, __FILE__, __LINE__)
863 #define hit_comSparseScatterRows(lay, tilePSend, tilePRecv, baseType) hit_comSparseScatterRowsInternal(lay, tilePSend, tilePRecv, baseType, __FILE__, __LINE__)
891 #define hit_comAllGatherv(lay, tilePSend, tilePRecv, baseType) hit_comAllGathervInternal(lay, tilePSend, tilePRecv, baseType, __FILE__, __LINE__)
909 #define hit_comTagSet( ... ) enum { __VA_ARGS__ }
983 #define hit_comDoSendRecv( comm ) { \
984 hit_comStartSend( &(comm) ); \
985 hit_comDoRecv( &(comm) ); \
986 hit_comEndSend( &(comm) ); \
1003 #define hit_comDoOnce( com ) { HitCom __HIT_COM__ = com; hit_comDo( & __HIT_COM__ ); hit_comFree( __HIT_COM__ ); }
1012 #define hit_error(name,file,numLine) \
1014 fprintf(stderr,"Hit Programmer, RunTime-Error Rank(%d): %s, in %s[%d]\n", hit_Rank, name, file, numLine); \
1016 exit( HIT_ERR_USER ); \
1027 #define hit_comBarrier( lay ) MPI_Barrier( lay.pTopology[0]->comm )
1036 #define hit_comOp(function,operation) MPI_Op_create((HitReduceFunction *)function, 1, &(operation) );
1042 #define hit_comOpNoCommutative(function,operation) MPI_Op_create(function, 0, &(operation) );
1048 #define hit_comOpFree( operation ) MPI_Op_free( &(operation) );
void hit_comDoSend(HitCom *issue)
HitCom hit_comSparseUpdateBitmap(HitLayout lay, const void *tileP, HitType baseType)
void hit_comDoReduce(HitCom *issue)
HitType hit_comTypeRec(const void *varP, HitType baseType)
struct HitComSparse * sparse
HitCom hit_comSparseUpdate(HitLayout lay, const void *tileP, HitType baseType)
HitComAlltoallv HIT_COM_ALLTOALLV_NULL
void hit_comOpSumDouble(void *, void *, int *, HitType *)
HitComSparse HIT_COM_SPARSE_NULL
HitCom hit_comBroadcastSelect(HitLayout lay, HitRanks root, const void *tile, HitShape selection, int modeSelect, HitType baseType)
HitCom hit_comAllGathervInternal(HitLayout lay, const void *tilePSend, const void *tilePRecv, HitType baseType, const char *file, int line)
void hit_comOpMaxInt(void *, void *, int *, HitType *)
void hit_comDoSendRecvReplace(HitCom *issue)
void hit_comEndRecv(HitCom *issue)
void hit_comFree(HitCom issue)
HitCom hit_comSendRecvSelectTag(HitLayout lay, HitRanks sendTo, const void *tilePSend, HitShape selectionSend, int modeSelectSend, HitRanks receiveFrom, const void *tilePRecv, HitShape selectionRecv, int modeSelectRecv, HitType baseType, int tag)
void hit_comDo(HitCom *issue)
void hit_comStartRecv(HitCom *issue)
HitCom hit_comSparseScatterInternal(HitLayout lay, const void *tilePSend, const void *tilePRecv, HitType baseType, const char *file, int line)
HitCom hit_comReduceSelect(HitLayout lay, HitRanks root, const void *tilePSend, HitShape selectionSend, int modeSelectSend, const void *tilePRecv, HitShape selectionRecv, int modeSelectRecv, HitType baseType, HitOp operation)
MPI_User_function HitReduceFunction
HitCom hit_comAllDistribute(HitLayout lay, const void *tilePSend, int *count, const void *tilePRecv, HitType baseType)
HitCom hit_comSparseUpdateCSR(HitLayout lay, const void *tileP, HitType baseType)
void hit_comEndSend(HitCom *issue)
HitCom hit_comAlltoallSelectv(HitLayout lay, const void *tilePSend, HitShape *selectionSend, int modeSelectSend, const void *tilePRecv, HitShape *selectionRecv, int modeSelectRecv, HitType baseType)
void hit_comOpSumInt(void *, void *, int *, HitType *)
void(* HitComOpFunction)(void *, void *)
void hit_comDoAlltoallv(HitCom *issue)
void hit_comDoAlltoall(HitCom *issue)
HitCom hit_comBroadcastDimSelect(HitLayout lay, int dim, int root, const void *tile, HitShape selection, int modeSelect, HitType baseType)
void hit_comUpdateOriginData(HitCom *com, const void *tileP)
struct HitComAlltoallv HitComAlltoallv
HitType hit_comType(const void *varP, HitType baseType)
Hitmap functions to allocate memory.
struct HitComSparse HitComSparse
void hit_comOpMinInt(void *, void *, int *, HitType *)
struct HitComAlltoallv * alltoallv
HitCom hit_comAlltoallSelect(HitLayout lay, const void *tilePSend, HitShape selectionSend, int modeSelectSend, const void *tilePRecv, HitShape selectionRecv, int modeSelectRecv, HitType baseType, int count)
void hit_comInit(int *pargc, char **pargv[])
void hit_comDoBroadcast(HitCom *issue)
void hit_comOpMaxDouble(void *, void *, int *, HitType *)
HitCom hit_comSendRecvReplaceSelectTag(HitLayout lay, HitRanks sendTo, const void *tileP, HitShape selection, int modeSelect, HitRanks receiveFrom, HitType baseType, int tag)
void hit_comOpGenericAnyType(void *in, void *inout, HitType datatype, int offset, size_t tam, HitComOpFunction f)
HitCom hit_comSparseScatterRowsInternal(HitLayout lay, const void *tilePSend, const void *tilePRecv, HitType baseType, const char *file, int line)
void hit_comDoSparseUpdate(HitCom *issue)
HitCom hit_comReduceDimSelect(HitLayout lay, int dim, HitRanks root, const void *tilePSend, HitShape selectionSend, int modeSelectSend, const void *tilePRecv, HitShape selectionRecv, int modeSelectRecv, HitType baseType, HitOp operation)
void hit_comAllowDim(HitLayout *lay, int dim)
void hit_comOpMinDouble(void *, void *, int *, HitType *)
void hit_comDoRecv(HitCom *issue)
void hit_comStartSend(HitCom *issue)