diff options
Diffstat (limited to 'src/slab.cc')
-rw-r--r-- | src/slab.cc | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/slab.cc b/src/slab.cc index a60eebc..037c298 100644 --- a/src/slab.cc +++ b/src/slab.cc @@ -755,23 +755,24 @@ copy_data (const vector<xfer> &info, assert(srcptr); # pragma omp parallel for - { - int ipos[SLAB_MAXDIM]; - for (ipos[2] = 0; ipos[2] < srcdetaillenk; ++ipos[2]) { - for (ipos[1] = 0; ipos[1] < srcdetaillenj; ++ipos[1]) { - for (ipos[0] = 0; ipos[0] < srcdetailleni; ++ipos[0]) { - int const srcindi = srcdetailoffi + ipos[0] - srcoffi; - int const srcindj = srcdetailoffj + ipos[1] - srcoffj; - int const srcindk = srcdetailoffk + ipos[2] - srcoffk; - ifcheck assert (srcindi>=0 and srcindi<srcleni); - ifcheck assert (srcindj>=0 and srcindj<srclenj); - ifcheck assert (srcindk>=0 and srcindk<srclenk); - size_t const srcind = - srcindi + srcleni * (srcindj + srclenj * srcindk); - size_t const bufind = - ipos[xpose_x] + dstdetailleni * (ipos[xpose_y] + dstdetaillenj * ipos[xpose_z]); - srcdataptr[bufind] = srcptr[srcind]; - } + for (int k = 0; k < srcdetaillenk; ++k) { + for (int j = 0; j < srcdetaillenj; ++j) { + for (int i = 0; i < srcdetailleni; ++i) { + int ipos[SLAB_MAXDIM]; + ipos[0] = i; + ipos[1] = j; + ipos[2] = k; + int const srcindi = srcdetailoffi + ipos[0] - srcoffi; + int const srcindj = srcdetailoffj + ipos[1] - srcoffj; + int const srcindk = srcdetailoffk + ipos[2] - srcoffk; + ifcheck assert (srcindi>=0 and srcindi<srcleni); + ifcheck assert (srcindj>=0 and srcindj<srclenj); + ifcheck assert (srcindk>=0 and srcindk<srclenk); + size_t const srcind = + srcindi + srcleni * (srcindj + srclenj * srcindk); + size_t const bufind = + ipos[xpose_x] + dstdetailleni * (ipos[xpose_y] + dstdetaillenj * ipos[xpose_z]); + srcdataptr[bufind] = srcptr[srcind]; } } } |