@@ -241,10 +241,11 @@ void bufferize(void *cptr, SHARPY::DTypeId dtype, const int64_t *sizes,
241
241
});
242
242
}
243
243
244
- // / copy contiguous block of data into a possibly strided array
245
- void unpack (void *in, SHARPY::DTypeId dtype, const int64_t *sizes,
246
- const int64_t *strides, const int64_t *tStarts,
247
- const int64_t *tSizes, uint64_t nd, uint64_t N, void *out) {
244
+ // / copy contiguous block of data into a possibly strided array distributed to N
245
+ // / ranks
246
+ void unpackN (void *in, SHARPY::DTypeId dtype, const int64_t *sizes,
247
+ const int64_t *strides, const int64_t *tStarts,
248
+ const int64_t *tSizes, uint64_t nd, uint64_t N, void *out) {
248
249
if (!in || !sizes || !strides || !tStarts || !tSizes || !out) {
249
250
return ;
250
251
}
@@ -269,8 +270,8 @@ void unpack(void *in, SHARPY::DTypeId dtype, const int64_t *sizes,
269
270
}
270
271
271
272
// / copy contiguous block of data into a possibly strided array
272
- void unpack1 (void *in, SHARPY::DTypeId dtype, const int64_t *sizes,
273
- const int64_t *strides, uint64_t ndim, void *out) {
273
+ void unpack (void *in, SHARPY::DTypeId dtype, const int64_t *sizes,
274
+ const int64_t *strides, uint64_t ndim, void *out) {
274
275
if (!in || !sizes || !strides || !out) {
275
276
return ;
276
277
}
@@ -522,8 +523,8 @@ WaitHandleBase *_idtr_copy_reshape(SHARPY::DTypeId sharpytype,
522
523
roffs = std::move (roffs)]() {
523
524
tc->wait (hdl);
524
525
if (isStrided) {
525
- unpack1 (rBuff, sharpytype, oDataShapePtr, oDataStridesPtr, oNDims,
526
- oDataPtr);
526
+ unpack (rBuff, sharpytype, oDataShapePtr, oDataStridesPtr, oNDims,
527
+ oDataPtr);
527
528
delete[] (char *) rBuff;
528
529
}
529
530
};
@@ -931,15 +932,15 @@ void *_idtr_update_halo(SHARPY::DTypeId sharpytype, int64_t ndims,
931
932
tc->wait (lwh);
932
933
std::vector<int64_t > recvBufferStart (nworkers * ndims, 0 );
933
934
if (cache->_bufferizeLRecv ) {
934
- unpack (lRecvData, sharpytype, leftHaloShape, leftHaloStride,
935
- recvBufferStart.data (), cache->_lRecvBufferSize .data (), ndims,
936
- nworkers, leftHaloData);
935
+ unpackN (lRecvData, sharpytype, leftHaloShape, leftHaloStride,
936
+ recvBufferStart.data (), cache->_lRecvBufferSize .data (), ndims,
937
+ nworkers, leftHaloData);
937
938
}
938
939
tc->wait (rwh);
939
940
if (cache->_bufferizeRRecv ) {
940
- unpack (rRecvData, sharpytype, rightHaloShape, rightHaloStride,
941
- recvBufferStart.data (), cache->_rRecvBufferSize .data (), ndims,
942
- nworkers, rightHaloData);
941
+ unpackN (rRecvData, sharpytype, rightHaloShape, rightHaloStride,
942
+ recvBufferStart.data (), cache->_rRecvBufferSize .data (), ndims,
943
+ nworkers, rightHaloData);
943
944
}
944
945
};
945
946
0 commit comments