@@ -241,10 +241,11 @@ void bufferize(void *cptr, SHARPY::DTypeId dtype, const int64_t *sizes,
241241 });
242242}
243243
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) {
248249 if (!in || !sizes || !strides || !tStarts || !tSizes || !out) {
249250 return ;
250251 }
@@ -269,8 +270,8 @@ void unpack(void *in, SHARPY::DTypeId dtype, const int64_t *sizes,
269270}
270271
271272// / 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) {
274275 if (!in || !sizes || !strides || !out) {
275276 return ;
276277 }
@@ -522,8 +523,8 @@ WaitHandleBase *_idtr_copy_reshape(SHARPY::DTypeId sharpytype,
522523 roffs = std::move (roffs)]() {
523524 tc->wait (hdl);
524525 if (isStrided) {
525- unpack1 (rBuff, sharpytype, oDataShapePtr, oDataStridesPtr, oNDims,
526- oDataPtr);
526+ unpack (rBuff, sharpytype, oDataShapePtr, oDataStridesPtr, oNDims,
527+ oDataPtr);
527528 delete[] (char *) rBuff;
528529 }
529530 };
@@ -931,15 +932,15 @@ void *_idtr_update_halo(SHARPY::DTypeId sharpytype, int64_t ndims,
931932 tc->wait (lwh);
932933 std::vector<int64_t > recvBufferStart (nworkers * ndims, 0 );
933934 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);
937938 }
938939 tc->wait (rwh);
939940 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);
943944 }
944945 };
945946
0 commit comments