Skip to content

Commit

Permalink
Merge pull request #5920 from awallace-cray/chapdev-168
Browse files Browse the repository at this point in the history
Fix multi-ddata for aligned arrays (cherry-pick #5903)
[approved for release/1.15]
  • Loading branch information
awallace-cray authored Mar 31, 2017
2 parents c5f86fc + 415f5c8 commit 27ebd8c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/internal/DefaultRectangular.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ module DefaultRectangular {
high = if rad.stridable then strideAlignDown(high, newDom.dsiDim(mdParDim)) else high;

const rng = low..high;
rad.mData(i).pdr = if !rad.stridable then rng else rng by newDom.dsiDim(mdParDim).stride;
rad.mData(i).pdr = if !rad.stridable then rng else rng by newDom.dsiDim(mdParDim).stride align newDom.dsiDim(mdParDim).alignment;
}

}
Expand Down Expand Up @@ -980,7 +980,7 @@ module DefaultRectangular {
high += radLo;

const rng = low..high;
rad.mData(i).pdr = if !rad.stridable then rng else rng by radStr;
rad.mData(i).pdr = if !rad.stridable then rng else rng by radStr align newDom.dsiDim(mdParDim).alignment;
}
}

Expand Down Expand Up @@ -1052,7 +1052,7 @@ module DefaultRectangular {
for i in 1..#mdNumChunks {
const rng = max(this.mData(i).pdr.low, newDom.dsiDim(rad.mdParDim).low)
..min(this.mData(i).pdr.high, newDom.dsiDim(rad.mdParDim).high);
rad.mData(i).pdr = if !rad.stridable then rng else rng by newDom.dsiDim(rad.mdParDim).stride;
rad.mData(i).pdr = if !rad.stridable then rng else rng by newDom.dsiDim(rad.mdParDim).stride align newDom.dsiDim(rad.mdParDim).alignment;
}
} else {
// If the mdParDim'th dimension is removed, then we switch to
Expand All @@ -1069,7 +1069,7 @@ module DefaultRectangular {
for i in 1..#mdNumChunks {
const (lo, hi) = rad.mdChunk2Ind(i-1);
const rng = max(lo, newDom.dsiDim(1).low) .. min(hi, newDom.dsiDim(1).high);
rad.mData(i).pdr = if !rad.stridable then rng else rng by newDom.dsiDim(1).stride;
rad.mData(i).pdr = if !rad.stridable then rng else rng by newDom.dsiDim(1).stride align newDom.dsiDim(1).alignment;
}
}
}
Expand Down Expand Up @@ -1575,7 +1575,7 @@ module DefaultRectangular {
if mdNumChunks == 1 {
if stridable then
mData(0).pdr = dom.dsiDim(mdParDim).low..dom.dsiDim(mdParDim).high
by dom.dsiDim(mdParDim).stride;
by dom.dsiDim(mdParDim).stride align dom.dsiDim(mdParDim).alignment;
else
mData(0).pdr = dom.dsiDim(mdParDim).low..dom.dsiDim(mdParDim).high;
mData(0).data =
Expand All @@ -1589,7 +1589,7 @@ module DefaultRectangular {
mData(i).dataOff = dataOff;
const (lo, hi) = mdChunk2Ind(i);
if stridable then
mData(i).pdr = lo..hi by dom.dsiDim(mdParDim).stride;
mData(i).pdr = lo..hi by dom.dsiDim(mdParDim).stride align dom.dsiDim(mdParDim).alignment;
else
mData(i).pdr = lo..hi;
const chunkSize = size / mdRLen * mData(i).pdr.length;
Expand Down

0 comments on commit 27ebd8c

Please sign in to comment.